forked from wernerhp/ha.integration.load_shedding
-
Notifications
You must be signed in to change notification settings - Fork 0
/
card1.yaml
25 lines (25 loc) · 1.31 KB
/
card1.yaml
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
type: entities
entities:
- type: custom:template-entity-row
icon: mdi:lightning-bolt-outline
name: Status
entity: sensor.load_shedding_stage_eskom
active: '{{ not is_state("sensor.load_shedding_stage_eskom", "No Load Shedding") }}'
state: '{{states("sensor.load_shedding_stage_eskom")}}'
- type: custom:template-entity-row
icon: mdi:timer-outline
name: Milnerton
active: >-
{{ states("sensor.load_shedding_area_eskde_14_milnertoncityofcapetownwesterncape") == "on" }}
state: >-
{{ (state_attr("sensor.load_shedding_area_eskde_14_milnertoncityofcapetownwesterncape",
"next_start_time") | as_datetime | as_local).strftime("%H:%M") }} - {{
(state_attr("sensor.load_shedding_area_eskde_14_milnertoncityofcapetownwesterncape",
"next_end_time") | as_datetime | as_local).strftime("%H:%M") }}
secondary: >-
{% if states("sensor.load_shedding_milnerton_14") == "off" %} Starts in {{
timedelta(minutes=state_attr("sensor.load_shedding_area_eskde_14_milnertoncityofcapetownwesterncape",
"next_start_time")) }} {% else %} Ends in {{
timedelta(minutes=state_attr("sensor.load_shedding_area_eskde_14_milnertoncityofcapetownwesterncape",
"next_end_time")) }} {% endif %}
entity: sensor.load_shedding_area_eskde_14_milnertoncityofcapetownwesterncape