Help With value_template

@KDM @123

That’s a typo on my part. I forgot to replace d w/ the trigger.payload_json

- platform: mqtt
  name: "01159038DEFF Temperature"
  state_topic: "th10_02/tele/SENSOR"
  unit_of_measurement: "°C"
  value_template: >
    {% set serial_number = '01159038DEFF' %}
    {{ ((trigger.payload_json.values() | list)[1:-1] | selectattr('Id', 'eq', serial_number) | list)[0].Temperature }}
  payload_available: "Online"
  payload_not_available: "Offline"

So anyways, you shouldn’t need to map anything with this. Just change the serial number and you’ll get the serial numbers temperature.

1 Like