tinuva / ha-coct-loadshedding

Fetches loadshedding data from City of Cape Town
Apache License 2.0
20 stars 2 forks source link

Collab #2

Closed wernerhp closed 2 years ago

wernerhp commented 2 years ago

I see we are working on similar projects. Perhaps you would like to collaborate? Keen to get your thoughts.

I have CoCT an Eskom Direct working. Need some help to get other metros schedules. Installable via HACS.

https://github.com/wernerhp/ha.integration.load_shedding

tinuva commented 2 years ago

Hey,

My aim for this integration was to report the CoCT loadshedding stage, which at times are different from the national level. I think in that context it works 100%.

What we can potently rather look at, is working together on the EskomSePush addon when they release their public api, where they already do the schedules for most if not all metros. I think that would make more sense, unless you think the above integration is flexible enough to change?

wernerhp commented 2 years ago

It's pretty flexible. This Python library I wrote to get the data actually has an outstanding task to implement CoCT stages. I didn't realize you uave the CoCT stages working. Where/how did you find the API to get the CoCT stage?

wernerhp commented 2 years ago

That API actually makes is super simple. Great find! Only need to call the API in the libs/coct.py and update this call in the provider to use that instead of Eskom to get the stage.

wernerhp commented 2 years ago

When ESP release a public API I figured I'd and add it to the library, since it makes it relatively easy to add new providers into the HA integration. I think the public API might still take several months.

tinuva commented 2 years ago

When ESP release a public API I figured I'd and add it to the library, since it makes it relatively easy to add new providers into the HA integration. I think the public API might still take several months.

https://twitter.com/i/web/status/1547169349395533825

I have it on good authority they aiming for August release, though maybe the month after.

tinuva commented 2 years ago

It's pretty flexible. This Python library I wrote to get the data actually has an outstanding task to implement CoCT stages. I didn't realize you uave the CoCT stages working. Where/how did you find the API to get the CoCT stage?

Yup you can check it out. I figured it out by looking at what the CoCT loadshedding app does.

It is not perfect, humans updating it, but its accurate enough most of the time.

wernerhp commented 2 years ago

I have it on good authority they aiming for August release, though maybe the month after.

Ah, ok, I chatted with Herman a while back. He mentioned that public API is high on the list, but didn't provide any timelines.

Yup you can check it out. I figured it out by looking at what the CoCT loadshedding app does.

It is not perfect, humans updating it, but its accurate enough most of the time.

Smart man 😁

tinuva commented 2 years ago

@wernerhp

Had a sneak peak into the ESP api. It's exactly what everyone is looking for, and its coming.

After looking at https://gitlab.com/wernerhp/load-shedding/ I suspect you would be able to use the ESP api for all municipalities that work with ESP.

The only catch is, there is a 50 api limit for the public api, so you will have to work around that. Which I believe is possible since solar forecast addons have to do the same thing.

wernerhp commented 2 years ago

@wernerhp

Had a sneak peak into the ESP api. It's exactly what everyone is looking for, and its coming.

After looking at https://gitlab.com/wernerhp/load-shedding/ I suspect you would be able to use the ESP api for all municipalities that work with ESP.

The only catch is, there is a 50 api limit for the public api, so you will have to work around that. Which I believe is possible since solar forecast addons have to do the same thing.

I would probably just let every user sign up for their own ESP API key and enter it in config flow during setup.

Can you send me the details?

tinuva commented 2 years ago

I was asked not to link anything yet, as there may still be changes on the API. 100% agree with each user must be using their own key.

tinuva commented 2 years ago

@wernerhp Had a sneak peak into the ESP api. It's exactly what everyone is looking for, and its coming. After looking at https://gitlab.com/wernerhp/load-shedding/ I suspect you would be able to use the ESP api for all municipalities that work with ESP. The only catch is, there is a 50 api limit for the public api, so you will have to work around that. Which I believe is possible since solar forecast addons have to do the same thing.

I would probably just let every user sign up for their own ESP API key and enter it in config flow during setup.

Can you send me the details?

EskomSePush API v2 - Personal API - BETA is now open.

Go see conversation on slack: https://zatech.slack.com/archives/CG4HBE0NB/p1658394442643849 Direct message link: https://zatech.slack.com/archives/CG4HBE0NB/p1660206341114299?thread_ts=1658394442.643849&cid=CG4HBE0NB