mirror of
https://github.com/GeorgeSG/sarah.git
synced 2026-05-13 19:54:42 +00:00
Refactor temperature card into progress card. Use for humidity
This commit is contained in:
+13
-14
@@ -1,15 +1,14 @@
|
||||
temperature:
|
||||
progress:
|
||||
variables:
|
||||
min_value: 5
|
||||
max_value: 45
|
||||
normal: 19
|
||||
hot: 23
|
||||
color_cold: "var(--primary-color)"
|
||||
color_normal: "var(--color-green)"
|
||||
color_hot: "var(--color-red)"
|
||||
normal_value: 19
|
||||
high_value: 23
|
||||
low_color: "var(--primary-color)"
|
||||
normal_color: "var(--color-green)"
|
||||
high_color: "var(--color-red)"
|
||||
show_state: true
|
||||
show_name: true
|
||||
# state_display: '[[[ return entity.state.toString().split(".")[0] ]]]'
|
||||
styles:
|
||||
name:
|
||||
- position: absolute
|
||||
@@ -19,12 +18,12 @@ temperature:
|
||||
- font-size: 1em
|
||||
state:
|
||||
- position: absolute
|
||||
- top: 16%
|
||||
- top: 17%
|
||||
- width: 100%
|
||||
- display: flex
|
||||
- align-items: center
|
||||
- justify-content: center
|
||||
- font-size: 2em
|
||||
- font-size: 1.9em
|
||||
icon:
|
||||
- position: absolute
|
||||
- top: 0
|
||||
@@ -36,11 +35,11 @@ temperature:
|
||||
[[[
|
||||
var temp = entity.state;
|
||||
|
||||
var color = temp < variables.normal
|
||||
? variables.color_cold
|
||||
: temp < variables.hot
|
||||
? variables.color_normal
|
||||
: variables.color_hot;
|
||||
var color = temp < variables.normal_value
|
||||
? variables.low_color
|
||||
: temp < variables.high_value
|
||||
? variables.normal_color
|
||||
: variables.high_color;
|
||||
var percent = (temp - variables.min_value)/(variables.max_value - variables.min_value) * 100;
|
||||
var gradient = 100 - percent;
|
||||
|
||||
@@ -194,6 +194,34 @@
|
||||
- entity: input_datetime.alarm_time
|
||||
name: Time
|
||||
|
||||
- type: horizontal-stack
|
||||
title: Bedroom
|
||||
cards:
|
||||
- type: custom:button-card
|
||||
template:
|
||||
- small
|
||||
- progress
|
||||
name: Temperature
|
||||
entity: sensor.bedroom_weather_temperature
|
||||
- type: custom:button-card
|
||||
template:
|
||||
- small
|
||||
- progress
|
||||
name: Humidity
|
||||
entity: sensor.bedroom_weather_humidity
|
||||
variables:
|
||||
min_value: 25
|
||||
max_value: 90
|
||||
normal_value: 40
|
||||
high_value: 65
|
||||
low_color: "var(--color-red)"
|
||||
normal_color: "var(--color-green)"
|
||||
high_color: "var(--color-red)"
|
||||
- type: custom:button-card
|
||||
template: default
|
||||
entity: binary_sensor.bedroom_right_window_on_off_wrapper
|
||||
name: Window
|
||||
|
||||
- type: vertical-stack
|
||||
title: Sensors
|
||||
cards:
|
||||
@@ -202,17 +230,10 @@
|
||||
- type: custom:button-card
|
||||
template: default
|
||||
entity: binary_sensor.front_door_on_off_wrapper
|
||||
- type: custom:button-card
|
||||
template:
|
||||
- small
|
||||
- temperature
|
||||
name: M. Bedroom
|
||||
entity: sensor.bedroom_weather_temperature
|
||||
- type: custom:button-card
|
||||
template: default
|
||||
entity: binary_sensor.bedroom_right_window_on_off_wrapper
|
||||
name: M. Bedroom
|
||||
|
||||
entity: binary_sensor.living_room_right_window_on_off_wrapper
|
||||
name: Living room
|
||||
- type: horizontal-stack
|
||||
cards:
|
||||
- type: custom:button-card
|
||||
@@ -227,10 +248,6 @@
|
||||
template: default
|
||||
entity: binary_sensor.motion_1_ias_zone
|
||||
name: Kitchen 2
|
||||
- type: custom:button-card
|
||||
template: default
|
||||
entity: binary_sensor.living_room_right_window_on_off_wrapper
|
||||
name: Living room
|
||||
|
||||
- type: vertical-stack
|
||||
title: Presence
|
||||
|
||||
Reference in New Issue
Block a user