I am attempting to get a number of door / window sensors setup in Home Assistant using an RF gateway built on a D1 Mini. I have the gateway working and receive the following payloads when the door is opened or closed:
closed: {"value":7821838,"protocol":1,"length":24,"delay":455}
open: {"value":7821834,"protocol":1,"length":24,"delay":455}
and I have the following binary sensor in HASS:
- platform: mqtt
name: "test"
state_topic: "home/OpenMQTTGateway/433toMQTT"
payload_on: "7821834"
payload_off: "7821838"
value_template: "{{ value }}"
qos: 0
device_class: opening
I have tried a number of templates to obtain the value but nothing seems to work. Any ideas? So far I have tried:
value_template: "{{ value.x }}"
value_template: "{{ trigger.payload_json[value] }}"
value_template: "{{ trigger.payload[value] }}"