Skip to content

Commit

Permalink
Merge remote-tracking branch 'origin/develop' into develop
Browse files Browse the repository at this point in the history
  • Loading branch information
msinn committed Mar 31, 2024
2 parents 9c4797b + 64c6d15 commit 1be2aac
Show file tree
Hide file tree
Showing 2 changed files with 62 additions and 5 deletions.
22 changes: 17 additions & 5 deletions homematic/__init__.py
Original file line number Diff line number Diff line change
Expand Up @@ -74,6 +74,13 @@ def __init__(self, sh, *args, **kwargs):
self.host = self.get_parameter_value('host')
# self.port = self.get_parameter_value('port')
# self.port_hmip = self.get_parameter_value('port_hmip')
self.proxyPort = self.get_parameter_value('proxyPort')
self.proxyPort_hmip = self.get_parameter_value('proxyPort_hmip')
self.customCallbackHost = self.get_parameter_value('customCallbackHost')
self.callbackHost = self.get_parameter_value('callbackHost')
self.callbackPort = self.get_parameter_value('callbackPort')
self.callbackPort_hmip = self.get_parameter_value('callbackPort_hmip')

self.port = 2001
self.port_hmip = 2010

Expand All @@ -83,10 +90,12 @@ def __init__(self, sh, *args, **kwargs):
self.hm_id += '_' + self.get_instance_name()
# create HomeMatic object
try:
self.hm = HMConnection(interface_id="myserver", autostart=False,
remotes={self.hm_id:{"ip": self.host, "port": self.port}}
if(self.customCallbackHost):
remotes={self.hm_id:{"ip": self.host, "port": self.port, "callbackip": self.callbackHost, "callbackport": self.callbackPort}}
self.hm = HMConnection(interface_id="myserver", autostart=False,
eventcallback=self.eventcallback, systemcallback=self.systemcallback,
remotes={self.hm_id:{"ip": self.host, "port": self.port}})
# remotes={self.hm_id:{"ip": self.host, "port": self.port}, self.hmip_id:{"ip": self.host, "port": self.port_hmip}})
remotes=remotes, localport=self.proxyPort, local="0.0.0.0")
except:
self.logger.error("Unable to create HomeMatic object")
self._init_complete = False
Expand All @@ -100,9 +109,12 @@ def __init__(self, sh, *args, **kwargs):
self.hmip_id += '_' + self.get_instance_name()
# create HomeMaticIP object
try:
self.hmip = HMConnection(interface_id="myserver_ip", autostart=False,
remotes={self.hmip_id:{"ip": self.host, "port": self.port_hmip}}
if(self.customCallbackHost):
remotes={self.hmip_id:{"ip": self.host, "port": self.port_hmip, "callbackip": self.callbackHost, "callbackport": self.callbackPort_hmip}}
self.hmip = HMConnection(interface_id="myserver_ip", autostart=False,
eventcallback=self.eventcallback, systemcallback=self.systemcallback,
remotes={self.hmip_id:{"ip": self.host, "port": self.port_hmip}})
remotes=remotes, localport=self.proxyPort_hmip, local="0.0.0.0")
except:
self.logger.error("Unable to create HomeMaticIP object")
# self._init_complete = False
Expand Down
45 changes: 45 additions & 0 deletions homematic/plugin.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -32,6 +32,51 @@ parameters:
de: 'IP Adresse bzw. Hostname der HomeMatic CCU2 Zentrale'
en: 'ip address or hostname of the HomeMatic CCU2 gateway'

proxyPort:
type: int
default: 0
valid_min: 0
description:
de: 'Port Nummer für eingehende Nachrichten von der HomeMatric CCU2 Zentrale'
en: 'port number for incoming messages from the HomeMatric CCU2 gateway'

proxyPort_hmip:
type: int
default: 0
valid_min: 0
description:
de: 'Port Nummer für eingehende Nachrichten von der HomeMatric CCU2 Zentrale für HomeMaticIP Geräte'
en: 'port number for incoming messages from the HomeMatric CCU2 gateway for HomeMaticIP Devices'

customCallbackHost:
type: bool
mandatory: False
description:
de: 'Legt fest, ob Callbacks umgeleitet werden soll (z.B. Docker Host), default FALSE'
en: 'determine if callbacks must be reditected (e.g. Docker Host), default FALSE'

callbackHost:
type: ip
default: '127.0.0.1'
description:
de: 'IP Adresse bzw. Hostname, an die die HomeMatric CCU2 Zentrale Nachrichten senden soll (z.B. Docker Host)'
en: 'ip address or hostname, to which the HomeMatric CCU2 gateway has to send messages (e.g. Docker Host)'

callbackPort:
type: int
default: 30000
valid_min: 0
description:
de: 'Port Nummer, an die die HomeMatric CCU2 Zentrale Nachrichten senden soll (z.B. Docker Host)'
en: 'port number, to which the HomeMatric CCU2 gateway has to send messages (e.g. Docker Host)'

callbackPort_hmip:
type: int
default: 30001
valid_min: 0
description:
de: 'Port Nummer, an die die HomeMatric CCU2 Zentrale Nachrichten senden soll (z.B. Docker Host) für HomeMaticIP Geräte'
en: 'port number, to which the HomeMatric CCU2 gateway has to send messages for HomeMaticIP Devices (e.g. Docker Host)'
# port:
# type: int
# default: 2001
Expand Down

0 comments on commit 1be2aac

Please sign in to comment.