Hi All,
I have data coming in from an MQTT topic, the data looks like this:
{“time”’ : ‘"2017-08-16’ ‘22:41:51",’ ‘“model”’ : ‘"Honeywell’ Door/Window ‘Sensor",’ ‘“id”’ : 272026, ‘“channel”’ : 8, ‘“event”’ : 4, ‘“state”’ : ‘“closed”,’ ‘“heartbeat”’ : '“yes”}
Then I have a binary sensor setup:
name: “Window”
platform: mqtt
state_topic: “homeassistant/sensor/honeywell”
payload_on: “open”
payload_off: “closed”
qos: 0
device_class: opening
value_template: ‘{% if value_json.id is equalto 123456 %} {{value_json.state}} {% else %} {{states.binary_sensor.master_bathroom_window.state}} {% endif %}’
It is working well, however I would like to save the other parts of the data as attributes in the sensor, any ideas on how I would do that?
As always, thanks for reading and any help that one can provide
Chris