@tom_l Pretty sure.
If I publish manually from my laptop using the MQTT CLI tool:
$ mqtt pub --topic home/cabinet --message '{"temperature": 42.42}' --host homeassistant.local --verbose
Client '[email protected]' sending CONNECT MqttConnect{keepAlive=60, cleanStart=true, sessionExpiryInterval=0}
Client '[email protected]' received CONNACK MqttConnAck{reasonCode=SUCCESS, sessionPresent=false, assignedClientIdentifier=auto-03AEAB20-D744-BE30-8C15-F0C596FBA2AC, restrictions=MqttConnAckRestrictions{receiveMaximum=65535, maximumPacketSize=268435460, topicAliasMaximum=10, maximumQos=EXACTLY_ONCE, retainAvailable=true, wildcardSubscriptionAvailable=true, sharedSubscriptionAvailable=true, subscriptionIdentifiersAvailable=true}}
Client '[email protected]' sending PUBLISH ('{"temperature": 42.42}') MqttPublish{topic=home/cabinet, payload=22byte, qos=AT_MOST_ONCE, retain=false}
Client '[email protected]' received PUBLISH acknowledgement MqttPublishResult{publish=MqttPublish{topic=home/cabinet, payload=22byte, qos=AT_MOST_ONCE, retain=false}}
Weirdly, though, MQTT Explorer is drawing a blank:
I’ve also tried giving up on JSON altogether, and just posting raw numerical values. With this sensor configuration:
- platform: mqtt
name: "Cabinet Temperature"
state_topic: "home/cabinet/temperature"
unit_of_measurement: '°C'
… and posting raw numbers:
$ mqtt pub --topic home/cabinet/temperature --message 42.42 --host homeassistant.local --verbose
Client '[email protected]' sending CONNECT MqttConnect{keepAlive=60, cleanStart=true, sessionExpiryInterval=0}
Client '[email protected]' received CONNACK MqttConnAck{reasonCode=SUCCESS, sessionPresent=false, assignedClientIdentifier=auto-043109D1-E75D-AA7C-748C-9F0BE28CAE78, restrictions=MqttConnAckRestrictions{receiveMaximum=65535, maximumPacketSize=268435460, topicAliasMaximum=10, maximumQos=EXACTLY_ONCE, retainAvailable=true, wildcardSubscriptionAvailable=true, sharedSubscriptionAvailable=true, subscriptionIdentifiersAvailable=true}}
Client '[email protected]' sending PUBLISH ('42.42') MqttPublish{topic=home/cabinet/temperature, payload=5byte, qos=AT_MOST_ONCE, retain=false}
Client '[email protected]' received PUBLISH acknowledgement MqttPublishResult{publish=MqttPublish{topic=home/cabinet/temperature, payload=5byte, qos=AT_MOST_ONCE, retain=false}}
… I get the same problem. Nothing in MQTT Explorer, and nothing in my sensor trace.