Homematic integration no devices

Hi,

I’m trying to get the homematic integration working with my home assistant.
Here is some information about my setup:
Homeassistant:

  • running in docker container
  • web gui is served under 192.168.1.1:8080

Homematic:

  • running on rpi
  • web gui is served under 192.168.1.2:80

I’m able to manually connect to the json rpc endpoint and perform so common api requests like login etc. so the homematic part seems to work.

Here is my home assistant configuration:

homematic:
  interfaces:
    rf:
      host: 192.168.1.2
      callback_ip: 192.168.1.1
      callback_port: 8080
      username: !secret homematic_username
      password: !secret homematic_password
    groups:
      host: 192.168.1.2
      callback_ip: 192.168.1.1
      callback_port: 8080
      port : 9292
      username: !secret homematic_username
      password: !secret homematic_password
      path: /groups
  hosts:
    ccu3:
      host: 192.168.1.2
      port: 2001
      username: !secret homematic_username
      password: !secret homematic_password

I also enabled the debug logging for the homematic integration but i do not see any errors that would point me in the right direction. I restarted homeassistant and homematic multiple time but still no success.
Here is the debug log from restarting the ccu via homeassistant:

2020-10-19 21:32:31 DEBUG (SyncWorker_47) [pyhomematic._hm] ServerThread.getAllSystemVariables: Getting all System variables via JSON-RPC
2020-10-19 21:32:31 DEBUG (SyncWorker_47) [pyhomematic._hm] RPCFunctions.jsonRpcPost: Method: Session.login
2020-10-19 21:32:31 DEBUG (SyncWorker_47) [pyhomematic._hm] RPCFunctions.jsonRpcPost: API-Endpoint: http://192.168.1.2:80/api/homematic.cgi
2020-10-19 21:32:31 DEBUG (SyncWorker_47) [pyhomematic._hm] RPCFunctions.jsonRpcPost: Method: SysVar.getAll
2020-10-19 21:32:31 DEBUG (SyncWorker_47) [pyhomematic._hm] RPCFunctions.jsonRpcPost: API-Endpoint: http://192.168.1.2:80/api/homematic.cgi
2020-10-19 21:32:31 DEBUG (SyncWorker_47) [pyhomematic._hm] RPCFunctions.jsonRpcPost: Method: Session.logout
2020-10-19 21:32:31 DEBUG (SyncWorker_47) [pyhomematic._hm] RPCFunctions.jsonRpcPost: API-Endpoint: http://192.168.1.2:80/api/homematic.cgi
2020-10-19 21:32:31 DEBUG (SyncWorker_36) [pyhomematic._hm] ServerThread.proxyInit: init('http://192.168.1.1:8080', 'homeassistant-rf')
2020-10-19 21:32:31 INFO (SyncWorker_36) [pyhomematic._hm] Proxy for homeassistant-rf initialized
2020-10-19 21:32:31 DEBUG (SyncWorker_36) [pyhomematic._hm] ServerThread.proxyInit: init('http://192.168.1.1:8080', 'homeassistant-groups')
2020-10-19 21:32:42 INFO (SyncWorker_36) [pyhomematic._hm] Proxy for homeassistant-groups initialized
2020-10-19 21:32:42 WARNING (SyncWorker_36) [pyhomematic._hm] Skipping init for homeassistant-ccu3

I’m searching the web for 3 days and sadly have not found any hint on what could be done to fix the problem. The three thermostats (not homematic ip) are not shown in homeassisatnt (no climate entity is present).

Thanks in advance,
FMK

The problem probably is caused by your callback_ip and callback_port configuration. What is your reasoning to set these options manually? They are just needed in special setups.

If really needed, the callback_ip is the IP address at which the CCU would reach Home Assistant. 192.168.1.1 seems correct if that’s really the IP (however it’s unusual, because in such a subnet the .1 typically is your router).
The callback_port only works if you also set local_port. This should be a random port that is not being used by Home Assistant. This is NOT the port when you open Home Assistant in the brower. For HomeMatic a special server process with its own port (either dynamic or as specified by local_port) is started.

To sum this up: if you don’t have a reason to manually set the optional settings, then don’t. If it doesn’t work without them, read carefully what the optional settings really do.

Hi,

I added the callback_ip and port because of the description in the homematic integration. There is stated that this can be used in combination with docker. I already tried to get it running without it but had no success.

I’ve removed them from the configuraiton but the problem remains the same, the homematic entities are not showing up in homeassistant.

Since there is no callback_ip and port set, homeassistant is listening on a address in the docker ip range. I’m not sure if this would work either.

2020-10-20 09:25:32 DEBUG (SyncWorker_47) [pyhomematic._hm] ServerThread.getAllSystemVariables: Getting all System variables via JSON-RPC
2020-10-20 09:25:32 DEBUG (SyncWorker_47) [pyhomematic._hm] RPCFunctions.jsonRpcPost: Method: Session.login
2020-10-20 09:25:32 DEBUG (SyncWorker_47) [pyhomematic._hm] RPCFunctions.jsonRpcPost: API-Endpoint: http://192.168.1.2:80/api/homematic.cgi
2020-10-20 09:25:32 DEBUG (SyncWorker_47) [pyhomematic._hm] RPCFunctions.jsonRpcPost: Method: SysVar.getAll
2020-10-20 09:25:32 DEBUG (SyncWorker_47) [pyhomematic._hm] RPCFunctions.jsonRpcPost: API-Endpoint: http://192.168.1.2:80/api/homematic.cgi
2020-10-20 09:25:32 DEBUG (SyncWorker_47) [pyhomematic._hm] RPCFunctions.jsonRpcPost: Method: Session.logout
2020-10-20 09:25:32 DEBUG (SyncWorker_47) [pyhomematic._hm] RPCFunctions.jsonRpcPost: API-Endpoint: http://192.168.1.2:80/api/homematic.cgi
2020-10-20 09:25:33 DEBUG (SyncWorker_10) [pyhomematic._hm] ServerThread.proxyInit: init('http://172.20.0.4:39307', 'homeassistant-rf')
2020-10-20 09:25:33 INFO (SyncWorker_10) [pyhomematic._hm] Proxy for homeassistant-rf initialized
2020-10-20 09:25:33 DEBUG (SyncWorker_10) [pyhomematic._hm] ServerThread.proxyInit: init('http://172.20.0.4:39307', 'homeassistant-groups')
2020-10-20 09:25:43 INFO (SyncWorker_10) [pyhomematic._hm] Proxy for homeassistant-groups initialized
2020-10-20 09:25:43 WARNING (SyncWorker_10) [pyhomematic._hm] Skipping init for homeassistant-ccu3

PS: The IPs are substitutes. It is not really running on .1 in my network!

Then you probably have to set the local_port I have mentioned above and publish that port in Docker, just like you did with 8080.

Indeed the missing local port was the problem.

Thanks for your help!

Here is the configuration that works for me:

homematic:
  local_port: 8081
  interfaces:
    rf:
      host: 192.168.1.2
      callback_ip: 192.168.1.1
      callback_port: 8080
      username: !secret homematic_username
      password: !secret homematic_password
    groups:
      host: 192.168.1.2
      callback_ip: 192.168.1.1
      callback_port: 8080
      port : 9292
      username: !secret homematic_username
      password: !secret homematic_password
      path: /groups
  hosts:
    ccu3:
      host: 192.168.1.2
      port: 2001
      username: !secret homematic_username
      password: !secret homematic_password

In my docker container im mapping port 8080 and 8081 to the respecting host ports!