Replies: 1 comment 1 reply
-
|
The simplest way is to keep the alert trigger separate and put the branching in Assuming your contact sensor is message: >
{% set door = states('binary_sensor.back_door') %}
{% set lock = states('lock.back_door') %}
{% if door == 'on' and lock == 'unlocked' %}
Back Door Open and Unlocked
{% elif door != 'on' and lock == 'unlocked' %}
Back Door is Unlocked
{% else %}
Back Door is Open
{% endif %}Swap in your actual entity ids / states, but the key point is: use the card's Jinja2-capable |
Beta Was this translation helpful? Give feedback.
1 reply
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment

Uh oh!
There was an error while loading. Please reload this page.
-
How do I write an IF condition to display the entity state?
I'm trying to display if the back door is open, then display - Back Door Open and Unlocked, but if the back door is closed and the door is unlocked, then display Back Door is Unlocked
For some reason, I can't get this to work - any help would be appreciated!
Beta Was this translation helpful? Give feedback.
All reactions