Home Assistant does not recognise CCU2 but recognise wireless component

Hello,

strange error, i try to connect my CCU2 with Home Assistant the wireless component is detected but CCU2 isn’t recognised.
Tryed everything but no luck…
My config file for homematic:

homematic:
interfaces:
wireless:
host: 10.0.0.4
resolvenames: json
hosts:
ccu2:
host: 10.0.0.4

Here is what the log says:

2018-01-25 21:10:08 DEBUG (SyncWorker_8) [pyhomematic.connection] HMConnection: Creating server object
2018-01-25 21:10:08 DEBUG (SyncWorker_8) [pyhomematic._hm] ServerThread.init
2018-01-25 21:10:08 DEBUG (SyncWorker_8) [pyhomematic._hm] init: Creating proxies
2018-01-25 21:10:08 INFO (SyncWorker_8) [pyhomematic._hm] Creating proxy wireless. Connecting to #had to remove the address
2018-01-25 21:10:08 DEBUG (SyncWorker_8) [pyhomematic._hm] LockingServerProxy.init: Getting local ip
2018-01-25 21:10:08 DEBUG (SyncWorker_8) [pyhomematic._hm] LockingServerProxy.init: Got local ip 10.0.0.1
2018-01-25 21:10:08 DEBUG (SyncWorker_8) [pyhomematic._hm] RPCFunctions.init
2018-01-25 21:10:08 DEBUG (SyncWorker_8) [pyhomematic._hm] RPCFunctions.init: iterating proxy = homeassistant-wireless
2018-01-25 21:10:08 DEBUG (SyncWorker_8) [pyhomematic._hm] RPCFunctions.init: devices_raw = []
2018-01-25 21:10:08 DEBUG (SyncWorker_8) [pyhomematic._hm] RPCFunctions.createDeviceObjects: iterating interface_id = wireless
2018-01-25 21:10:08 DEBUG (SyncWorker_8) [pyhomematic._hm] ServerThread.init: Setting up server
2018-01-25 21:10:08 DEBUG (SyncWorker_8) [pyhomematic._hm] ServerThread.init: Registering RPC functions
2018-01-25 21:10:08 INFO (Thread-2) [pyhomematic._hm] Starting server at #had to remove the address
2018-01-25 21:10:08 DEBUG (SyncWorker_8) [pyhomematic._hm] ServerThread.proxyInit: init(’#had to remove the address’, ‘homeassistant-wireless’)
2018-01-25 21:10:08 DEBUG (Thread-2) [pyhomematic._hm] RPCFunctions.listDevices: interface_id = homeassistant-wireless, _devices_raw = {‘wireless’: []}
2018-01-25 21:10:08 INFO (SyncWorker_8) [pyhomematic._hm] Proxy initialized
2018-01-25 21:10:08 DEBUG (SyncWorker_11) [pyhomematic._hm] ServerThread.getServiceMessages: Exception: ‘homeassistant-ccu2’
2018-01-25 21:10:08 DEBUG (SyncWorker_5) [pyhomematic._hm] ServerThread.getAllSystemVariables: Exception: ‘homeassistant-ccu2’

Did you try specifying username and password both for wireless and ccu2? For interfaces credentials are needed when resolving names with json, and access to variables in the hosts-section is protected with credentials as well.

Yes tried that with the Admin account, no change but the sensors and switches have now different names.

What else can i do?

I’m using Home Assistant v0.61.1 and CCU2 v2.31.25
Edit: Forget to say that i don’t have a password for the CCU2

Danke für die schnelle Antwort. :slight_smile:

@danielperna84

Looking at where it falls over is this not related to the incorrect JSON issue with recent CCU2 firmwares?

Already tried different versions of the firmware (also downgraded and upgraded the CCU2).
When i first tried Home Assistant i can connect to the CCU2 (shows up in the Home Assistant UI but it doesn’t loads any devices) but then i loaded the factory settings and upgraded the firmware to the latest version and can’t connect to it.
Can it be that it something to do with programs and variables because these are now empty.

Then resolving names won’t work. Resolving names strictly is coupled with a username and password: pyhomematic/pyhomematic/_hm.py at 4f9bedecfb872138d5cd5ff6fc08d87bdc4fd74b · danielperna84/pyhomematic · GitHub
So without the username and password you should at least get devices like binary_sensor.QEQ123456. Is that the case? If so, set the password. You should do that in any case for security reasons.

The second part with the variables may be what @andrewdolphin says. The CCU (any version) has a bug that hasn’t been fixed yet. I don’t know under which circumstances it turns up. I had it once, but after that never again. Others are having a really hard time with it. So in case that’s the issue, you would see the ccu2-entity in the HASS UI, but when clicking on it there’s no content in the card which usually displays the variables and their values.
The only workaround for the bug is to use RaspberryMatic, which recently fixed this bug.

Oh, forget to say that i’ve set a password for testing and i get the devices like the example you gave but the ccu2 doesn’t show up in the UI.

Before i reset to factory defaults i see the ccu2 in the UI but it doesn’t load any devices.

I test it a few days and than i probably switch to raspberrymatic.

Could you post the Log Output now that you have set the username and password for the ccu2 in the hosts section? The output in the opening post indicates that those weren’t set. Not that they are set the Logs should look different.

Had to remove this from the posted logfile because the forum don’t let me post more than two links in one post.

Here is the new log:

2018-01-26 09:36:56 DEBUG (SyncWorker_8) [pyhomematic.connection] HMConnection: Creating server object
2018-01-26 09:36:56 DEBUG (SyncWorker_8) [pyhomematic._hm] ServerThread.__init__
2018-01-26 09:36:56 DEBUG (SyncWorker_8) [pyhomematic._hm] __init__: Creating proxies
2018-01-26 09:36:56 INFO (SyncWorker_8) [pyhomematic._hm] Creating proxy wireless. Connecting to http://10.0.0.4:2001
2018-01-26 09:36:56 DEBUG (SyncWorker_8) [pyhomematic._hm] LockingServerProxy.__init__: Getting local ip
2018-01-26 09:36:56 DEBUG (SyncWorker_8) [pyhomematic._hm] LockingServerProxy.__init__: Got local ip 10.0.0.1
2018-01-26 09:36:56 DEBUG (SyncWorker_8) [pyhomematic._hm] RPCFunctions.__init__
2018-01-26 09:36:56 DEBUG (SyncWorker_8) [pyhomematic._hm] RPCFunctions.__init__: iterating proxy = homeassistant-wireless
2018-01-26 09:36:56 DEBUG (SyncWorker_8) [pyhomematic._hm] RPCFunctions.__init__: devices_raw = []
2018-01-26 09:36:56 DEBUG (SyncWorker_8) [pyhomematic._hm] RPCFunctions.createDeviceObjects: iterating interface_id = wireless
2018-01-26 09:36:56 DEBUG (SyncWorker_8) [pyhomematic._hm] ServerThread.__init__: Setting up server
2018-01-26 09:36:56 DEBUG (SyncWorker_8) [pyhomematic._hm] ServerThread.__init__: Registering RPC functions
2018-01-26 09:36:56 INFO (Thread-3) [pyhomematic._hm] Starting server at http://0.0.0.0:39591
2018-01-26 09:36:56 DEBUG (SyncWorker_8) [pyhomematic._hm] ServerThread.proxyInit: init('http://10.0.0.1:39591', 'homeassistant-wireless')
2018-01-26 09:36:56 DEBUG (Thread-3) [pyhomematic._hm] RPCFunctions.listDevices: interface_id = homeassistant-wireless, _devices_raw = {'wireless': []}
2018-01-26 09:36:56 INFO (SyncWorker_8) [pyhomematic._hm] Proxy initialized
2018-01-26 09:36:56 DEBUG (SyncWorker_10) [pyhomematic._hm] ServerThread.getServiceMessages: Exception: 'homeassistant-ccu2'
2018-01-26 09:36:56 DEBUG (SyncWorker_4) [pyhomematic._hm] ServerThread.getAllSystemVariables: Getting all System variables via JSON-RPC
2018-01-26 09:36:56 DEBUG (SyncWorker_4) [pyhomematic._hm] RPCFunctions.jsonRpcPost: Method: Session.login
2018-01-26 09:36:56 DEBUG (SyncWorker_4) [pyhomematic._hm] RPCFunctions.jsonRpcPost: API-Endpoint: http://10.0.0.4/api/homematic.cgi

And here are the new setting (am i missing something?):

homematic:
  interfaces:
    wireless:
      host: 10.0.0.4
      resolvenames: json
      username: Admin
      password: secret
  hosts:
    ccu2:
      host: 10.0.0.4
      username: Admin
      password: secret

One thing i discovered when i set the password and disable automatic login and i open http://10.0.0.4/api/homematic.cgi it doesn’t ask for any username or password and i can access the JSON API.

This exception tells us, that for some reason it has problems with the ccu2-host. Why that is I can’t tell. But now that you mention it I realize, that I have the same problem and don’t get the number of service messages. For me the variables are working though. Are there any other messages after what is the last line in the log you have posted? It stops right before it tries to get the variables. The problem would happen after the login.

Also to verify the configuration of your CCU, please check if your “Firewall Settings” in the CCU allow access to the Script API:

The XML-RPC API doesn’t need to be set to Vollzugriff in most cases. I do that for development reasons. And of course the network that is allowed should match your setup.

I have to correct myself. There won’t be more in the logs than what you have posted. So from what I see it’s working as intended regarding the variables. It’s only the service messages that are not working. At least in my case.

Edit:
I have fixed the bug with the service messages: https://github.com/danielperna84/pyhomematic/pull/114

since v0.61.1 I also dont see the ccu2 entity in my ui anymore, with v62.0 the entity is back again. thanks for this… but still struggeling with the missing variables. really bad that there is no solution to this, as you said in some cases its working even with the rega bug… would be great if we could find out why :wink:

1 Like

@danielperna84
But i don’t see any of my variables and the CCU2 doesn’t show up in the HomeAssistant UI and isn’t recogniced by Home Assistant.

The CCU not showing up was because of a bug. It has been fixed. Home Assistant 0.62 has been releasen today. So if you update, you should get at least the card with the sum of the current service messages. As said before, the variables are a general bug in the CCU, so I can’t do anything about that. Usually people get errors when they have the bug, so I’m not sure why it is not working for you.
Anyways, please first update Home Assistant so we can verify that you get the CCU2 entity.

@danielperna84
After the Uptdate it finaly works, variables (like you mentioned) dosen’t show but the ccu2 card with the numbers of service messages apper.
Thank you very very much for the quick replies… :slight_smile:

Anyways one last question, can i set a variable for the ccu2 from home assistant (need this for HM-Dis-WM55) so to speak that i can change a variable with home assistant for the ccu2?

Vielen Danke und schönes restliches Wochenende. :wink:

Yes, variables could work even when HA is not able to get them. The automation to do that for a boolean would look something like this:

action:
  service: homematic.set_variable_value
  data:
    entity_id: homematic.ccu2
    name: Variablename
    value: true

Tried allready this or is this wrong? (Btw doesn’t work)

Edit: Tried it allready with 1 and 0 but no change

For me that works without a problem. Did you have a look at the logs while calling the service? Maybe the problem that prevents you from receiving the variables also prevents you from setting them.
PS: For a boolean variable all these variants should work (they do for me):

  • "true" / "false"
  • true / false
  • 1 / 0

Here is the log:

e[31m2018-01-28 14:32:41 ERROR (SyncWorker_23) [homeassistant.components.homematic] Variable Alarmanlage not found on ccu2e[0m

but on the CCU2 the variable exists:

Or is this the bug on the CCU2 that it couldn’t read the variables?

Could you increase the log level to debug? I would need to see what exactly happens in the pyhomematic module. So just like the log messages you have posted earlier.

Edit:
If you want you can also use this to manually do what HA tries to do when getting variables. Maybe it gives us a hint of where the probem ist.