Achieving System Redundancy with IHC and Home Assistant Using Node-RED

I recently embarked on a project to enhance the reliability of my smart home setup by integrating redundancy between my IHC controller and Home Assistant (HA). The goal was to ensure that even if HA were to experience a breakdown, my lighting system would still function correctly. I’d like to share my journey, challenges, and the solution I implemented, which might be helpful for others looking to achieve similar results.

The Setup

My system primarily uses an IHC controller with push buttons and output modules for controlling lamps. Each lamp is equipped with a Zigbee/Hue bulb, managed through HA. However, I wanted a failsafe mechanism in case HA became unavailable. Initially, I had a program on the IHC that toggled the lamp output if a button was held for 10 seconds. But I wanted this failover to activate much quicker—within 1 second—during a HA outage.

The Challenge

I needed a way to monitor HA’s status and adjust the failover mechanism accordingly. IHC doesn’t natively support direct communication with HA, so I decided to use Node-RED as an intermediary to create a heartbeat signal.

The Solution

I created a program on the IHC that listens for switch changes and resets a 2-minute timer, which I refer to as the Heartbeat Signal. Here’s how it works:

  1. Heartbeat Signal: HA toggles this signal every minute, keeping a 2-minute timer running on the IHC. If HA stops sending this signal, the timer eventually expires, triggering the failover mechanism.
  2. Failover Mechanism: If the timer expires (indicating HA is down), pressing the button for just 1 second toggles the lamp output. If HA is operational, a 10-second press is required to toggle the output, preventing accidental activations.
  3. Error Notification: When the timer expires, an error signal is activated, which I plan to connect to a telephone alert system for notifications.

Implementation Steps

  1. IHC Configuration: I added virtual switches and used datalines to create transferable variables. This involved editing the IHC configuration file to assign the correct IDs for these virtual switches.
  2. Node-RED Flow: I set up a Node-RED flow that sends a heartbeat signal to the IHC every minute. This ensures the timer stays active when HA is functioning.
  3. HA Integration: I integrated the virtual switches into HA using the ihc integration, ensuring they are recognized and can be toggled by Node-RED.

Testing and Results

After setting up the system, I tested it by simulating a HA outage. The failover mechanism worked flawlessly, toggling the lamp output within 1 second of the button press. I also tested the normal operation with HA active, and the 10-second delay prevented accidental activations.

Conclusion

This project not only enhanced the reliability of my smart home system but also deepened my understanding of integrating different platforms like IHC, HA, and Node-RED. It’s a testament to the flexibility and power of open-source ecosystems. If anyone has questions or suggestions, feel free to reach out—I’d be happy to help!

Happy tinkering! :wink: