swartjean / ha-eskom-loadshedding

Fetches loadshedding data from Eskom
Apache License 2.0
70 stars 18 forks source link

Unable to add "Area" on Integration setup #34

Open geeneo opened 1 year ago

geeneo commented 1 year ago

Home Assistant : VM Home Assistant 2023.5.3 Supervisor 2023.04.1 Operating System 10.1 Frontend 20230503.3 - latest

Integration stopped working. removed and try to reinstall.

Unable to load areas.

image

Log

Traceback (most recent call last): File "/usr/src/homeassistant/homeassistant/helpers/entity_platform.py", line 455, in async_add_entities await asyncio.gather(*tasks) File "/usr/src/homeassistant/homeassistant/helpers/entity_platform.py", line 731, in _async_add_entity await entity.add_to_platform_finish() File "/usr/src/homeassistant/homeassistant/helpers/entity.py", line 845, in add_to_platform_finish self.async_write_ha_state() File "/usr/src/homeassistant/homeassistant/helpers/entity.py", line 585, in async_write_ha_state self._async_write_ha_state() File "/usr/src/homeassistant/homeassistant/helpers/entity.py", line 652, in _async_write_ha_state attr.update(self.extra_state_attributes or {}) File "/config/custom_components/eskom_loadshedding/sensor.py", line 120, in extra_state_attributes time_updated = datetime.strptime(stage_updated, time_format) TypeError: strptime() argument 1 must be str, not None

JaredZA11 commented 1 year ago

Getting the same issue

swartjean commented 1 year ago

Thanks for the feedback @geeneo @JaredZA11, will take a look ASAP.

swartjean commented 1 year ago

Unfortunately I wasn't able to replicate in either HA 2023.5.3 or 2023.5.4. Could you share exactly which area you were attempting to search for when the error popped up?

The fact that the error was raised here "/config/custom_components/eskom_loadshedding/sensor.py", line 120 makes me doubt that this is a configuration issue - HA was trying to get state attributes from the sensor which should only happen if the sensor already exists.

@JaredZA11 do you have version information and an error log you can share?

JaredZA11 commented 1 year ago

Issue turned out to be on my side. ESP API thinks I'm trying to abuse and blocked me.

JossPer0 commented 1 year ago

Hey, how did you manage t find out that they were blocking you? I am having the same issue

JaredZA11 commented 1 year ago

Error logs in HA said "attempted abuse" of free licenses. Feedback from ESP was to leave it for a few days and it would resolve (which it did)

On Wed, 31 May 2023, 15:59 JossPer0, @.***> wrote:

Hey, how did you manage t find out that they were blocking you? I am having the same issue

— Reply to this email directly, view it on GitHub https://github.com/swartjean/ha-eskom-loadshedding/issues/34#issuecomment-1570295416, or unsubscribe https://github.com/notifications/unsubscribe-auth/AP5SBXFMR4C6DQ2O6IN6IGLXI5FF7ANCNFSM6AAAAAAYMDQ5P4 . You are receiving this because you were mentioned.Message ID: @.***>

JossPer0 commented 1 year ago

Awesome thanks

LeonvanHeerden commented 9 months ago

I think I have the same issue. My connection was working. I am trying to setup Node-Red as well now and thought I should just register a separate API key for that until I am happy that it works. I have disabled the Node-red instance yesterday, since it was not working and then noticed my main connection is now not working. Trying to re-create the instance and failing, I found this post.

So do I also just have to leave it for days or is there a way to request an unblock. EDIT: curl --location "https://developer.sepush.co.za/business/2.0/status" --header "token: API_KEY" Result shows exactly what is described above and that it may be unblocked after 24 hours. Will have to wait and see.

Then I assume I should be using the same API key for both Node-red and the HA to prevent his in future?