703 lines
25 KiB
YAML
703 lines
25 KiB
YAML
title: Home
|
|
button_card_templates:
|
|
sensor:
|
|
aspect_ratio: 1.2/1
|
|
show_state: true
|
|
show_icon: true
|
|
sensor_battery:
|
|
template: sensor
|
|
icon: |
|
|
[[[
|
|
if (entity.state < 5) return 'mdi:battery-alert-variant-outline';
|
|
if (entity.state >= 5 && entity.state <15) return 'mdi:battery-10';
|
|
if (entity.state >= 15 && entity.state < 25) return 'mdi:battery-20';
|
|
if (entity.state >= 25 && entity.state < 35) return 'mdi:battery-30';
|
|
if (entity.state >= 35 && entity.state < 45) return 'mdi:battery-40';
|
|
if (entity.state >= 45 && entity.state < 55) return 'mdi:battery-50';
|
|
if (entity.state >= 55 && entity.state < 65) return 'mdi:battery-60';
|
|
if (entity.state >= 65 && entity.state < 75) return 'mdi:battery-70';
|
|
if (entity.state >= 75 && entity.state < 85) return 'mdi:battery-80';
|
|
if (entity.state >= 85 && entity.state < 95) return 'mdi:battery-90';
|
|
if (entity.state >= 95) return 'mdi:battery';
|
|
else return 'mdi:battery-alert-variant-outline';
|
|
]]]
|
|
style:
|
|
- padding: 0px
|
|
styles:
|
|
icon:
|
|
- color: |
|
|
[[[
|
|
if (entity.state < 15) return 'red';
|
|
if (entity.state >= 15 && entity.state <25) return 'firebrick';
|
|
if (entity.state >= 25 && entity.state < 55) return 'orange';
|
|
if (entity.state >= 55) return 'green';
|
|
else return 'red';
|
|
]]]
|
|
views:
|
|
- title: Home
|
|
cards: []
|
|
type: sections
|
|
icon: mdi:home
|
|
badges:
|
|
- type: custom:mushroom-chips-card
|
|
alignment: justify
|
|
chips:
|
|
- type: template
|
|
entity: binary_sensor.alarm_triggered
|
|
icon: '{{ state_attr("binary_sensor.alarm_triggered", "icon") }}'
|
|
icon_color: |
|
|
{% if is_state('binary_sensor.alarm_triggered', 'on') %}
|
|
red
|
|
{% else %}
|
|
#4682B4
|
|
{% endif %}
|
|
content: Alarm
|
|
tap_action:
|
|
action: navigate
|
|
navigation_path: /dashboard-sthome/alarm
|
|
- type: template
|
|
entity: binary_sensor.motion_detected
|
|
icon: '{{ state_attr("binary_sensor.motion_detected", "icon") }}'
|
|
icon_color: >-
|
|
{% set lc = (as_timestamp(now()) -
|
|
as_timestamp(states.binary_sensor.motion_detected.last_changed))|int
|
|
%} {{ "#ff0000" if lc < 10 }} {{ "#4d061c" if lc >= 10 and lc < 20
|
|
}} {{ "#d2042d" if lc >= 20 and lc < 45 }} {{ "#fA8072" if lc >=
|
|
45 and lc < 90 }} {{ "#ff8c00" if lc >= 90 and lc < 180 }} {{
|
|
"#ffa500" if lc >= 180 and lc < 400 }} {{ "#fff700" if lc >= 400
|
|
and lc < 830 }} {{ "#ffff00" if lc >= 830 and lc < 1725 }} {{
|
|
"#008000" if lc >= 1725 and lc < 3600 }} {{ "#4682B4" if lc >=
|
|
3600 and lc < 21600 }}
|
|
content: >-
|
|
{{ states['binary_sensor.motion_detected'].state | title }} · {{
|
|
states['binary_sensor.motion_detected'].last_changed |
|
|
relative_time }}
|
|
tap_action:
|
|
action: navigate
|
|
navigation_path: /dashboard-sthome/alarm
|
|
card_mod:
|
|
style:
|
|
mushroom-template-chip:nth-child(2)$: |
|
|
ha-state-icon {
|
|
{{ 'animation: clip 2s linear infinite;' if is_state('binary_sensor.motion_detected', 'on') }}
|
|
}
|
|
@keyframes clip {
|
|
50% { clip-path: polygon(0 0, 61% 0, 66% 100%, 0% 100%); }
|
|
}
|
|
sections:
|
|
- type: grid
|
|
cards:
|
|
- type: custom:mushroom-chips-card
|
|
chips:
|
|
- type: entity
|
|
entity: sun.sun
|
|
- type: template
|
|
content: >-
|
|
Sunrise {% if states.sun.sun %} {{
|
|
(as_timestamp(states.sun.sun.attributes.next_rising)) |
|
|
timestamp_custom(('%H:%M') )}} {% endif %}
|
|
icon: mdi:weather-sunset-up
|
|
- type: template
|
|
content: >-
|
|
Sunset {% if states.sun.sun %} {{
|
|
(as_timestamp(states.sun.sun.attributes.next_setting)) |
|
|
timestamp_custom(('%H:%M') )}} {% endif %}
|
|
icon: mdi:weather-sunset-down
|
|
- type: entity
|
|
entity: sensor.moon_phase
|
|
- show_current: true
|
|
show_forecast: true
|
|
type: weather-forecast
|
|
entity: weather.forecast_home
|
|
secondary_info_attribute: humidity
|
|
forecast_type: daily
|
|
- type: custom:mushroom-person-card
|
|
entity: person.chris
|
|
name: Chris
|
|
- type: custom:mushroom-person-card
|
|
entity: device_tracker.nokia_c20
|
|
- type: grid
|
|
cards:
|
|
- type: heading
|
|
heading: Media players
|
|
heading_style: title
|
|
icon: mdi:television
|
|
- type: custom:mushroom-media-player-card
|
|
entity: media_player.smart_tv
|
|
name: Hisense
|
|
icon: mdi:television
|
|
collapsible_controls: true
|
|
use_media_info: true
|
|
volume_controls:
|
|
- volume_mute
|
|
- volume_set
|
|
- volume_buttons
|
|
media_controls:
|
|
- on_off
|
|
- shuffle
|
|
- previous
|
|
- play_pause_stop
|
|
- next
|
|
- repeat
|
|
show_volume_level: true
|
|
- type: custom:mushroom-media-player-card
|
|
entity: media_player.xiaomi_tv_box_2
|
|
name: Xiaomi
|
|
icon: mdi:television-box
|
|
collapsible_controls: true
|
|
use_media_info: true
|
|
volume_controls:
|
|
- volume_mute
|
|
- volume_set
|
|
- volume_buttons
|
|
media_controls:
|
|
- on_off
|
|
- shuffle
|
|
- previous
|
|
- play_pause_stop
|
|
- next
|
|
- repeat
|
|
show_volume_level: true
|
|
- type: custom:mushroom-media-player-card
|
|
entity: media_player.nova4k
|
|
name: Nova4k
|
|
icon: mdi:television-box
|
|
collapsible_controls: true
|
|
use_media_info: true
|
|
volume_controls:
|
|
- volume_mute
|
|
- volume_set
|
|
- volume_buttons
|
|
media_controls:
|
|
- on_off
|
|
- shuffle
|
|
- previous
|
|
- play_pause_stop
|
|
- next
|
|
- repeat
|
|
show_volume_level: true
|
|
- type: grid
|
|
cards:
|
|
- type: heading
|
|
heading: Phones
|
|
heading_style: title
|
|
- type: custom:mushroom-template-card
|
|
primary: S20 ultra
|
|
secondary: '{{ states[''sensor.sm_n986b_battery_level''].state }}%'
|
|
entity: sensor.sm_n986b_battery_level
|
|
icon_color: |-
|
|
{% set state=states['sensor.sm_n986b_battery_level'].state %}
|
|
{% if state|int < 15 %}
|
|
red
|
|
{% elif (state|int > 15 and state|int < 25) %}
|
|
#b22222
|
|
{% elif (state|int > 25 and state|int < 55) %}
|
|
orange
|
|
{% else %}
|
|
green
|
|
{% endif %}
|
|
icon: '{{ state_attr("sensor.sm_n986b_battery_level", "icon") }}'
|
|
- type: custom:mushroom-template-card
|
|
primary: Nokia C20
|
|
secondary: '{{ states[''sensor.nokia_c20_battery_level''].state }}%'
|
|
entity: sensor.nokia_c20_battery_level
|
|
icon_color: |-
|
|
{% set state=states['sensor.nokia_c20_battery_level'].state %}
|
|
{% if state|int < 15 %}
|
|
red
|
|
{% elif (state|int > 15 and state|int < 25) %}
|
|
#b22222
|
|
{% elif (state|int > 25 and state|int < 55) %}
|
|
orange
|
|
{% else %}
|
|
green
|
|
{% endif %}
|
|
icon: '{{ state_attr("sensor.nokia_c20_battery_level", "icon") }}'
|
|
- type: custom:mushroom-template-card
|
|
primary: A9 tablet
|
|
secondary: '{{ states[''sensor.sm_x115_battery_level''].state }}%'
|
|
entity: sensor.sm_x115_battery_level
|
|
icon_color: |-
|
|
{% set state=states['sensor.sm_x115_battery_level'].state %}
|
|
{% if state|int < 15 %}
|
|
red
|
|
{% elif (state|int > 15 and state|int < 25) %}
|
|
#b22222
|
|
{% elif (state|int > 25 and state|int < 55) %}
|
|
orange
|
|
{% else %}
|
|
green
|
|
{% endif %}
|
|
icon: '{{ state_attr("sensor.sm_x115_battery_level", "icon") }}'
|
|
- type: grid
|
|
cards:
|
|
- type: heading
|
|
heading: Counters
|
|
- type: custom:mushroom-entity-card
|
|
entity: counter.sm_n986b_notification_counter
|
|
name: S20
|
|
secondary_info: state
|
|
grid_options:
|
|
columns: 4
|
|
rows: 1
|
|
- type: custom:mushroom-entity-card
|
|
entity: counter.nokia_c20_notification_counter
|
|
name: Nokia C20
|
|
secondary_info: state
|
|
grid_options:
|
|
columns: 4
|
|
rows: 1
|
|
- type: custom:mushroom-entity-card
|
|
entity: counter.sm_x115_notification_counter
|
|
name: A9 tablet
|
|
secondary_info: state
|
|
grid_options:
|
|
columns: 4
|
|
rows: 1
|
|
- type: custom:mushroom-entity-card
|
|
entity: counter.driveway_person_alarm_counter
|
|
name: Driveway
|
|
secondary_info: state
|
|
grid_options:
|
|
columns: 4
|
|
rows: 1
|
|
- type: custom:mushroom-entity-card
|
|
entity: counter.east_wall_person_alarm_counter
|
|
name: Eastwall
|
|
secondary_info: state
|
|
grid_options:
|
|
columns: 4
|
|
rows: 1
|
|
- type: custom:mushroom-entity-card
|
|
entity: counter.backyard_person_alarm_counter
|
|
name: Backyard
|
|
secondary_info: state
|
|
grid_options:
|
|
columns: 4
|
|
rows: 1
|
|
- type: custom:mushroom-entity-card
|
|
entity: counter.patio_person_alarm_counter
|
|
name: Patio
|
|
secondary_info: state
|
|
grid_options:
|
|
columns: 4
|
|
rows: 1
|
|
- type: custom:mushroom-entity-card
|
|
entity: counter.west_wall_person_alarm_counter
|
|
name: Westwall
|
|
secondary_info: state
|
|
grid_options:
|
|
columns: 4
|
|
rows: 1
|
|
- type: grid
|
|
cards:
|
|
- type: heading
|
|
heading: Work in progress
|
|
heading_style: title
|
|
icon: mdi:spade
|
|
- type: custom:mushroom-entity-card
|
|
entity: switch.sthome_ut1_relay_2
|
|
name: Relay 2
|
|
secondary_info: state
|
|
grid_options:
|
|
columns: 4
|
|
rows: 1
|
|
- type: custom:mushroom-entity-card
|
|
entity: switch.sthome_ut1_relay_3
|
|
name: Relay 3
|
|
secondary_info: state
|
|
grid_options:
|
|
columns: 4
|
|
rows: 1
|
|
- type: custom:mushroom-entity-card
|
|
entity: binary_sensor.gate_lock
|
|
name: Gate lock
|
|
secondary_info: state
|
|
grid_options:
|
|
columns: 4
|
|
rows: 1
|
|
- type: custom:mushroom-entity-card
|
|
entity: switch.sthome_ut4_relay_6
|
|
name: Open/Close gate
|
|
secondary_info: state
|
|
grid_options:
|
|
columns: 4
|
|
rows: 1
|
|
header:
|
|
card:
|
|
type: markdown
|
|
text_only: true
|
|
content: |-
|
|
# Hello {{ user }}
|
|
sthome dashboard ✨
|
|
max_columns: 2
|
|
dense_section_placement: true
|
|
- title: Security Cameras
|
|
cards: []
|
|
icon: mdi:cctv
|
|
type: sections
|
|
sections:
|
|
- type: grid
|
|
cards:
|
|
- type: heading
|
|
heading: Cameras
|
|
heading_style: title
|
|
icon: mdi:cctv
|
|
- show_state: true
|
|
show_name: true
|
|
camera_view: auto
|
|
type: picture-entity
|
|
entity: camera.driveway
|
|
grid_options:
|
|
columns: 12
|
|
rows: auto
|
|
- show_state: true
|
|
show_name: true
|
|
camera_view: auto
|
|
type: picture-entity
|
|
entity: camera.patio
|
|
grid_options:
|
|
columns: 6
|
|
rows: auto
|
|
- show_state: true
|
|
show_name: true
|
|
camera_view: auto
|
|
type: picture-entity
|
|
entity: camera.eastwall
|
|
grid_options:
|
|
columns: 6
|
|
rows: auto
|
|
- show_state: true
|
|
show_name: true
|
|
camera_view: auto
|
|
type: picture-entity
|
|
entity: camera.westwall
|
|
grid_options:
|
|
columns: 6
|
|
rows: auto
|
|
- show_state: true
|
|
show_name: true
|
|
camera_view: auto
|
|
type: picture-entity
|
|
entity: camera.backyard
|
|
grid_options:
|
|
columns: 6
|
|
rows: auto
|
|
column_span: 1
|
|
- type: grid
|
|
cards:
|
|
- type: heading
|
|
heading: Detections
|
|
heading_style: title
|
|
- type: picture
|
|
image_entity: image.driveway_person
|
|
grid_options:
|
|
columns: 6
|
|
rows: auto
|
|
- type: picture
|
|
image_entity: image.driveway_car
|
|
grid_options:
|
|
columns: 6
|
|
rows: auto
|
|
- type: picture
|
|
image_entity: image.eastwall_person
|
|
grid_options:
|
|
columns: 6
|
|
rows: auto
|
|
- type: picture
|
|
image_entity: image.patio_person
|
|
grid_options:
|
|
columns: 6
|
|
rows: auto
|
|
- type: picture
|
|
image_entity: image.westwall_person
|
|
grid_options:
|
|
columns: 6
|
|
rows: auto
|
|
- type: picture
|
|
image_entity: image.backyard_person
|
|
grid_options:
|
|
columns: 6
|
|
rows: auto
|
|
header:
|
|
card:
|
|
type: markdown
|
|
text_only: true
|
|
content: Security Cameras
|
|
max_columns: 4
|
|
dense_section_placement: true
|
|
badges:
|
|
- type: entity
|
|
entity: counter.driveway_person_alarm_counter
|
|
- type: entity
|
|
entity: counter.east_wall_person_alarm_counter
|
|
- type: entity
|
|
entity: counter.patio_person_alarm_counter
|
|
- type: entity
|
|
entity: counter.west_wall_person_alarm_counter
|
|
- type: entity
|
|
entity: counter.backyard_person_alarm_counter
|
|
- type: sections
|
|
max_columns: 10
|
|
subview: true
|
|
path: alarm
|
|
title: Alarm
|
|
icon: mdi:alarm-light
|
|
sections:
|
|
- type: grid
|
|
cards:
|
|
- type: heading
|
|
heading: Settings
|
|
heading_style: title
|
|
- type: custom:mushroom-template-card
|
|
icon: '{{ state_attr("binary_sensor.motion_detect_enabled", "icon") }}'
|
|
primary: '{{ states["input_boolean.motion_detect"].name }}'
|
|
secondary: '{{ states["input_boolean.motion_detect"].state }}'
|
|
icon_color: |-
|
|
{% if is_state('input_boolean.motion_detect', 'on') %}
|
|
green
|
|
{% else %}
|
|
#4682B4
|
|
{% endif %}
|
|
badge_icon: ''
|
|
badge_color: ''
|
|
entity: input_boolean.motion_detect
|
|
- type: custom:mushroom-template-card
|
|
entity: input_boolean.notify_sm_n986b
|
|
secondary: '{{ states["input_boolean.notify_sm_n986b"].state }}'
|
|
icon: '{{ state_attr("input_boolean.notify_sm_n986b", "icon") }}'
|
|
primary: '{{ states[''input_boolean.notify_sm_n986b''].name }}'
|
|
icon_color: |-
|
|
{% if is_state('input_boolean.notify_sm_n986b', 'on') %}
|
|
green
|
|
{% else %}
|
|
#4682B4
|
|
{% endif %}
|
|
- type: custom:mushroom-template-card
|
|
entity: input_boolean.notify_nokia_c20
|
|
secondary: '{{ states[''input_boolean.notify_nokia_c20''].state }}'
|
|
icon: '{{ state_attr("input_boolean.notify_nokia_c20", "icon") }}'
|
|
primary: '{{ states[''input_boolean.notify_nokia_c20''].name }}'
|
|
icon_color: |-
|
|
{% if is_state('input_boolean.notify_nokia_c20', 'on') %}
|
|
green
|
|
{% else %}
|
|
#4682B4
|
|
{% endif %}
|
|
- type: custom:mushroom-template-card
|
|
entity: input_boolean.notify_sm_x115
|
|
secondary: '{{ states[''input_boolean.notify_sm_x115''].state }}'
|
|
icon: '{{ state_attr("input_boolean.notify_sm_x115", "icon") }}'
|
|
primary: '{{ states[''input_boolean.notify_sm_x115''].name }}'
|
|
icon_color: |-
|
|
{% if is_state('input_boolean.notify_sm_x115', 'on') %}
|
|
green
|
|
{% else %}
|
|
#4682B4
|
|
{% endif %}
|
|
column_span: 1
|
|
cards: []
|
|
badges:
|
|
- type: entity
|
|
show_name: true
|
|
show_state: true
|
|
show_icon: true
|
|
entity: binary_sensor.alarm_triggered
|
|
show_entity_picture: false
|
|
color: red
|
|
name: Siren
|
|
state_content:
|
|
- state
|
|
- last_changed
|
|
tap_action:
|
|
action: more-info
|
|
- type: entity
|
|
show_name: true
|
|
show_state: true
|
|
show_icon: true
|
|
entity: binary_sensor.zone_4_triggered
|
|
color: red
|
|
name: Zone 4
|
|
state_content:
|
|
- state
|
|
- last_changed
|
|
tap_action:
|
|
action: more-info
|
|
- type: entity
|
|
show_name: true
|
|
show_state: true
|
|
show_icon: true
|
|
entity: switch.sthome_ut1_floodlights_backyard
|
|
state_content:
|
|
- state
|
|
- last_changed
|
|
show_entity_picture: true
|
|
icon: mdi:light-flood-down
|
|
name: Backyard
|
|
double_tap_action:
|
|
action: toggle
|
|
tap_action:
|
|
action: more-info
|
|
- type: entity
|
|
show_name: true
|
|
show_state: true
|
|
show_icon: true
|
|
entity: binary_sensor.sthome_ut1_floodlights_test_mode
|
|
icon: mdi:light-flood-down
|
|
show_entity_picture: true
|
|
color: orange
|
|
name: Test mode
|
|
- type: custom:mushroom-template-badge
|
|
entity: binary_sensor.motion_detected
|
|
content: >
|
|
{{ states['binary_sensor.motion_detected'].state | title }} · {{
|
|
states['binary_sensor.motion_detected'].last_changed | relative_time
|
|
}}
|
|
icon: '{{ state_attr("binary_sensor.motion_detected", "icon") }}'
|
|
color: >-
|
|
{% set lc = (as_timestamp(now()) -
|
|
as_timestamp(states[entity].last_changed))|int %} {{ "#ff0000" if lc <
|
|
10 }} {{ "#4d061c" if lc >= 10 and lc < 20 }} {{ "#d2042d" if lc >= 20
|
|
and lc < 45 }} {{ "#fA8072" if lc >= 45 and lc < 90 }} {{ "#ff8c00" if
|
|
lc >= 90 and lc < 180 }} {{ "#ffa500" if lc >= 180 and lc < 400 }} {{
|
|
"#fff700" if lc >= 400 and lc < 830 }} {{ "#ffff00" if lc >= 830 and
|
|
lc < 1725 }} {{ "#008000" if lc >= 1725 and lc < 3600 }} {{ "#4682B4"
|
|
if lc >= 3600 and lc < 21600 }}
|
|
label: '{{ states[entity].name }}'
|
|
- type: custom:mushroom-template-badge
|
|
entity: binary_sensor.patio_motion_detect
|
|
content: >-
|
|
{{ states[entity].state | title }} · {{ states[entity].last_changed |
|
|
relative_time }}
|
|
icon: |-
|
|
{% set state = states(entity) %}
|
|
{% if state == 'on' %}
|
|
mdi:motion-sensor
|
|
{% elif state == 'off' %}
|
|
mdi:motion-sensor-off
|
|
{% else %}
|
|
mdi:motion-sensor-off
|
|
{% endif %}
|
|
color: >-
|
|
{% set lc = (as_timestamp(now()) -
|
|
as_timestamp(states[entity].last_changed))|int %} {{ "#ff0000" if lc <
|
|
10 }} {{ "#4d061c" if lc >= 10 and lc < 20 }} {{ "#d2042d" if lc >= 20
|
|
and lc < 45 }} {{ "#fA8072" if lc >= 45 and lc < 90 }} {{ "#ff8c00" if
|
|
lc >= 90 and lc < 180 }} {{ "#ffa500" if lc >= 180 and lc < 400 }} {{
|
|
"#fff700" if lc >= 400 and lc < 830 }} {{ "#ffff00" if lc >= 830 and
|
|
lc < 1725 }} {{ "#008000" if lc >= 1725 and lc < 3600 }} {{ "#4682B4"
|
|
if lc >= 3600 and lc < 21600 }}
|
|
label: '{{ states[entity].name }}'
|
|
tap_action:
|
|
action: more-info
|
|
- type: custom:mushroom-template-badge
|
|
content: >-
|
|
{{ states[entity].state | title }} · {{ states[entity].last_changed |
|
|
relative_time }}
|
|
color: >-
|
|
{% set lc = (as_timestamp(now()) -
|
|
as_timestamp(states[entity].last_changed))|int %} {{ "#ff0000" if lc <
|
|
10 }} {{ "#4d061c" if lc >= 10 and lc < 20 }} {{ "#d2042d" if lc >= 20
|
|
and lc < 45 }} {{ "#fA8072" if lc >= 45 and lc < 90 }} {{ "#ff8c00" if
|
|
lc >= 90 and lc < 180 }} {{ "#ffa500" if lc >= 180 and lc < 400 }} {{
|
|
"#fff700" if lc >= 400 and lc < 830 }} {{ "#ffff00" if lc >= 830 and
|
|
lc < 1725 }} {{ "#008000" if lc >= 1725 and lc < 3600 }} {{ "#4682B4"
|
|
if lc >= 3600 and lc < 21600 }}
|
|
label: '{{ states[entity].name }}'
|
|
tap_action:
|
|
action: more-info
|
|
entity: binary_sensor.driveway_motion_detect
|
|
icon: |-
|
|
{% set state = states(entity) %}
|
|
{% if state == 'on' %}
|
|
mdi:motion-sensor
|
|
{% elif state == 'off' %}
|
|
mdi:motion-sensor-off
|
|
{% else %}
|
|
mdi:motion-sensor-off
|
|
{% endif %}
|
|
- type: custom:mushroom-template-badge
|
|
content: >-
|
|
{{ states[entity].state | title }} · {{ states[entity].last_changed |
|
|
relative_time }}
|
|
icon: |-
|
|
{% set state = states(entity) %}
|
|
{% if state == 'on' %}
|
|
mdi:motion-sensor
|
|
{% elif state == 'off' %}
|
|
mdi:motion-sensor-off
|
|
{% else %}
|
|
mdi:motion-sensor-off
|
|
{% endif %}
|
|
color: >-
|
|
{% set lc = (as_timestamp(now()) -
|
|
as_timestamp(states[entity].last_changed))|int %} {{ "#ff0000" if lc <
|
|
10 }} {{ "#4d061c" if lc >= 10 and lc < 20 }} {{ "#d2042d" if lc >= 20
|
|
and lc < 45 }} {{ "#fA8072" if lc >= 45 and lc < 90 }} {{ "#ff8c00" if
|
|
lc >= 90 and lc < 180 }} {{ "#ffa500" if lc >= 180 and lc < 400 }} {{
|
|
"#fff700" if lc >= 400 and lc < 830 }} {{ "#ffff00" if lc >= 830 and
|
|
lc < 1725 }} {{ "#008000" if lc >= 1725 and lc < 3600 }} {{ "#4682B4"
|
|
if lc >= 3600 and lc < 21600 }}
|
|
label: '{{ states[entity].name }}'
|
|
tap_action:
|
|
action: more-info
|
|
entity: binary_sensor.eastwall_motion_detect
|
|
- type: custom:mushroom-template-badge
|
|
entity: input_boolean.westwall_motion_detected
|
|
content: >-
|
|
{{ states[entity].state | title }} · {{ states[entity].last_changed |
|
|
relative_time }}
|
|
icon: |-
|
|
{% set state = states(entity) %}
|
|
{% if state == 'on' %}
|
|
mdi:motion-sensor
|
|
{% elif state == 'off' %}
|
|
mdi:motion-sensor-off
|
|
{% else %}
|
|
mdi:motion-sensor-off
|
|
{% endif %}
|
|
color: >-
|
|
{% set lc = (as_timestamp(now()) -
|
|
as_timestamp(states[entity].last_changed))|int %} {{ "#ff0000" if lc <
|
|
10 }} {{ "#4d061c" if lc >= 10 and lc < 20 }} {{ "#d2042d" if lc >= 20
|
|
and lc < 45 }} {{ "#fA8072" if lc >= 45 and lc < 90 }} {{ "#ff8c00" if
|
|
lc >= 90 and lc < 180 }} {{ "#ffa500" if lc >= 180 and lc < 400 }} {{
|
|
"#fff700" if lc >= 400 and lc < 830 }} {{ "#ffff00" if lc >= 830 and
|
|
lc < 1725 }} {{ "#008000" if lc >= 1725 and lc < 3600 }} {{ "#4682B4"
|
|
if lc >= 3600 and lc < 21600 }}
|
|
label: '{{ states[entity].name }}'
|
|
tap_action:
|
|
action: more-info
|
|
- type: custom:mushroom-template-badge
|
|
entity: input_boolean.backyard_motion_detected
|
|
content: >-
|
|
{{ states[entity].state | title }} · {{ states[entity].last_changed |
|
|
relative_time }}
|
|
icon: |-
|
|
{% set state = states(entity) %}
|
|
{% if state == 'on' %}
|
|
mdi:motion-sensor
|
|
{% elif state == 'off' %}
|
|
mdi:motion-sensor-off
|
|
{% else %}
|
|
mdi:motion-sensor-off
|
|
{% endif %}
|
|
color: >-
|
|
{% set lc = (as_timestamp(now()) -
|
|
as_timestamp(states[entity].last_changed))|int %} {{ "#ff0000" if lc <
|
|
10 }} {{ "#4d061c" if lc >= 10 and lc < 20 }} {{ "#d2042d" if lc >= 20
|
|
and lc < 45 }} {{ "#fA8072" if lc >= 45 and lc < 90 }} {{ "#ff8c00" if
|
|
lc >= 90 and lc < 180 }} {{ "#ffa500" if lc >= 180 and lc < 400 }} {{
|
|
"#fff700" if lc >= 400 and lc < 830 }} {{ "#ffff00" if lc >= 830 and
|
|
lc < 1725 }} {{ "#008000" if lc >= 1725 and lc < 3600 }} {{ "#4682B4"
|
|
if lc >= 3600 and lc < 21600 }}
|
|
label: '{{ states[entity].name }}'
|
|
tap_action:
|
|
action: more-info
|
|
header:
|
|
card:
|
|
type: markdown
|
|
text_only: true
|
|
content: |
|
|
# House Alarm
|