Hi Community –
I copied and pasted a binary sensor snippet, which works without any issues, from another Home Assistant instance. I modified the topic to the correct one, I restarted the new instance, but the sensor is not listed anywhere. Is it possible to help me please?
mqtt:
binary_sensor:
- name: "Apt 2 Front Door Sensor"
unique_id: "apt_2_front_door_sensor"
state_topic: "stat/esprfidapt2/io/door"
device_class: Door
Hey –thanks for your response. I had a similar setup before, but couldn’t find the unique_id on the ‘States’ page. I added your suggestions, restarted Home Assistant, but still… Is there a possibility that something else is wrongly configured? Many thanks!
What is the json for your sensor? The example and template were just for one of my sensors. Show the payload from mqttexplorer for your sensor
{"model":"Smoke-GS558","id":723,"unit":6,"learn":0,"code":"705a66","protocol":"Wireless Smoke and Heat Detector GS 558","rssi":-66,"duration":1160995}
ZXZXZZXX001X
ZXZXZZXX00XX
The above example that starts with model that has the curly brackets will need a value_template to find code: 705a66 when door opens but lower example only needs a state_topic wth the payload being ZXZXZZXX001X for on and ZXZXZZXX00XX for off.
The MQTT Broker is through the Home Assistant add-on –not sure if this helps. The device is indeed connected to the same broker. See screenshot below for the output. Thanks again for your help!
Get rid of the value_template line: that was for Spiro’s example which had JSON in the topic. If yours is just ON or OFF as text you don’t need a value_template line.
Always understand each line rather than just copy-pasting.
Thanks for the advice @Troon –I removed the value_template line and changed door to lowercase. I restarted Home Assistant, but I still cannot find the new entities under Developer Tools > Entities. Any other thoughts on troubleshooting this?
Get MQTTExplorer on your computer. It will make mqtt bug hunting much easier.
Also each time you change something in mqtt you don’t have to restart. Go into developer tools and select manually configured mqtt enteries and it will just reload that section in few seconds.
Thanks for the insight – on my new instance, I’m not able to find the ‘Manually Configured MQTT Entries’ which is rather strange! No visible issues in the logs either. Here’s my entire configuration.yaml.