wernerhp / ha.integration.load_shedding

A Home Assistant integration to track your load schedding schedule.
MIT License
113 stars 21 forks source link

api from eskom se push #58

Closed sunsetseatime closed 9 months ago

sunsetseatime commented 1 year ago

Thanks for this. Saved me so much time. Im trying to figure out how to plug my API into the mushrooms (lol) so it reads my limit etc. Right now I have no clue Sorry for the inconvenience

emeyedeejay commented 1 year ago

Add something along these lines to your sensor: section in config.yaml

  - platform: rest
    name: EskomSePushAllowance
    resource: https://developer.sepush.co.za/business/2.0/api_allowance
    headers:
      Token: !secret EskomSePush
    json_attributes_path: "$.allowance"
    json_attributes:
      - count
      - limit
      - type
    value_template: "OK"
    scan_interval: 1800
tinuva commented 1 year ago

Why?

if you already run this integration, you can just do this:

type: custom:mushroom-chips-card
chips:
  - type: template
    content: '{{state_attr(entity, "count")}}/{{state_attr(entity, "limit")}}'
    entity: sensor.load_shedding_sepush_api_quota
    icon: mdi:api
    tap_action:
      action: more-info
alignment: center

Looks like:

Screenshot 2023-03-24 at 13 12 15

wernerhp commented 1 year ago

Check out Card 4 Example in the README The code tinuva posted is there.

image

sunsetseatime commented 1 year ago

Thank you for all this. I'm new to this and see how things work Appreciate the assistance.

On Fri, 24 Mar 2023, 18:22 Werner Pieterson, @.***> wrote:

Check out Card 4 https://github.com/wernerhp/ha.integration.load_shedding/blob/master/examples/card4.yaml Example in the README https://github.com/wernerhp/ha.integration.load_shedding#readme

[image: image] https://user-images.githubusercontent.com/2578772/227583274-13728556-e9f5-4be8-923c-f5f3bb8322d7.png

— Reply to this email directly, view it on GitHub https://github.com/wernerhp/ha.integration.load_shedding/issues/58#issuecomment-1483075766, or unsubscribe https://github.com/notifications/unsubscribe-auth/A6JZTOUE3NJURC663T55VBLW5XC4BANCNFSM6AAAAAAVSY4K5Y . You are receiving this because you authored the thread.Message ID: @.***>

wernerhp commented 1 year ago

Cool, no problem. I'm just a Home Assistant user who decided to write this integration, that uses the EskomSePush API, in my spare time. Let me know how things go. Will try to help where I can.

sunsetseatime commented 1 year ago

Wow. Pretty impressive! And thank you for doing this.

On Fri, 24 Mar 2023, 18:48 Werner Pieterson, @.***> wrote:

Cool, no problem. I'm just a Home Assistant user who decided to write this integration, that uses the EskomSePush API, in my spare time. Let me know how things go. Will try to help where I can.

— Reply to this email directly, view it on GitHub https://github.com/wernerhp/ha.integration.load_shedding/issues/58#issuecomment-1483108898, or unsubscribe https://github.com/notifications/unsubscribe-auth/A6JZTORUIBRKK7XYXFM3ADLW5XF4RANCNFSM6AAAAAAVSY4K5Y . You are receiving this because you authored the thread.Message ID: @.***>

emeyedeejay commented 1 year ago

Why?

if you already run this integration, you can just do this:

type: custom:mushroom-chips-card
chips:
  - type: template
    content: '{{state_attr(entity, "count")}}/{{state_attr(entity, "limit")}}'
    entity: sensor.load_shedding_sepush_api_quota
    icon: mdi:api
    tap_action:
      action: more-info
alignment: center

Looks like:

Screenshot 2023-03-24 at 13 12 15

Oh yeah - I do that too lol!

image

That REST sensor was pre integration and can go!