Hi,
I have defined several (MQTT) binary sensors.
Example:
binary_sensor:
- name: "Raam bureau zijkant open/dicht"
object_id: "tex_zone_z035_w10_1"
unique_id: "tex_zone_z035_w10_1"
state_topic: "texecom2mqtt/contacts/binary_sensor.tex_zone_z035_w10_1"
icon: mdi:shield-account
device_class: window
payload_on: "1"
payload_off: "0"
They are working fine. The ID of that sensor is “binary_sensor.tex_zone_z035_w10_1”. And the way my MQTT is set up, the MQTT topic will always match the entity ID.
Is it possible to replace the value of state_topic with the entity_id (preceeded with a fixed “texecom2mqtt/contacts”)? I think that set up is a lot cleaner.