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