codmpm / node-red-contrib-loxone

Connect the Loxone Miniserver to node-red via the Websocket API
MIT License
73 stars 24 forks source link

Reconnecting loxone / nodered cause automatic payload message #59

Closed gisbern007 closed 3 years ago

gisbern007 commented 3 years ago

Loxone firmware 11.1.9.14 Nodered 1.2.2 Loxone contrib 11.1.9.14

Do have two loxone "control in" (buttons in lox config) which controlling two zigbee2mqtt components "out" for danalock (lock / unlock)

When restarting loxone miniserver, or restart Nodered (restart flows), both loxone "control in's* generate payloads (firstly for "unlock", one sec after "lock". It means each lost/renew comunication between loxone and nodered automatically activate all loxone "control in" - in my case, restart open door :)

log after restart: dan dan2

Thank you

codmpm commented 3 years ago

Hey @gisbern007,

that's by design as the Loxone websocket sends the state of every attached control on (re-)connect. You can test this by comparing full-deploy and deploying only changed nodes.

The connect fires every event... that's the idea of event based flow driven programming ;-) Same as connecting to an mqtt broker and getting every retained topic you've subscribed to.

Solve this using node-red's rbe-node, which only passes data if the payload has changed.

Cheers, Patrik

gisbern007 commented 3 years ago

Hi, thank you for reply !! Understand it. To say a truth , realy dont know how to set rbe item, i tried change 0 , 1 various combinations but rbe didnt passthrough aby payloads ;-) but i used switch node 0- null -1 - go to lock.

You really helped me understand restart behaviors. Thank again for great programming work Cheers G.