Controlling siemens PLC through HA with feedback

Hi guys,

I’m stuck on this:
I have a Siemens PLC to control all of the lights in my house. I have a S7 communication setup through NodeRed. This works great, I can exchange booleans, words, etc… between HA and PLC.
The issue:
My house has all buttons, they toggle an input on the PLC, the PLC detects a positive edge of the signal and sets the correct output. On the next positive edge (another press) the output will be reset.

In HA I want to control the lights also through the UI and later in the future maybe with voice control.
In the UI I wanna see rather if the light is on or of, this needs to be a feedback of the PLC through NodeRed.
So, I want some kind of button on the dashboard, when I press it, it will send a short signal (let’s say 250ms) “True” to the PLC, The PLC does his job, detects a positive edge and switched the light. The status of the light needs to be send back to the button on the dashboard, and the color of that icon needs to change so I can see if the light is on.
Another press on the UI needs to send another “True” signal from 250ms to PLC, and the UI icon must change color again.

Screenshot of PLC:

Pls help me with a working example in Node Red, it’s all new for me.


Can anyone help me out with this?

Hello Tom,

i have the same setup like you and im also struggling with the Implementation of Node Red. Have you found a Solution on this? I found also another old topic where i also wanted to ask about the approach in node red.

if you are now much more close to a solution pls let me know.

I have this setup implemented in TIA V16 with control from light switches (KNX based)/Siemens HMI/Amazon Alexa and Home assistant dashboard. From the siemens HMI I can reconfigure the KNX switches to operate different lights without re-programming. Send me a message if you are still stuck. Only joined the community so apologies if resurrecting an old thread that is solved.