Correct syntax for Fritz DECT 301 Window Switch

Hi,
Using Homebridge with NR and homebridge-fritz-platform
(https://github.com/seydx/homebridge-fritz-platform)

I can't seem to figure out the correct syntax to pass on the right command (on/off, true/false) for a window open switch of my thermostats (= invalid payload).
There is no documentation that works for NR.


Does anyone know or have the same issue?
Best regards

Hi - welcome to the forum :slight_smile:

In your function, you first set msg.payload to a string - then - you try to set a property on it like it was an object. This is not valid.

try

msg.payload = {
  On: true
}

and

msg.payload = {
  On: false
}

PS, in future, it is better to actually post function code as text as we can edit & fix it up much easier than re-typing it.

EDIT...
Looking at the screenshot, it seems to want On not on (case sensitive) - I updated the above code snippet

1 Like

Hi Steve,
What a welcome! Thank you for the advice. I managed to properly talk to the accessory...

if (msg.payload.ContactSensorState==0)
{
    msg.payload = { On: false };
    return msg;
}
if (msg.payload.ContactSensorState==1)
{
    msg.payload = { On: true };   
    return msg;
}
return null;

Now I get another error stemming from what I believe to be an issue with (multiple) homebridge instances.

"0*:**:**:**:**:C8 -> Error: Homebridge auth failed, invalid PIN 734-**-**8 -> undefined"

"0*:**:**:**:**:C8 -> Error: ERROR: HB Instance not found -> undefined"

The Window contacts are attached through a zigbee bridge and the Open Window switch is attached through another DECT bridge. Because of the number of devices they need to be served by two separate homebridge instances (on the same raspberry pi with node-red, 150 devices limit per bridge)

The two instances are configured in NR with their individual PINs but communication doesn't seem to work, when they are both configured with the same MAC. I did not find a way to specify a port.
Any advice?

This topic was automatically closed 14 days after the last reply. New replies are no longer allowed.