Point me to the right channel, if wrong here.
Having the following mqtt sensor defined
- name: "heating.room.sensor.module"
state_topic: "HAS/Neubarnim/heatingroom/heating/tele/SENSOR"
value_template: "{{ value_json }}"
json_attributes_topic: "HAS/Neubarnim/heatingroom/heating/tele/SENSOR"
json_attributes_template: >
{
"temperature": {{ value_json.BME280.Temperature }},
"humidity": {{ value_json.BME280.Humidity }},
"pressure": {{ value_json.BME280.Pressure }},
"timestamp": {{ (value_json.Time|as_timestamp) | int }},
"timestampFormatted": "{{ (value_json.Time|as_timestamp) | int | timestamp_custom('%d.%m, %H:%M') }}"
}
In the state itself I get "unknown" instead of the expected json-string. The attributes are correct.
This is the json itself:
{
"Time": "2025-01-01T12:54:08",
"BME280": {
"Temperature": 22.3,
"Humidity": 24.3,
"DewPoint": 0.8,
"Pressure": 1010.4
},
"BH1750": {
"Illuminance": 0
},
"PCF8574-1": {
"D0": 1,
"D1": 1,
"D2": 1,
"D3": 1,
"D4": 1,
"D5": 0,
"D6": 1,
"D7": 0
},
"PressureUnit": "hPa",
"TempUnit": "C"
}
With 15 other sensors defined the same way (copy/paste) it works, there I get the json string in the state. Only this doesn not work
Added:
If I write "value" instead of "value_json",I get the string. But I cannot figure out, what is wrong with my json value. One idea is, that the dash in "PCF8574-1" is the problem. Other sensors do not have such entries.
-> System -> Logs