Card 1:
type: custom:mushroom-template-card
primary: Upcoming loadshedding slots
icon: mdi:power-plug-off-outline
multiline_secondary: true
secondary: >
{%- for event in states['sensor.eskomsepush'].attributes.events -%} {{
as_timestamp(event['start']) | timestamp_custom('%a\t%Y-%m-%d \t%I:%M %p\t')
}}➡{{ as_timestamp(event['end']) | timestamp_custom('\t%I:%M %p\t') }}
({{event['note']}}) {{- '\n' -}} {%- endfor -%}
icon_color: red
Card 2:
type: custom:mushroom-template-card
primary: Upcoming loadshedding stages
icon: mdi:guy-fawkes-mask
multiline_secondary: true
secondary: |2-
{%- for event in states['sensor.eskomsepushstatus'].attributes.status.capetown.next_stages -%} {{
as_timestamp(event['stage_start_timestamp']) | timestamp_custom('%a\t%Y-%m-%d %H:%M\t') }}➡{% if loop.index < loop.length %}{{ as_timestamp(loop.nextitem['stage_start_timestamp']) | timestamp_custom('\t%a\t%Y-%m-%d %H:%M') }}{% else %}{{'\t\t\t\t\t\t '}}
{%- endif -%}{{'\t:\t\t'}}{{ event['stage'] }}{{'\n'}}
{%- endfor -%}
fill_container: true
icon_color: orange
badge_icon: ''
Relies on the following:
rest:
- resource: "https://developer.sepush.co.za/business/2.0/area"
scan_interval: '02:00:00' # RATE LIMIT!
headers:
Token: !secret EskomSePushToken
params:
id: "capetown-9-pinelands"
#id: "<your area id here>"
sensor:
- name: EskomSePush
unique_id: eskomsepush
force_update: true
value_template: "OK"
json_attributes:
- events
- info
- schedule
- resource: "https://developer.sepush.co.za/business/2.0/status"
scan_interval: '02:00:00' # RATE LIMIT!
headers:
Token: !secret EskomSePushToken
sensor:
- name: EskomSePushStatus
unique_id: eskomsepushstatus
force_update: true
value_template: "OK"
json_attributes:
- status