Homematic ccu3


#41

Do you know if anyone has it working on SSL? Where it is now, using the config as above, Home Assistant hangs indefinitely.:

2019-02-09 21:15:45 INFO (MainThread) [homeassistant.loader] Loaded persistent_notification from homeassistant.components.persistent_notification,
2019-02-09 21:15:45 INFO (MainThread) [homeassistant.setup] Setup of domain introduction took 0.0 seconds.,
2019-02-09 21:15:45 INFO (MainThread) [homeassistant.loader] Loaded logger from homeassistant.components.logger,
2019-02-09 21:15:45 INFO (MainThread) [homeassistant.setup] Setting up logger,
2019-02-09 21:15:46 DEBUG (SyncWorker_1) [pyhomematic.connection] HMConnection: Creating server object,
2019-02-09 21:15:46 DEBUG (SyncWorker_1) [pyhomematic._hm] ServerThread.__init__,
2019-02-09 21:15:46 DEBUG (SyncWorker_1) [pyhomematic._hm] __init__: Creating proxies,
2019-02-09 21:15:46 INFO (SyncWorker_1) [pyhomematic._hm] Creating proxy rf. Connecting to 192.168.16.13:32001,
2019-02-09 21:15:46 DEBUG (SyncWorker_1) [pyhomematic._hm] LockingServerProxy.__init__: Getting local ip,
2019-02-09 21:15:46 DEBUG (SyncWorker_1) [pyhomematic._hm] LockingServerProxy.__init__: Got local ip 192.168.16.22,
2019-02-09 21:15:46 INFO (SyncWorker_1) [pyhomematic._hm] Creating proxy ip. Connecting to 192.168.16.13:32010,
2019-02-09 21:15:46 DEBUG (SyncWorker_1) [pyhomematic._hm] LockingServerProxy.__init__: Getting local ip,
2019-02-09 21:15:46 DEBUG (SyncWorker_1) [pyhomematic._hm] LockingServerProxy.__init__: Got local ip 192.168.16.22,
2019-02-09 21:15:46 INFO (SyncWorker_1) [pyhomematic._hm] Creating proxy groups. Connecting to 192.168.16.13:39292/groups,
2019-02-09 21:15:46 DEBUG (SyncWorker_1) [pyhomematic._hm] LockingServerProxy.__init__: Getting local ip,
2019-02-09 21:15:46 DEBUG (SyncWorker_1) [pyhomematic._hm] LockingServerProxy.__init__: Got local ip 192.168.16.22,
2019-02-09 21:15:46 INFO (SyncWorker_1) [pyhomematic._hm] Creating proxy ccu3. Connecting to 192.168.16.13:2001,
2019-02-09 21:15:46 DEBUG (SyncWorker_1) [pyhomematic._hm] LockingServerProxy.__init__: Getting local ip,
2019-02-09 21:15:46 DEBUG (SyncWorker_1) [pyhomematic._hm] LockingServerProxy.__init__: Got local ip 192.168.16.22,
2019-02-09 21:15:46 DEBUG (SyncWorker_1) [pyhomematic._hm] RPCFunctions.__init__,
2019-02-09 21:15:46 DEBUG (SyncWorker_1) [pyhomematic._hm] RPCFunctions.__init__: iterating proxy = homeassistant-rf,
2019-02-09 21:15:46 DEBUG (SyncWorker_1) [pyhomematic._hm] RPCFunctions.__init__: devices_raw = [],
2019-02-09 21:15:46 DEBUG (SyncWorker_1) [pyhomematic._hm] RPCFunctions.createDeviceObjects: iterating interface_id = rf,
2019-02-09 21:15:46 DEBUG (SyncWorker_1) [pyhomematic._hm] RPCFunctions.__init__: iterating proxy = homeassistant-ip,
2019-02-09 21:15:46 DEBUG (SyncWorker_1) [pyhomematic._hm] RPCFunctions.__init__: devices_raw = [],
2019-02-09 21:15:46 DEBUG (SyncWorker_1) [pyhomematic._hm] RPCFunctions.createDeviceObjects: iterating interface_id = ip,
2019-02-09 21:15:46 DEBUG (SyncWorker_1) [pyhomematic._hm] RPCFunctions.__init__: iterating proxy = homeassistant-groups,
2019-02-09 21:15:46 DEBUG (SyncWorker_1) [pyhomematic._hm] RPCFunctions.__init__: devices_raw = [],
2019-02-09 21:15:46 DEBUG (SyncWorker_1) [pyhomematic._hm] RPCFunctions.createDeviceObjects: iterating interface_id = groups,
2019-02-09 21:15:46 DEBUG (SyncWorker_1) [pyhomematic._hm] RPCFunctions.__init__: iterating proxy = homeassistant-ccu3,
2019-02-09 21:15:46 DEBUG (SyncWorker_1) [pyhomematic._hm] RPCFunctions.__init__: devices_raw = [],
2019-02-09 21:15:46 DEBUG (SyncWorker_1) [pyhomematic._hm] RPCFunctions.createDeviceObjects: iterating interface_id = ccu3,
2019-02-09 21:15:46 DEBUG (SyncWorker_1) [pyhomematic._hm] ServerThread.__init__: Setting up server,
2019-02-09 21:15:46 DEBUG (SyncWorker_1) [pyhomematic._hm] ServerThread.__init__: Registering RPC functions,
2019-02-09 21:15:46 INFO (Thread-2) [pyhomematic._hm] Starting server at http://0.0.0.0:43955,
2019-02-09 21:15:46 DEBUG (SyncWorker_1) [pyhomematic._hm] ServerThread.proxyInit: init('http://192.168.16.22:43955', 'homeassistant-rf'),
2019-02-09 21:15:56 WARNING (MainThread) [homeassistant.setup] Setup of homematic is taking over 10 seconds.,

#42

As a test, I setup a Pi 3 with a clean install of RaspberryMatic. Apart from setting up the firewall and creating the Guest user, I only created a Heating Test Group. I could not add any devices as I do not have a spare RF adaptor. My results:

As I have no BidCos or HM-IP devices on the Pi, I changed your script to ports 9292 and 39292. On port 9292 it fails with Got Interface: False.

On port 39292 is get this:

C:\Temp>ccu_test_jsonrpc.py
DEBUG:__main__:jsonRpcPost: Method: Session.login
DEBUG:__main__:jsonRpcPost: API-Endpoint: http://192.168.16.54/api/homematic.cgi
DEBUG:__main__:Result: {'id': 0, 'version': '1.1', 'result': 'LL5WrQGEHw', 'error': None}
DEBUG:__main__:jsonRpcPost: Method: Interface.listInterfaces
DEBUG:__main__:jsonRpcPost: API-Endpoint: http://192.168.16.54/api/homematic.cgi
DEBUG:__main__:Response: {'id': 0, 'version': '1.1', 'result': [{'name': 'VirtualDevices', 'port': 39292, 'info': 'Virtual Devices'}], 'error': None}
DEBUG:__main__:Got interface: VirtualDevices
DEBUG:__main__:jsonRpcPost: Method: Device.listAllDetail
DEBUG:__main__:jsonRpcPost: API-Endpoint: http://192.168.16.54/api/homematic.cgi
DEBUG:__main__:Resolving devicenames
DEBUG:__main__:Handling device: INT0000001
DEBUG:__main__:Name: Test Group INT0000001
DEBUG:__main__:jsonRpcPost: Method: SysVar.getAll
DEBUG:__main__:jsonRpcPost: API-Endpoint: http://192.168.16.54/api/homematic.cgi
INFO:__main__:Variables: {}
DEBUG:__main__:jsonRpcPost: Method: Session.logout

So you can see my test group: DEBUG:main:Name: Test Group INT0000001

I conclude that RaspberryMatic defaults to SSL and that this breaks JSON name resolution on Home Assistant.


#43

A clean installation of RaspberryMatic doesn’t have SSL enabled. I have RaspberryMatic (without SSL) and resolving names works just fine.

In your test, did you try this before enabeling SSL on RaspberryMatic? Maybe RaspberryMatic has a bug where the JSON-RPC API does not switch back to non-SSL once SSL has been enabled. If so, you should open an issue here: https://github.com/jens-maus/RaspberryMatic/issues


#44

But I did not enable SSL on the test PI. To enable SSL, I presume you go to Control Panel, Network Setting and create the certifcate there. To confirm this, I reflashed my SD card and rebooted the Pi. I then navigated to the IP address using HTTPS and this is what I see:

So it already has a certificate and it is listening on port 443.


#45

Ok, it wasn’t like this before. Maybe they started doing that later on when the CCU3 came along. Now that I’m testing this I have to agree that I can access via SSL, even though I have never setup any certificates. :confused:


#46

Also, see here: https://github.com/jens-maus/RaspberryMatic/issues/59
RaspberryMatic generates self-signed certs from March 2017. I guess if were using RaspberryMatic before then, you would not have SSL enabled and the upgrades would respect that. I have been using it for 6 months sso I get SSL by default


#47

Ok, to fix this in the test-script replace the line
if i['port'] == PORT:
with
if i['port'] in [PORT, PORT + 30000]:

To do the same in pyhomematic you have to change this line to:
if i['port'] in [self.remotes[remote]['port'], self.remotes[remote]['port'] + 30000]:


#48

Success! Thank you very much for sticking with this. It was a minor problem, but it bugged me for some time that I couldn’t get it to work. Well done!


#49

Can I be a real pain and ask one more question? I have a HM-LC-Sw4-DR-2 4 channel relay to control heating and hot water. It looks like this:

But in Home Assistant only the parent name is used:

Central%20Heating%20Switch%202

Can it display the names of the child nodes? If not, no problem!


#50

No, only the parent name is used when resolving names. You can however click on the entity so that the card opens. In the upper right corner there’s a gear-icon. If you click that you can rename the entity ID however your like.


#51

No problem, I suspected as much.