I created a Windows program that tracks the total time someone is using the computer. I’m sending the sensor information to Home assistant via MQTT. Discovery is working and the device and sensor show up, but the sensor information is not being captured and it’s showing as Unknown.
What am I missing to show the sensor information ?
I’ve been reading MQTT Sensor - Home Assistant (home-assistant.io) and MQTT Discovery - Home Assistant (home-assistant.io) and many community posts, but I’m failing to understand what is wrong. Any help is appreciated. Thanks in advance!
Discovery part for one of the sensors:
topic: homeassistant/sensor/V-TIAGOAND-LP3_REDMOND_tiagoand_Time/config
{
"~": "wellbeing/V-TIAGOAND-LP3/REDMOND_tiagoand/",
"object_id": "V-TIAGOAND-LP3_REDMOND_tiagoand_Total",
"name": "V-TIAGOAND-LP3/REDMOND_tiagoand Total Time in minutes",
"avty_t": "~STATE",
"pl_avail": "ON",
"pl_not_avail": "OFF",
"stat_t": "~SENSOR",
"value_template": "{{ value_json.time }}",
"unique_id": "V-TIAGOAND-LP3_REDMOND_tiagoand_Total",
"dev_cla": "duration",
"dev": {
"identifiers": "V-TIAGOAND-LP3_REDMOND_tiagoand",
"manufacturer": "Wellbeing",
"name": "V-TIAGOAND-LP3_REDMOND_tiagoand",
"model": "Windows"
}
}
State is set to ON
topic: wellbeing/V-TIAGOAND-LP3/REDMOND_tiagoand/STATE
ON
Payload of sensor data
topic: wellbeing/V-TIAGOAND-LP3/REDMOND_tiagoand/SENSOR
{"idle":False, "time":108}
Discovery is working fine as the device and sensors shows up:
Home Assistant is seeing the information per the MQTT debug info:
MQTT Info for this sensor:
With more details
What I see in MQTT Explorer: