Question: Synchronize or mirror state of 2 devices

Thanks for the feedback. I have put together an example of what I was trying to do.

I have a Credenza with a built in light that I control by turning on or off an IKEA outlet. The Outlet is controlled by a Hubitat hub. That Hub is linked to Node Red. I also have a virtual outlet controlled by a separate Hubitat hub. This virtual item is also linked to Amazon Alexa using Hubitat's Alexa skill.

I am looking to have a lot of flexibility in controlling my smart devices. Here are all the ways this outlet will be controllable once I am done:

  1. Node Red Dashboard
  2. Node Red connected UIBuilder based Dashboard
  3. Hubitat UI from actual device hub
  4. Hubitat UI from virtual device hub
  5. Alexa Voice
  6. Alexa App (pc + phone)
  7. Google Home Voice
  8. Google Home App (phone)
  9. Google Nest Hub Max
  10. Home Assistant UI
  11. Apple Homekit via Node Red to Home Assistant to Homekit

Key to making this work is to update the status of the outlet on all UIs regardless of which one it was last changed on. So based on this I have now put together the following flow:

This is already working and synchronizing for the following:

  • Node Red Dashboard
  • Hubitat UI from actual device hub
  • Hubitat UI from virtual device hub
  • Alexa Voice
  • Alexa App (pc + phone)
  • Google Home Voice
  • Google Home App (phone)
  • Google Nest Hub Max

All of the function nodes could be replaced with standard nodes, but I just find it easier to think in code. I am using the following non-built in pallets:

  • node-red-contrib-noop
  • node-red-contrib-hubitat
  • node-red-contrib-smartnora
  • node-red-dashboard

All in all I find it amazing that Node Red can with a fairly small flow knit together and synchronize them. Of course it helps that Hubitat talks to Alexa and Home Assistant talks to Homekit, but still amazing.

The key reason for jumping through all of these hoops up front is to allow me to easily swap out an Ikea outlet controlled by Hubitat for a random zigbee outlet controlled by Zigbee2MQTT if the IKEA outlet ever dies. Under a circumstance like that all I would have to change is the control shown on the bottom row of the flow.

2 Likes