Hey folks,
I am trying to convert a webhook into a binary sensor and struggling a bit. I have done some searching and tried to adapt other examples I have seen but failing with it.
Here is the template I have built:
- trigger:
- platform: webhook
webhook_id: long_uuid
binary_sensor:
- name: "webhook_status"
state: "{{ state_attr('states.trigger.json.status', 'status') == 'up' }}"
device_class: opening
The webhook sends a payload of {“status”: “$STATUS”} which is either up or down
I want to convert up to True or On and down to False or OFF
Any ideas where I am going wrong?
Cheers
J