Hi,
I still have problems connecting my homematic completely and correctly to HA. The following message indicates an error when accessing JSON-RPC:
ERROR (Thread-5) [pyhomematic._hm] RPCFunctions.jsonRpcPost: Exception: Invalid \escape: line 1 column 58 (char 57)
Unfortunately I have no idea where I must look for the error. Can someone explain to me which prerequisites on the side of the homematic must be furnished, so that the access works. Must ssh be enabled?
The firewall is already set up and allows full access for HomeMatic XML-RPC API, is this correct?
Is an additional software required on the ccu2? There is only XML API installed.
All actuators and sensors work perfectly, but the i can’t see the variables and virtual channels can’t be used.
Many thanks for your help.
I have created a Python 3 test script for what is done while resolving names. Modify it to use your CCU IP and execute it. If everything is working correctly you should see output of all the devices that are being resolved.
Here’s the script: https://gist.github.com/danielperna84/e252a54f3f871bde7faa2726dda4dcdf
To clarify: the script is to help us pinpoint at which step of resolving the names the error happens. The error message you have posted doesn’t look like it’s failing at the authentication, since there seems to be a response. It just looks as if there are unexpected characters within the response. In the most simple case that would be stuff like öäüß
etc…
If resolving names is working and this error happens during runtime, then that could explain why the variables don’t work. In that case again there would be something in the response we don’t expect. If this is the case I will create another script that fetches the variables.
SSH doesn’t have to be enalbed, and the XML-API plugin only needs to be installed if you want to use it to resolve names instead of using JSON.
The usage of virtual channels is explained in the documentation. You have to trigger them using services.
Edit: I’ve updated the script to also fetch the variables and throw a nested exception if the error you get is just caused by failing to parse the returned JSON data.
Dear Daniel,
many thanks for your effort, unfortunately I am an absolute noob and have no idea at all how this script is to be executed. I adapted the user data and the IP and transferred the file to the RPi, but now i don’t know how to go on.
I checked my Homematic again for umlauts or special characters but none found.
When trying to use the virtual keys, the following error message occurs:
ERROR (Thread-7) [homeassistant.components.homematic] BIDCOS-RF not found for service virtualkey!
PS:
resolving the channel names is not the problem, it works with xml and json !
Hi Daniel,
you are right.
After a few tests i found the special character. It’s a “!” in my password. After deleting the username and password in my config-file there are no more errors in the log.
But using the virtual keys still not working.
You are right, there seems to be a bug with the virtual keys. I’ve never used them, so at some point in the past this feature seems to got broken.
IS WORKING!
Perfect, thank you very much and a nice weekend.
1 Like
I still face the same issue. I get this error all the time
You mean the RPCFunctions.jsonRpcPost: Exception: Invalid \escape...
error? This can’t be solved from our side. The CCU is delivering invalid JSON when that error occurs.
Yes. Good to know
Thank you
Just to let you know that I’ve raised the issue with jens-maus, the author of raspberrymatic, who’ll raise it in turn with EQ3: https://github.com/jens-maus/RaspberryMatic/issues/239#issuecomment-356228263
1 Like