marcsowen / homebridge-homematicip

Homematic IP plugin for homebridge
Apache License 2.0
77 stars 20 forks source link

FEHLERCannot request HmIP-DLD #257

Open PanoramaTom opened 2 years ago

PanoramaTom commented 2 years ago

Hello, I have after many attempts managed to integrate Homematic IP in Hoobs 4. The only thing I currently have is the door lock, which I also see in Homekit. Only when I try to lock it in the Home app, it does not work. In the log of Hoobs I then see a long error message: FEHLERCannot request: url=https://srv30.homematic.com:6969/hmip/device/control/setLockState, request="{\"channelIndex\":1,\"deviceId\":\"3014xxxxxxxx\",\"authorizationPin\":\"0000\",\"targetLockState\":\"LOCKED\"}", headers={"content-type":"application/json","accept":"application/json","VERSION":"12","AUTHTOKEN":"xxxxxxxx","CLIENTAUTH":"xxxxxxx"}, code=400, message=Bad Request

What did I do wrong? Do you have any ideas?

Best regards Thomas

marcsowen commented 2 years ago

Hi @PanoramaTom,

is your PIN actually 0000? Don't forget this PIN is not your system PIN but the access control PIN associated with the door lock itself. If you didn't assign an individual door lock PIN, please remove it from the config completely.

As far as I remember, I get this kind of error when the PIN is not correct or you send a PIN when there is actually none set in for the door lock.

photis commented 2 months ago

Allow me to hi-jack this issue, please tell me if I should open a fresh one. I'm getting something similar for a newly installed HmIP-DLD, when I try to control it through Homekit. Locking/unlocking work fine when I use the HomeMatic IP app on my smartphone. When I try to lock or unlock via homekit, I see this In the Homebridge log:

Cannot request: url=https://srv0033.a.homematic.com:6969/hmip/device/control/setLockState, request="{\"channelIndex\":1,\"deviceId\":\"3014F711A000xxxxxxxxxx4D\",\"authorizationPin\":\"\",\"targetLockState\":\"OPEN\"}", headers={"content-type":"application/json","accept":"application/json","VERSION":"12","AUTHTOKEN":"xxxxxxxxxxxxxxxx","CLIENTAUTH":"xxxxxxxxxxxxxxxxx"}, code=400, message=Bad Request, response.headers={}

When I open the URL in a browser it responds with" errorCode: "CLIENT_VERSION_NOT_SUPPORTED"

I have added the device parameter to the json config as instructed in: https://github.com/marcsowen/homebridge-homematicip/wiki#hmip-dld. There is no PIN defined for the accessory. The AUTHTOKEN corresponds to the one defined in the json config. I have no idea where the CLIENTAUTH comes from.

Homebridge v1.8.4 Node.js Version v20.12.2 homebridge-homematicip v1.3.1

Any help or hint will be much appreciated. Thank you for the wonderful plugin.

photis commented 2 months ago

I am happy to report that my issue has been solved. The inspiration came from this thread: https://github.com/marcsowen/homebridge-homematicip/issues/238

Solution: in the Homematic IP app on my iPhone in More/Acces/Access authorisations I found a bunch of "homebridge-homematic" entries, none of which were set. I don’t know where these identical entries came from (I have been fiddling with the app/system a lot over the past years), but anyway, after I enabled them all, saved the settings and went into the Home app on the iPhone, everything worked like a charm.