Jokerigno
(Jokerigno)
1
Hi all,
I’ve just setup an automations that checks the status of my doors (front door, kitchen etc) and, if it’s open it will notify me through Pushbullet.
Question is: how can I change the state from on/off (it’s a xiaomi binary sensor) to something more clear like (open /closed)?
Thank you in advance
You can do this by creating a template sensor and using it to convert the output of another sensor.
I do this with my garage door.
- platform: template
sensors:
garage_door:
value_template: >-
{% if states.binary_sensor.garage_door.state == 'off' %}
Open
{% elif states.binary_sensor.garage_door.state == 'on' %}
Closed
{% else %}
n/a
{% endif %}
silvrr
3
Take a look at changing the device class of your binary sensor.
Note that if you have triggers based on on/off in your automation they may need to be updated to open/close