Skip to content

Conversation

@Ubiquitine
Copy link

I noticed that with the suggested topic in rule2, Home assistant doesn't detect the device/sensor.
After some digging with MQTT explorer I discovered that MQTT integration requires a particular structure of the topic tree under /homeassistant . Sensors configuration should be nested under their type parent-topics, e.g. /homeassistant/sensor/<Sensor ID>, or in that case /homeassistant/binary_sensor/<Sensor ID> .
Also, not included in the PR is additional parameter for the device:

rule2 on system#boot do publish2 homeassistant/binary_sensor/%topic%/config { "name": "Motion Sensor", "state_topic": "stat/%topic%/MOTION", "payload_on": 1, "availability_topic": "tele/%topic%/LWT", "payload_available": "Online", "payload_not_available": "Offline", "device_class": "motion", "force_update": true, "off_delay": 30, "unique_id": "%deviceid%_motion", "device": { "identifiers": [ "%deviceid%" ], "name": "WeMos D1 Mini" // Just an example, could be "%deviceid%" } } endon 

Without the name added to the device parameters, HA shows the sensor as Connected via Unnamed device
image

@Ubiquitine Ubiquitine changed the title Fix MQTT topic to publish config for Home Assistant [DOC: PIR Motion Sensors] Fix MQTT topic to publish config for Home Assistant Oct 27, 2025
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

1 participant