Anyone figured how to use EskomsePush to control switches on HA

Thanks, eventually found a git doc that pointed me to having to install hacp first, and then using that install mushroom.
and now i installed Werners app and not even using the Mushrooms, ehehe
anyone by any change got a dashboard integrated with Werners integration, exposing via fancy Mushroom front end ?
G
His GIT has sample code for mushroom-type cards that you can then add to your own dashboards
1677500523729.png
^ That is created using this code

YAML:
type: vertical-stack
cards:
  - type: custom:mushroom-chips-card
    chips:
      - type: entity
        entity: sensor.load_shedding_stage_capetown
        icon: ''
      - type: entity
        entity: sensor.load_shedding_stage_eskom
        icon: ''
      - type: entity
        entity: sensor.load_shedding_area_eskde_14_milnertoncityofcapetownwesterncape
        icon: ''
      - type: template
        content: '{{state_attr(entity, "count")}}/{{state_attr(entity, "limit")}}'
        entity: sensor.load_shedding_sepush_quota
        icon: mdi:api
        tap_action:
          action: more-info
    alignment: center
  - type: markdown
    content: >
      {% set stage_sensor = "sensor.load_shedding_stage_eskom" %}

      {% set area_sensor =
      "sensor.load_shedding_area_eskde_14_milnertoncityofcapetownwesterncape"
      %}

      {% set area_schedule = state_attr(area_sensor, "forecast") %}

      {% if area_schedule %}
        {% set start_time = area_schedule[0].start_time %}
        {% set end_time = area_schedule[0].end_time %}

        {% if is_state(area_sensor, "off") %}
          {% set starts_in = timedelta(minutes=state_attr(area_sensor, "starts_in")).total_seconds() | int // 60 %}
          {% set mins = starts_in % 60 %}
          {% set hrs = starts_in // 60 % 24 %}
          {% set days = starts_in // 1440 %}
          {% set alert = "Load Shedding starts in {d}d {h}h {m}m ({next})".format(d=days, m=mins, h=hrs, next=as_timestamp(start_time) | timestamp_custom("%H:%M", True)) %}

          {% if starts_in > 1440 %}
            <ha-alert alert-type="success">{{ states(stage_sensor) }}</ha-alert>
          {% elif 60 < starts_in <= 1440 %}
            <ha-alert alert-type="warning">{{ alert }}</ha-alert>
          {% else %}
            <ha-alert alert-type="error">{{ alert }}</ha-alert>
          {% endif %}
        {% else %}
          {% set ends_in = timedelta(minutes=state_attr(area_sensor, "ends_in")).total_seconds() | int // 60 %}
            {% set mins = ends_in % 60 %}
            {% set hrs = ends_in // 60 % 24 %}
            {% set days = ends_in // 1440 %}
            {% set alert = "Load Shedding ends in {d}d {h}h {m}m ({next})".format(d=days, m=mins, h=hrs, next=as_timestamp(end_time) | timestamp_custom("%H:%M", True)) %}

            <ha-alert alert-type="error">{{ alert }}</ha-alert>
        {% endif %}
      {% else %}
        {% set stage = state_attr(stage_sensor, "next_stage") %}
        {% set start_time = state_attr(stage_sensor, "next_start_time") %}
        {% set end_time = state_attr(stage_sensor, "next_end_time") %}
        {% set starts_in = timedelta(minutes=state_attr(stage_sensor, "starts_in")).total_seconds() | int // 60 %}
        {% set mins = starts_in % 60 %}
        {% set hrs = starts_in // 60 % 24 %}
        {% set days = starts_in // 1440 %}
        {% if (start_time == 0 or end_time == 0) %}
        {% set alert = "No Load Shedding" %}
        {% else %}
        {% set alert = "Stage {stage} starts in {d}d {h}h {m}m ({next})".format(stage=stage, d=days, m=mins, h=hrs, next=as_timestamp(start_time) | timestamp_custom("%H:%M", True)) %}
        {% endif %}
        <ha-alert alert-type="success">{{ alert }}</ha-alert>
      {% endif %}
  - type: custom:atomic-calendar-revive
    enableModeChange: true
    firstDayOfWeek: 1
    refreshInterval: 1800
    entities:
      - calendar.load_shedding_forecast
    showCurrentEventLine: false
    showMonth: true
    showWeekDay: true
    disableEventLink: true
    showNoEventsForToday: true
    disableLocationLink: true
    showFullDayProgress: false
    showEventIcon: false
    showHiddenText: false
    showCalendarName: false
    calShowDescription: false
    showLastCalendarWeek: true
    disableCalEventLink: true
    disableCalLocationLink: true
    disableCalLink: true
    showDescription: false
    dateFormat: LL
    showDate: false
    sortByStartTime: false
    showRelativeTime: true
    showProgressBar: true
    showLocation: true
    showDeclined: true
    showMultiDayEventParts: false
    showMultiDay: false
    showLoader: false
    maxDaysToShow: 3
 
Hi

I need some help again please.
I have a sensors.yaml with this code that I copied from @Tinuva and @SAguy but when i try to save it I get this error message. I have no idea why or what I'm doing wrong. In my config.yaml i have a line that points to the sensor.yaml (sensor: !include sensors.yaml)

"Message malformed: Unable to determine action @ data['action'][0]"

YAML:
/config/sensor.yaml
  - platform: template
    sensors:
      loadshedding_slot_forecast:
        friendly_name: Loadshedding slot forecast
        unique_id: loadshedding_slot_forecast
        value_template: >
          {%if state_attr('sensor.load_shedding_area_ekurhuleni3_9_edenvale','forecast')|count > 0 %}
          {%- set data = namespace(count=1) -%}
          {%- for event in states['sensor.load_shedding_area_ekurhuleni3_9_edenvale'].attributes.forecast -%}
          {% if data.count <= 4 %}
          {%- set start = as_timestamp(event['start_time']) %}
          {%- set end = as_timestamp(event['end_time']) %}
          {%- set startdelta = as_timestamp(event['start_time'] + timedelta(minutes=30)) %}
          {%- if startdelta != end %}
          {{- start | timestamp_custom('%a %d %b:') }} {{- start | timestamp_custom(' %H:%M') }} to {{- end | timestamp_custom(' %H:%M') }}
          {{- '\n' -}}
          {%- set data.count = data.count + 1 %}
          {%-endif%}
          {%-endif%}{%- endfor -%}
          {%-else%}
          None scheduled
          {%endif%}

automation:
alias: Loadshedding forecast notification
description: ""
trigger:
  - entity_id: sensor.loadshedding_slot_forecast
    platform: state
condition:
  - condition: not
    conditions:
      - condition: state
        entity_id: sensor.loadshedding_slot_forecast
        state: unavailable
  - condition: template
    value_template: |
      {{ trigger.from_state.state != trigger.to_state.state }}
  - condition: template
    value_template: |
      {{ trigger.from_state.state != "unavailable" }}         
action:
  - action:
      - service: notify.whatsapp_group
        data:
          object: loadshedding forecast notification
          icon: ":zap:"
          message: |
            *⚡ Loadshedding Schedule ⚡*
                        Currently Stage {{ (state_attr("sensor.load_shedding_stage_eskom", "stage")) }}"

            {{ states.sensor.loadshedding_slot_forecast }}
          inline_keyboard:
            - Refresh Forecast:/refresh_forecast
        alias: Send Telegram message to group
initial_state: "on"
 
Hi

I need some help again please.
I have a sensors.yaml with this code that I copied from @Tinuva and @SAguy but when i try to save it I get this error message. I have no idea why or what I'm doing wrong. In my config.yaml i have a line that points to the sensor.yaml (sensor: !include sensors.yaml)

"Message malformed: Unable to determine action @ data['action'][0]"

YAML:
/config/sensor.yaml
  - platform: template
    sensors:
      loadshedding_slot_forecast:
        friendly_name: Loadshedding slot forecast
        unique_id: loadshedding_slot_forecast
        value_template: >
          {%if state_attr('sensor.load_shedding_area_ekurhuleni3_9_edenvale','forecast')|count > 0 %}
          {%- set data = namespace(count=1) -%}
          {%- for event in states['sensor.load_shedding_area_ekurhuleni3_9_edenvale'].attributes.forecast -%}
          {% if data.count <= 4 %}
          {%- set start = as_timestamp(event['start_time']) %}
          {%- set end = as_timestamp(event['end_time']) %}
          {%- set startdelta = as_timestamp(event['start_time'] + timedelta(minutes=30)) %}
          {%- if startdelta != end %}
          {{- start | timestamp_custom('%a %d %b:') }} {{- start | timestamp_custom(' %H:%M') }} to {{- end | timestamp_custom(' %H:%M') }}
          {{- '\n' -}}
          {%- set data.count = data.count + 1 %}
          {%-endif%}
          {%-endif%}{%- endfor -%}
          {%-else%}
          None scheduled
          {%endif%}

automation:
alias: Loadshedding forecast notification
description: ""
trigger:
  - entity_id: sensor.loadshedding_slot_forecast
    platform: state
condition:
  - condition: not
    conditions:
      - condition: state
        entity_id: sensor.loadshedding_slot_forecast
        state: unavailable
  - condition: template
    value_template: |
      {{ trigger.from_state.state != trigger.to_state.state }}
  - condition: template
    value_template: |
      {{ trigger.from_state.state != "unavailable" }}        
action:
  - action:
      - service: notify.whatsapp_group
        data:
          object: loadshedding forecast notification
          icon: ":zap:"
          message: |
            *⚡ Loadshedding Schedule ⚡*
                        Currently Stage {{ (state_attr("sensor.load_shedding_stage_eskom", "stage")) }}"

            {{ states.sensor.loadshedding_slot_forecast }}
          inline_keyboard:
            - Refresh Forecast:/refresh_forecast
        alias: Send Telegram message to group
initial_state: "on"
why do you have this?
YAML:
action:
  - action:
 
why do you have this?
YAML:
action:
  - action:
I was just trying to show what the action was in my automation.yaml.
I think i fixed it now I took out the object: and the icon: and then also the
inline_keyboard:
- Refresh Forecast:/refresh_forecast
alias: Send Telegram message to group
I hope I don't need to have the object portion under data.

YAML:
  alias: Loadshedding forecast notification
  trigger:
  - entity_id: sensor.loadshedding_slot_forecast
    platform: state
  condition:
  - condition: not
    conditions:
    - condition: state
      entity_id: sensor.loadshedding_slot_forecast
      state: unavailable
    - condition: template
      value_template: '{{ trigger.from_state.state != trigger.to_state.state }}

        '
    - condition: template
      value_template: '{{ trigger.from_state.state != "unavailable" }}

        '
  action:
  - service: notify.whatsapp_group
    data:
      message: "*⚡ Loadshedding Schedule ⚡*\n            Currently Stage {{ (state_attr(\"sensor.load_shedding_stage_capetown\",
        \"stage\")) }}\n\n{{ states.sensor.loadshedding_slot_forecast.state }}\n"
 
Thanks for this. Took a while to read the whole 11 pages to see how this all developed.

Besides using the integration to trigger a load-shedding "warning" over my Google Home speakers I'll also hopefully be using it to control my inverter charge rates and priorities:
eg. If SOC not 100% and load shedding imminent either switch to or dial up AC charging to ensure 100% SOC by the time loadshedding kicks in.
did you ever figure out how to do this?
 
Interesting side note - SolarAssistant now has an integration to an eskom calendar so it is able to show when Loadshedding is coming up

1679483600391.png

1679483619562.png
The data doesn't seem to come through on MQTT though so no way to currently integrate into any automations (as far as i can tell)
 
The last week or so the API is showing me 2 loadshedding slot a day but we only have 1. The app is showing it correctly but in HA there are 2 calendar entries. Will this correct itself or can I do something?
 
The last week or so the API is showing me 2 loadshedding slot a day but we only have 1. The app is showing it correctly but in HA there are 2 calendar entries. Will this correct itself or can I do something?

I have to restart the integration occasionally 'cos it gets stuck

Have considered putting HA on a daily reboot schedule but not bothered yet
 
I have to restart the integration occasionally 'cos it gets stuck

Have considered putting HA on a daily reboot schedule but not bothered yet

You can also set up an automation to reload the integration as such which works well. I use this for some troublesome integrations. Choose device, then select the integration name.

Screenshot 2023-04-11 at 10.49.05.png
 
For some reason the last few days i dont get the loadshedding forecast sent. It displays correctly in lovelace but the automation to send the schedule doesnt work. The notification is sent but shows "unavailable"

YAML:
alias: Loadshedding Schedule
description: ""
trigger:
  - platform: time
    at: "06:45:00"
condition: []
action:
  - service: notify.notify
    data:
      title: Loadshedding Forecast
      message: " {{ states.sensor.loadshedding_slot_forecast.state }}"
      target: -8
  - service: notify.mobile_app_iphone_mini
    data:
      message: " {{ states.sensor.loadshedding_slot_forecast.state }}"
mode: single
 
I'm glad I found this thread, I have home assistant installed on a mini PC using proxmox. My aim is to automate my inverter so that it charges battery before loadshedding so that I don't have to do it manually.



I have solar assistant and get the inverter values are being pulled in home assistant. This might be a silly question but I don't know how to install the loadshedding module that is being talked about on this thread. I tried following the instructions on GitHub but I can't figure how to do it.



I feel like I may have missed something with my homeassistant setup that is not allowing me to load the module. Could anyone please help me on how to load this.
 
I'm glad I found this thread, I have home assistant installed on a mini PC using proxmox. My aim is to automate my inverter so that it charges battery before loadshedding so that I don't have to do it manually.



I have solar assistant and get the inverter values are being pulled in home assistant. This might be a silly question but I don't know how to install the loadshedding module that is being talked about on this thread. I tried following the instructions on GitHub but I can't figure how to do it.



I feel like I may have missed something with my homeassistant setup that is not allowing me to load the module. Could anyone please help me on how to load this.
Have you installed HACS in Home Assistant?

 
Have you installed HACS in Home Assistant?

I eventually figured out how to do it thanks. I managed to install and configure the loadshedding program. What I'm left with is automations to charge the battery when load shedding is about to start based on battery SOC
 
I eventually figured out how to do it thanks. I managed to install and configure the loadshedding program. What I'm left with is automations to charge the battery when load shedding is about to start based on battery SOC

Something that I also want to do (time, time, time - juggling so many projects...)

In the meantime I monitor ESP and manually adjust the work modes via SolarAssistant.

Winter in Cape Town sucks 'cos we get a lot of cloud cover. I also have relatively high base draw so, much as it pains me to pay Eskom 'unnecessarily' I might eventually just set all my work slots to 75 percent and just leave it at that for winter so that I don't have to constantly monitor the battery level.
 
Something that I also want to do (time, time, time - juggling so many projects...)

In the meantime I monitor ESP and manually adjust the work modes via SolarAssistant.

Winter in Cape Town sucks 'cos we get a lot of cloud cover. I also have relatively high base draw so, much as it pains me to pay Eskom 'unnecessarily' I might eventually just set all my work slots to 75 percent and just leave it at that for winter so that I don't have to constantly monitor the battery level.
I think I will give it a go this weekend. I'm quite new to homeassistant but I'm sure I can look at the automations that have been posted on this thread and adjust those to suit mine.
75% will be too high for me, my heart bleeds when I buy anything from eskom
 
Interesting side note - SolarAssistant now has an integration to an eskom calendar so it is able to show when Loadshedding is coming up

View attachment 1496489

View attachment 1496491
The data doesn't seem to come through on MQTT though so no way to currently integrate into any automations (as far as i can tell)
The data for SA comes from https://eskomcalendar.co.za/ec which is an open source project by a Stellies student.

You should be able to ingest it in calendar format in HA, or perhaps someone will come up with an integration to do the same.
 
Interesting side note - SolarAssistant now has an integration to an eskom calendar so it is able to show when Loadshedding is coming up

View attachment 1496489

View attachment 1496491
The data doesn't seem to come through on MQTT though so no way to currently integrate into any automations (as far as i can tell)
So, integration for that into the HA calendar was quite easy.

I used HACS to install the "ICS Calendar (iCalendar)" component, then restarted HA.

Then I added the following config entries into my configuration.yaml
Code:
calendar:
  - platform: ics_calendar
    calendars:
      - name: "Loadshedding Greenside"
        url: "https://github.com/beyarkay/eskom-calendar/releases/download/latest/city-power-2.ics"
        download_interval: 30

And restarted HA again.

This gives me a calendar entry in the HA Calendar which I can now use for automations.

I'm still using the (https://github.com/wernerhp/ha.integration.load_shedding) with EskomSePush for now, but https://eskomcalendar.co.za seems like a low-friction way to do it without API keys etc. Just find your location and "Copy Calendar Feed" into your configuration.yaml as appropriate.
 
Top
Sign up to the MyBroadband newsletter
X