Good morning,
I would like to change the title of the secondary state (sensor.home_maison_current_mode) depending on its state in this code
type: custom:mushroom-template-card
primary: Etat vidéo-surveillance
secondary: >
{{ states('sensor.home_maison_current_mode') }} - {% set last_changed =
states.alarm_control_panel.home_maison.last_changed %}
{% set now = now() %}
{% set delta = now - last_changed %}
{% set hours = delta.total_seconds() // 3600 %}
{% set minutes = (delta.total_seconds() % 3600) // 60 %}
Depuis:
{% if hours > 0 %}
{{ hours | int }}h
{% endif %}
{{ minutes | int }}m
entity: alarm_control_panel.home_maison
icon: >
{% if is_state('alarm_control_panel.home_maison', 'armed_home') %}
mdi:shield-off
{% elif is_state('alarm_control_panel.home_maison', 'Protection extérieure')
%}
mdi:shield-account
{% elif is_state('alarm_control_panel.home_maison', 'armed_away') %}
mdi:shield-car
{% endif %}
icon_color: >
{% if is_state('alarm_control_panel.home_maison', 'armed_home') %}
green
{% elif is_state('alarm_control_panel.home_maison', 'Protection extérieure')
%}
orange
{% elif is_state('alarm_control_panel.home_maison', 'armed_away') %}
red
{% endif %}
hold_action:
action: navigate
navigation_path: "#pop-up-home-guard"
Thank you in advance