MQTT Sensor Question

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 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 :slight_smile:


I think you will have to create some new ‘normal’ sensors with the same info just adjust the template then group them together in a group/tab view, since you can’t by definition have any of the rest in a binary sensor.