seydx / homebridge-fritz-platform

AiO Homebridge dynamic platform plugin for AVM hardware like Fritz!Box, Fritz!Repeater etc.
MIT License
223 stars 32 forks source link

Node-Red Syntax unclear #269

Closed luedi0 closed 2 years ago

luedi0 commented 2 years ago

Describe the bug I would like to use Node-Red for automations instead of HomeKit as it isn't always reliable (3 home hubs are messing with each other at home despite only one being enabled, rest disabled...)

To Reproduce When trying to us the hb-control node for the Open Window Switch, I am not able to pass on the right msg.payload to enable/disable the switch. I want to automate radiators to be disabled temporarily while windows are open.

Expected behavior I would like to know the expected syntax for the open window switch (and potentially other syntax).

Screenshots

Screenshot 2022-02-06 at 20 56 56
luedi0 commented 2 years ago

I managed to get the proper payload from Node red forums. It is below for those who are interested:

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 have an issue with the fact that Node-red doesn't like to talk to multiple homebridge instances on the same MAC address...