Hi all, Ive just installed HA and am brand new to it so still getting my head around things. Ive had a long term set up on nodered but wanted to try HA so Im gradually porting things over. Im starting to get the MQTT based items (read only at this point) into HA but Im confused about the configuration.
I used IOTstack to set everything up so its running inside a container and on the current pi OS version.
Im using the method of publishing the config to HA via MQTT and this is working. But after this, Im confused about where the configuration actually lives inside the file system. But this isnt the main issue.
I have a few sensors reading fine but some others not so much. I have two examples, and analogue sensor and a binary status. there are multiple and all not working.
This is the MQTT message im trying to pick up (its a custom device I programmed a long time ago)
This is the content of the ‘home/PIV/state’ object, so dont be confused about the state object inside here as well!
{
"state": {
"enable": true,
"speed": false
},
"freshAirSensor": {
"temp": 9.111444,
"pres": 1022.437,
"hum": 83.67773
},
"supplyAirSensor": {
"temp": 9.3053,
"pres": 1024.119,
"hum": 61.59961
},
"shower": {
"demand": false
},
"wifi": {
"rssi": -63
}
}
Analogue sensor first.
I sent this as the config
{
"device_class": "temperature",
"name": "PIV Fresh Air Temperature",
"state_topic": "home/PIV/state/freshAirSensor",
"unit_of_measurement": "°C",
"value_template": "{{ value.temp }}",
"unique_id": "PIVFreshAirTemperature"
}
and the binary sensor
{
"name": "PIV Fan Enable",
"state_topic": "home/PIV/state/state/enable",
"payload_on": "true",
"payload_off": "false",
"device_class": "moving",
"unique_id": "PIVFanEnable"
}
All items that I sent a config for have appeared in the entity list inside the MQTT integration.
Im not sure why the analogue sensor isnt reading, because I followed the same setup config as a previous sensor, although from a different MQTT message. And the binary sensor, I know the /enable, should be .enable in the JSON format but Ive tried a few ways that I couldnt get my head around. But Im aware this is wrong, I dont know what to try next. For the analogue sensor I tried value_json.temp first but this didnt work so tried value.temp instead. I dont know if there is an equivalent for the binary sensor. I feel thats what I need.
Thanks!!
also cant work out how to format the code blocks!