NorthernMan54 / node-red-contrib-homebridge-automation

Homebridge and Node-RED Integration
Apache License 2.0
106 stars 18 forks source link

Switch doesn't word on homebridge #62

Closed edmarts closed 4 years ago

edmarts commented 4 years ago

Hello! I use Homebridge and Node-Red on my Mac and I'm having problems with automations. When a device passes through the switch or any other node it loses its content and I cannot perform other actions. Am I doing it wrong?

For instance: if I turn on the bedroom light, turn on the fan ... if I turn off the bedroom light, turn off the fan.

error

sinowine commented 4 years ago

Do you filled the switch-node with logic?

edmarts commented 4 years ago

I filled with two options: == true == false

I don't have home assistant, only homebridge.

sinowine commented 4 years ago

I use homebridge only too. Can you show how you configured the switch-node?

edmarts commented 4 years ago

switch

sinowine commented 4 years ago

You have to use "msg.payload.On" instead of "msg.payload" only ;)

And a tipp from me, I use always two switch-nodes to name it like "on" and "off" for example. One for the true-state and one for the false-state.

edmarts commented 4 years ago

I already tried use msg.payload.On but still does not send the command. erro erro1 erro2

sinowine commented 4 years ago

Please try it after you named the switch. I think this could be the problem.

edmarts commented 4 years ago

Nothing :'(

sinowine commented 4 years ago

Hmm. Deployed after changing?

edmarts commented 4 years ago

Yep!

NorthernMan54 commented 4 years ago

Try adding a debug node to listen to the messages coming from the light, and show them on the debug panel. It is likely a minor issue.

Also that node only emits messages when the device is controlled, so you would need to turn it on or off to trigger a message.

edmarts commented 4 years ago

Try adding a debug node to listen to the messages coming from the light, and show them on the debug panel. It is likely a minor issue.

I've done this. When you add the debug directly to the light it's ok. When the switch is add to the light, nothing happens. erro

Also that node only emits messages when the device is controlled, so you would need to turn it on or off to trigger a message.

Yep! See the image

edmarts commented 4 years ago

I found the "error"!!

I change the "==" signal on switch for "is true/is false" boolean (see the image) and works!

erro

NorthernMan54 commented 4 years ago

Awesome