Hi,
Hopefully this has an easy solution as I want to apply the same method for other devices.
I have been trying to display the last time my home alarm was armed (and only that), but I’m not getting it to work as intended - as it’s also showing when it was last disarmed (overriding the armed state).
Here’s my sensors (perhaps I don’t need to do this in two steps…)
risco_armed:
value_template: >
{% set entity_id = 'alarm_control_panel.risco_larm_partition_0' %}
{% if is_state(entity_id, 'armed_away') %} Risco is armed
{% endif %}
risco_status:
friendly_name: "Alarm last armed:"
value_template: "{{ as_timestamp(states.sensor.risco_armed.last_changed)|timestamp_custom('%H:%M - %d/%m') }}"
And here’s how I want to display it in lovelace (other devices sorted in auto-entities):
- type: custom:auto-entities
card:
type: entities
filter:
include:
- entity_id: sensor.risco_status
- entity_id: sensor.altan_door
- entity_id: sensor.garden_motion
sort:
method: last_changed
Looking at my sensor.yaml and the code I have there, I do see and can understand why it’s not working (as the “last_changed” is more working as a toggle). And also in the auto-entities card, as it’s also “last_changed” there. But I don’t know how to fix it, so would appreciate some help
I have also trying to create an automation for when the alarm was set to armed_away and display that, but I’m not really getting it to work (plus is doesn’t work with my auto-entities display).
Thanks.