Homematic json-rpc parser cannot handle "$\{sysVariables}"

Hello,

I try to use system variables in my homematic configuration, but when I set variables to true I see this error in the command line outline output:

2017-06-25 22:14:18 ERROR (SyncWorker_7) [pyhomematic._hm] RPCFunctions.jsonRpcPost: Exception: Invalid \escape: line 1 column 58 (char 57)

Digging into this I found this gist by @danielperna84 and modified it to print the output. See:

{"id": 0,"version": "1.1","result": [{"id":"40","name":"$\{sysVarAlarmMessages}","type":"NUMBER","unit":"","value":"0","channelId":"65535","minValue":"0","maxValue":"65000","isLogged":false,"isVisible":false,"isInternal":true},{"id":"1236","name":"$\{sysVarAlarmZone1}","type":"ALARM","unit":"","value":"","channelId":"65535","valueName0":"$\{sysVarAlarmZone1NotTriggered}","valueName1":"$\{sysVarAlarmZone1Triggered}","isLogged":false,"isVisible":true,"isInternal":false},{"id":"950","name":"$\{sysVarPresence}","type":"LOGIC","unit":"","value":"true","channelId":"65535","valueName0":"$\{sysVarPresenceNotPresent}","valueName1":"$\{sysVarPresencePresent}","isLogged":false,"isVisible":true,"isInternal":false},{"id":"41","name":"$\{sysVarServiceMessages}","type":"NUMBER","unit":"","value":"0","channelId":"65535","minValue":"0","maxValue":"65000","isLogged":false,"isVisible":false,"isInternal":true},{"id":"1505","name":"Heizprofil","type":"NUMBER","unit":"","value":"0.000000","channelId":"65535","minValue":"0","maxValue":"65000","isLogged":false,"isVisible":true,"isInternal":false}],"error": null}

The problem seems to be with $\{sysVarAlarmMessages}

I see two possible ways out:

  1. Fixing the JSON-Parser and
  2. make the ccu stop printing out those placeholder names.

Sadly, I don’t know how to do any of these things. Maybe someone can point me in the right direction.

Kind regards

Karsten

Env: Hass 0.47.1 | Python 3.6.1| Debian (jessie)

Can you reproduce this issue with a lower Python version? I assume that sysVarAlarmMessages variable is one of the defaults of the CCU, and since nobody else is experiencing the issue (at least there haven’t been any reports yet to my knowledge) either nobody else is using Python 3.6 with variables, or it is a local issue for you. If you only get the error with Python 3.6, it could indeed be an issue with the JSON module, which is part of the standard library. Hence this would actually be a bug to file for the Python core.
If, on the other hand, the escape the CCU inserts does not conform to the JSON standard, then it would be EQ3 who would need to fix this, since we can’t expect the Python developers to integrate a workaround for a faulty JSON implementation.

yeah, I agree … My gut feeling is that the CCU is not standard complient here, but I haven’t checked.

Another explanation might be that my CCU is brand new and the firmware was updated right away. Maybe the placeholder names are something new and people who migrated to the newest version don’t get them. Nevertheless I found a workaround by renaming those sysvars using the script tesing functionality and some commands I found here: https://homematic-forum.de/forum/viewtopic.php?f=26&t=28538&start=10#p258495

I will now check if the JSON is standard compliant.

Yep … invalid JSON from the CCU …

I am experiencing exactly the same issue.

@bruns and @jens
What are the firmware versions of your CCUs?

@danielperna84 current version is: 2.29.18

2.27.8 – haven’t updated yet.

I already send a bug report to eq-3 but they looked at it after the release of the new firmware, so I dont expect it to be fixed in the current version.

Hi,

any news on this? I also get this error and this prevents me using HA with Homematic right now. I have the newest firmware on the CCU2 and using HA 0.60

Any way to disable the usage of the system variables? Maybe @danielperna84?

Best, Ingo.

1 Like

If you still get the error, then eq3 still hasn’t fixed the bug yet.

To disable variables in 0.60 it should be sufficient to just remove the host part of your configuration. interface is the one that holds XML-RPC endpoints, which are the ones required to get your devices into HASS. Hubs (CCU2, Homegear) go into the host part, but are not needed if you don’t make use of the features they provide.

Thanks for the quick response. That works for now. Do you know if there is already a bug report done to eq3?
Another question: As I understand, there is now support for Homematic IP devices, if they are connected via the CCU2. I have one thermostat there, HmIP-BWTH, which is also mentioned in the device list, but does not appear on the dashboard. What I am missing?

Best, Ingo.

As far as I know someone already did report the bug to eq3. But it won’t hurt if someone else reports it so they know there are more people having the issue. :wink:

For IP devices you have to add a second interface entry in your configuration pointing to port 2010 of your CCU. We don’t support every device though, so if it does not show up, then support might be still missing. There often are different variants of the same device, and even though one works, support for a device with a different name but same functionality has to be explicitly added.

Just FYI, this bug has been fixed in the CCU2 firmware version 2.35.x.

1 Like