Home Assistant is running on Raspberry Pi #1. I have Raspberry Pi #2 running Node-red and a local MQTT broker. They talk over WiFi. I am writing MQTT autodiscover config topics on that RPi#2’s broker and I have my Home Assistant’s MQTT integration configured to connect to that broker. A dozen MQTT integrations for this device are being pulled in as entities belonging to a single Home Assistant device and most are working just fine.
The issue is two MQTT Number entities… while they get discovered as entities, they show as unavailable. They have no initial value. I am trying to use these two entities to allow for two setpoints to be adjusted from the Lovelace interface.
Here’s the config payload I’m setting:
{
"name": "Disinfect Duration (min)",
"command_topic": "homeassistant/number/decon-fridge/number_disinfect_duration/set",
"unique_id": "decon-fridge.number.disinfect_duration.001",
"device": {
"name": "decon-fridge",
"identifiers": [
"decon_fridge_001"
],
"manufacturer": "Manufacturer",
"model": "2021",
"sw_version": "0.01"
}
}
When I view MQTT info with the above config, the only topic subscribed to for this entity is “config”…it seems the “command” topic is unrecognized.
If I create a “state” topic and write to it with MQTT Explorer I can get a value to populate in Lovelace and then I can change the setpoint from Home Assistant (changes from Home Assistant come through on the “command” topic which Home Assistant was, previously, not subscribing to). But I receive an error when trying to view the device’s MQTT info:
2021-05-03 10:19:06 ERROR (MainThread) [homeassistant.components.websocket_api.messages] Unable to serialize to JSON. Bad data found at $.result.entities[3].subscriptions[1].messages[0].payload=b'30'(<class 'bytes'>, $.result.entities[6].subscriptions[0].messages[0].payload=b'30'(<class 'bytes'>, $.result.entities[6].subscriptions[0].messages[1].payload=b''(<class 'bytes'>, $.result.entities[6].subscriptions[0].messages[2].payload=b'30'(<class 'bytes'>, $.result.entities[6].subscriptions[0].messages[3].payload=b'30'(<class 'bytes'>, $.result.entities[6].subscriptions[0].messages[4].payload=b'30'(<class 'bytes'>, $.result.entities[6].subscriptions[0].messages[5].payload=b'30'(<class 'bytes'>, $.result.entities[6].subscriptions[0].messages[6].payload=b'30'(<class 'bytes'>, $.result.entities[6].subscriptions[0].messages[7].payload=b'30'(<class 'bytes'>, $.result.entities[6].subscriptions[0].messages[8].payload=b'30'(<class 'bytes'>
Things are working currently (albeit with the MQTT info error which prevents access to the MQTT info page) but it just doesn’t seem like this is how it should work.