Hello,
I’m quite new to Home Assistant and to LOGO! Siemens, and I’m trying to figure out how to control a light with both of them.
LOGO! side setup
- Several push buttons in the house are connected in parallel to one LOGO! input (I1)
- The light is connected to a LOGO! output (Q1)
- The LOGO! program is as follow:
- The LOGO! is publishing on Logo_Pub topic on MQTT and subscribed to Logo_Sub
- Q1 is published on changes and M1 is set to writable
This means that I can still control the light with the physical push buttons even if HA is down.
What I'm trying to achieve
I’m trying to add a light entity in HA with these properties:
- The on/off state of the light entity is updated according to the actual on/off state of the physical light, by listening on changes of the Q1 value on the Logo_Pub topic.
- Toggling the light should push a message on the Logo_Sub topic with a message telling the LOGO! to change the state of M1.
So far, I can achieve point 2 with this mqtt light:
mqtt:
- light:
command_topic: "Logo_Sub"
payload_on: '{"state": {"M1": {"value": [1]}}}'
payload_off: '{"state": {"M1": {"value": [0]}}}'
state_topic: "Logo_Pub"
state_value_template: "{{ value_json['state']['reported']['Q1']['value'][0]}}"
unique_id: "my_unique_id"
With that, when I click the “on” or “off” part of the light, the payload_on/off is correctly send to MQTT, the LOGO! reads it and the physical light turns on/off.
The problem is the feedback. The light is always on the “unknown” state and I can’t figure out why it does not read the values published by the LOGO!.
However, this sensor is working, receiving value 1 or 0 depending on the state of Q1:
mqtt:
sensor:
- name: "LOGO Q1"
state_topic: "Logo_Pub"
value_template: "{{ value_json['state']['reported']['Q1']['value'][0]}}"
Any help would be greatly appreciated ![]()





