Hello,
I am trying to get a mqtt json message from gdoor into a mqtt binary_sensor but I am failing with the manual yaml-config...
binary_sensor:
- name: "door bell"
state_topic: gdoor/bux_rx
json_attributes_topic: "gdoor/bux_rx"
payload_on: "on"
payload_off: "off"
value_template: >
{% if value_json.busdata="XXXXXXXXXX" and
value_json.action="BUTTON_RING" and
value_json.parameters="XXXX" %}
"on"
{% endif %}
# availability_topic: "homeassistant/sensor/gdoor/data/config/84_1F_E8_1B_C3_58"
availability:
- topic: "homeassistant/sensor/gdoor/data/config/84_1F_E8_1B_C3_58"
payload_available: "online"
payload_not_available: "offline"
off_delay: 115
When trying to reload, I am always getting
Validation error: Invalid config for 'binary_sensor' at configuration.yaml, line 89: invalid template (TemplateSyntaxError: expected token 'end of statement block', got '=') for dictionary value 'value_template', got '{% if value_json.busdata="XXXXXXXXXX" and value_json.action="BUTTON_RING" and value_json.parameters="XXXX" %} "on" {% endif %}\n', please check the docs at https://www.home-assistant.io/integrations/mqtt
I have googled a lot, but I didn't get it...
The binary sensor "door bell" shall turn to "on" when the 3 json attributes from the received mqtt message match the given values. After 115s the sensor shall fall back to "off".
What am I doning wrong?