Discovery payload is:
{
"name": "Dryer monitor 01",
"uniq_id": "dryermonitor01",
"avty_t": "basetopic/dryermonitor01/$system/status",
"pl_avail": "online",
"pl_not_avail": "offline",
"stat_t": "basetopic/dryermonitor01/state",
"stat_on": "on",
"stat_off": "off",
"opt": false,
"ic": "mdi:tumble-dryer"
}
However, Home Assistant doesn’t recognize the “online” state:
Can somebody spot the error I made?
I tried setting it manually using MQTT Explorer, didn’t help. I need an extra pair of eyes here…
Found another error when trying to make the “availability” to work. This time I used the MQTT Binary Sensor - Home Assistant (home-assistant.io)-availability setting.
I use the abbreviations to set the properties of the sensor. While the top level properties are expanded, the properties in the availability
-list are not, resulting in a parsing error.
{
"name": "Dryer monitor 01",
"uniq_id": "dryermonitor01",
"avty": [
{
"t": "basetopic/dryermonitor01/$system/status",
"pl_avail": "online",
"pl_not_avail": "offline"
}
],
"avty_mode": "latest",
"stat_t": "basetopic/dryermonitor01/state",
"stat_on": "on",
"stat_off": "off",
"opt": false,
"ic": "mdi:tumble-dryer"
}
2022-10-05 11:39:52.246 ERROR (MainThread) [homeassistant.util.logging] Exception in async_discover when dispatching 'mqtt_discovery_new_binary_sensor_mqtt': ({'name': 'Dryer monitor 01', 'unique_id': 'dryermonitor01', 'availability': [{'t': 'basetopic/dryermonitor01/$system/status', 'pl_avail': 'online', 'pl_not_avail': 'offline'}], 'availability_mode': 'latest', 'state_topic': 'basetopic/dryermonitor01/state', 'state_on': 'on', 'state_off': 'off', 'optimistic': False, 'icon': 'mdi:tumble-dryer', 'platform': 'mqtt'},)
Of course, I might be using it wrongly. Sending the discovery with full names works, but still doesn’t solve the original issue.