TCP relay card controlled by two sources, how to keep in sync?

I have a TCP relay board which is controlled by a function. I want to be able to control each relay from two sources, namely a dashboard switch and also a Google Home (Nora) switch. What is the best way to ensure the display on the dashboard and in Google Home app both reflect the current state of the switch?

I worked out if I connect both switch outputs to the activating function and also feed each switch output back to the input of the other switch it works. The only down side is, when operating the switch from Google Home, the message gets sent twice to the relay board. Not a major problem but surely there is a better way?

(Just throwing it out there)

On each machine: when you send an ON or OFF command, it is also published on MQTT.

Then on each machine you subscribe to that topic and it imposes the state to an indicator.

OR

Use a TCP IN node and forget about MQTT.

(Sorry)

If you can post the basic part where you have an inject (2 actaully) node to turning the relay on/off and the TCP-OUT node.

Then I could show you what I mean with the second bit.

Use a filter node on output to Google and use output from switch to determine current state (not switch output as this does not necessarily represent device state)

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