-
Notifications
You must be signed in to change notification settings - Fork 19
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Component not starting up #11
Comments
Hi @ipodmusicman, Unfortunately this is the same issue that was raised earlier today in #10. The Eskom API seems to be having some issues (note how it always returns a result of -1) and there isn't much that I can do on the integration side to remedy it. I may be able to refine the startup procedure a bit, but the integration itself will still be broken until Eskom sorts their API out. |
Yes, it is not related to 2021.5 - the failure started this morning at around 5:41am, and I was then still on 2021.4.x. |
Doesn't -1 mean a loadshedding stage of 0 ? Edit: Can you set the sensor to stage 0 when we receive -1 or 0 or 1 from the Eskom API endpoint? Will fix the integration for now. I think the -1 means eskom have like a 1000MW reserve or something. It shouldn't cause the integration to stop working. |
So to explain the edit: stage 0 = Eskom meets demand So essentially, the eskom api is not currently broken, but the integration is broken for not taking this into account. The integration should set the loadshedding stage entity to 0 when the API responds with -1 or -2 or -3 etc. |
Or rather, if the -1 really mean the site is broken, at least let the integration start up, with a stage 0 or whatever the last stage was in the recorder. |
@tinuva I will look into this change. I have definitely seen cases in the past where the API will return For now I will probably still have the integration attempt to retry if a state of This means that the integration will only be |
Yeah I think you are correct, sometimes the -1 happens while loadshedding is active. Annoying right now haha. |
@tinuva When I was still referring to the URL in a curl command, no loadshedding is 1, stage 1 is 2, etc. I agree, if it returns -1 after a couple of retires, return 0. Just a pity that there aren't any other APIs out there where you can coincide the stage with the actual schedule. |
I have pushed a fix and a new version with this change, please check it out and confirm that the stage goes back to 0, then we can close this issue 👍 The integration will still take a few seconds to start as it needs to run through all of the API attempts before giving up and returning 0. |
Version of the custom_component
1.0.3
Home Assistant Version:
2021.05
After upgrading to 2021.05, the component is just not starting up. I turned on debug logging for this component as below:
logger:
default: info
logs:
custom_components.eskom_loadshedding: debug
These are the only log lines I found whereby the component is mentioned.
2021-05-06 20:01:30 INFO (MainThread) [homeassistant.setup] Setting up eskom_loadshedding
2021-05-06 20:01:30 INFO (MainThread) [custom_components.eskom_loadshedding]
Eskom Loadshedding Interface
Version: 1.0.3
Welcome to the Eskom Loadshedding Interface!
If you have any issues with this you need to open an issue here:
https://github.com/swartjean/ha-eskom-loadshedding/issues
2021-05-06 20:02:01 WARNING (MainThread) [homeassistant.bootstrap] Waiting on integrations to complete setup: eskom_loadshedding
2021-05-06 20:03:02 WARNING (MainThread) [homeassistant.bootstrap] Waiting on integrations to complete setup: eskom_loadshedding
2021-05-06 20:04:02 WARNING (MainThread) [homeassistant.bootstrap] Waiting on integrations to complete setup: eskom_loadshedding
2021-05-06 20:05:02 WARNING (MainThread) [homeassistant.bootstrap] Waiting on integrations to complete setup: eskom_loadshedding
2021-05-06 20:06:23 ERROR (MainThread) [custom_components.eskom_loadshedding] Error fetching eskom_loadshedding data: Error, invalid loadshedding stage received from API after 50 attempts
2021-05-06 20:06:23 DEBUG (MainThread) [custom_components.eskom_loadshedding] Finished fetching eskom_loadshedding data in 293.107 seconds
2021-05-06 20:06:23 WARNING (MainThread) [homeassistant.config_entries] Config entry 'Home' for eskom_loadshedding integration not ready yet: None; Retrying in background
I uninstalled the integration, installed it back, no luck whatsoever.
I even called https://loadshedding.eskom.co.za/LoadShedding/GetStatus from within my browser and it returns a result.
I hope that you'll be able to assist.
The text was updated successfully, but these errors were encountered: