Dear all,
need some help on decoding a stacked payload.
The payload lokks like this:
“object”: {
“temperatureSensor”: {
“1”: 4.16,
i was able to decode like this:
“object”: {
“temperatureSensor”: 4.16,
with yaml:
platform: mqtt
state_topic: “xxx”
name: “yyyy”
unit_of_measurement: “°C”
value_template: “{{ value_json.object.temperatureSensor}}”
but the stacked version makes some problems
tried:
a) value_template: “{{ value_json.object.1}}”
b) value_template: “{{ value_json.object.[1]}}”
a) value_template: “{{ value_json.object.(1)}}”
nothing works
Please format your json and yaml properly. See point 11 here. It also looks like both of your json examples are incomplete. It is generally a good idea to provide a minimal working example (or even the whole thing), not just the first few lines.