Introduction
I’m thrilled to share my journey of integrating Siemens LOGO! PLCs with Home Assistant (HA) to create a seamless and robust home automation system. This project is part of a larger refurbishment of an old house, where I’m completely redoing the electrical installation. The goal is to create an automation system that is reliable, user-friendly, and works even when HA is offline. I’ve already been using ESPHome devices in my current setup, but I wanted something more scalable and resilient for the new house.
The Basic Setup
The core of this system revolves around Siemens LOGO! PLCs. I’ve installed a PLC on the main distribution board and on several secondary distribution boards. All light points are wired directly to these boards, connecting to the PLC relays. Push buttons are used for manual control, with low-voltage wiring connecting them to the PLC digital inputs. This setup ensures that the system remains functional even if HA goes offline, providing a fail-safe mechanism.
Getting Connected
Connecting the LOGO! PLCs to HA was a learning curve, but I managed to set it up using the Modbus integration instead of MQTT. I started with an older version of the LOGO! Soft Comfort software, which I upgraded to version 8.4 to support the new networked PLCs. I also purchased a LOGO!12/24RCE module to facilitate the connection.
One of the challenges was setting up the IP address, subnet mask, and gateway for the PLCs. I found a helpful video that guided me through the process, making it much easier. Another hurdle was configuring the data table in the LOGO! block diagram and the corresponding HA YAML code. I discovered that I had to manually add the network interfaces in the first column of the data table, which wasn’t immediately obvious.
LOGO! and HA Collaboration
Each PLC output (light) is configured as a pulse relay, which can be toggled via PLC inputs (buttons) or controlled remotely through HA. To achieve this, I created network inputs in HA to toggle, set, or reset the relays. However, I encountered an issue where HA didn’t have a built-in function to generate pulses. To work around this, I developed a script that generates pulses for each switch. This script ensures that the PLC receives the necessary input to toggle the lights.
Challenges and Solutions
One of the challenges was figuring out how to generate pulses in HA. After some research and experimentation, I created a series of scripts that simulate the pulse effect by rapidly turning the switch on and off. This workaround has been reliable and ensures that the PLC receives the correct signals.
Future Plans
Looking ahead, I plan to expand this system to include more devices, such as HVAC controls, water systems, and security alarms. The use of PLCs provides a scalable and robust foundation for these additions. I’m also exploring the possibility of integrating solar panels and electric vehicle charging stations into the system.
Conclusion
This project has been a rewarding experience, combining the reliability of Siemens LOGO! PLCs with the flexibility of Home Assistant. It’s been a steep learning curve, but the result is a system that is both user-friendly and resilient. I’m excited to continue developing this setup and share my progress with the community. If anyone has questions or suggestions, I’d be happy to discuss further!
Best regards,
[Your Name]