Simplify dashboard. Use with_state_indicator for brita. Add brita popup card

This commit is contained in:
2020-05-01 17:33:12 +03:00
parent 28c855fa28
commit 9f2960194c
2 changed files with 106 additions and 89 deletions
@@ -117,45 +117,37 @@
entity: binary_sensor.pi_hole_enabled entity: binary_sensor.pi_hole_enabled
name: Pi-Hole name: Pi-Hole
icon: mdi:pi-hole icon: mdi:pi-hole
- type: custom:button-card
- type: horizontal-stack template:
title: Brita - default
cards: - with_state_indicator
- type: custom:button-card name: Brita water
template: default entity: script.brita_pour_water
name: Pour water custom_fields:
entity: script.brita_pour_water remaining_liters: "[[[ return states['input_number.brita_remaining_liters'].state ]]]"
custom_fields: tap_action:
remaining_liters: "[[[ return states['input_number.brita_remaining_liters'].state ]]]" action: toggle
tap_action: styles:
action: toggle card:
styles: - background: >
card: [[[
- background: > const remaining = states['input_number.brita_remaining_liters'].state;
[[[ const percent = 100 - (remaining / 150 * 100);
const remaining = states['input_number.brita_remaining_liters'].state; return 'linear-gradient(180deg, var(--paper-card-background-color) 0%, var(--paper-card-background-color)' + percent + '%, var(--primary-color) ' + percent + '%)'
const percent = 100 - (remaining / 150 * 100); ]]]
return 'linear-gradient(180deg, var(--paper-card-background-color) 0%, var(--paper-card-background-color)' + percent + '%, var(--primary-color) ' + percent + '%)' - color: white
]]] icon:
- color: white - color: white
icon: custom_fields:
- color: white remaining_liters:
custom_fields: - position: absolute
remaining_liters: - top: 5px
- position: absolute - right: 5px
- top: 5px - font-size: 12px
- right: 5px variables:
- font-size: 12px state_indicator_id: binary_sensor.brita_should_change_filter
- type: custom:button-card state_indicator_off_color: white
template: default state_indicator_on_color: red
name: New filter
entity: script.brita_new_filter
tap_action:
action: toggle
- type: custom:button-card
template: default
name: Filter
entity: binary_sensor.brita_should_change_filter
# Column 2 # Column 2
- type: vertical-stack - type: vertical-stack
@@ -228,59 +220,60 @@
- type: vertical-stack - type: vertical-stack
title: Sensors title: Sensors
cards: cards:
- type: horizontal-stack - type: vertical-stack
cards: cards:
- type: custom:button-card - type: horizontal-stack
template: default cards:
entity: binary_sensor.front_door_on_off_wrapper - type: custom:button-card
- type: custom:button-card template: default
template: default entity: binary_sensor.front_door_on_off_wrapper
entity: binary_sensor.living_room_right_window_on_off_wrapper - type: custom:button-card
name: Living room template: default
- type: horizontal-stack entity: binary_sensor.living_room_right_window_on_off_wrapper
cards: name: Living room
- type: custom:button-card - type: horizontal-stack
template: cards:
- default - type: custom:button-card
- with_state_indicator template:
entity: binary_sensor.motion_2_ias_zone - default
name: Hallway - with_state_indicator
variables: entity: binary_sensor.motion_2_ias_zone
state_indicator_id: automation.lighting_hallway_day_mode_motion_turn_lights_on name: Hallway
- type: custom:button-card variables:
template: default state_indicator_id: automation.lighting_hallway_day_mode_motion_turn_lights_on
entity: binary_sensor.browser_kitchen - type: custom:button-card
name: Kitchen template: default
- type: custom:button-card entity: binary_sensor.browser_kitchen
template: name: Kitchen
- default - type: custom:button-card
- with_state_indicator template:
entity: binary_sensor.motion_1_ias_zone - default
name: Kitchen 2 - with_state_indicator
variables: entity: binary_sensor.motion_1_ias_zone
state_indicator_id: automation.lighting_kitchen_day_mode_motion_turn_lights_on_after_sunset name: Kitchen 2
variables:
state_indicator_id: automation.lighting_kitchen_day_mode_motion_turn_lights_on_after_sunset
- type: vertical-stack - type: vertical-stack
title: Presence
cards:
- type: horizontal-stack
cards: cards:
- type: custom:button-card - type: horizontal-stack
template: default cards:
entity: binary_sensor.georgi_home - type: custom:button-card
tap_action: template: default
action: call-service entity: binary_sensor.georgi_home
service: input_boolean.toggle tap_action:
service_data: action: call-service
entity_id: input_boolean.georgi_home service: input_boolean.toggle
- type: custom:button-card service_data:
template: default entity_id: input_boolean.georgi_home
entity: device_tracker.mikrotik_carbon - type: custom:button-card
name: Wifi template: default
- type: custom:button-card entity: device_tracker.mikrotik_carbon
template: default name: Wifi
entity: device_tracker.carbon - type: custom:button-card
name: GPS template: default
entity: device_tracker.carbon
name: GPS
# Column 3 # Column 3
+24
View File
@@ -252,3 +252,27 @@ input_boolean.alarm_enabled:
entities: entities:
- input_boolean.alarm_enabled - input_boolean.alarm_enabled
- input_datetime.alarm_time - input_datetime.alarm_time
script.brita_pour_water:
title: Brita
style: *popup_style
card:
type: vertical-stack
cards:
- type: entities
entities:
- input_number.brita_remaining_liters
- input_datetime.brita_next_change
- type: horizontal-stack
cards:
- type: custom:button-card
template: default
name: New filter
entity: script.brita_new_filter
tap_action:
action: toggle
- type: custom:button-card
template: default
name: Filter
entity: binary_sensor.brita_should_change_filter