Skip to content
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

Could not find active peak #2

Closed
drooff opened this issue Feb 8, 2022 · 13 comments
Closed

Could not find active peak #2

drooff opened this issue Feb 8, 2022 · 13 comments

Comments

@drooff
Copy link

drooff commented Feb 8, 2022

I just installed this integration and it isn't able to retrieve the current peak information, suggesting maybe the webpage layout has changed. My utility was listed properly during the setup of the integration, but the sensor value is never populated.

Error log:

This error originated from a custom integration.

Logger: custom_components.ontario_energy_board.api
Source: custom_components/ontario_energy_board/api.py:101
Integration: Ontario Energy Board (documentation, issues)
First occurred: 12:41:50 PM (10 occurrences)
Last logged: 1:27:22 PM

Could not find active peak. Perhaps the webpage layout has changed

Thanks for building this, if it works it saves me a lot of time and effort doing it the hard way with utility meter and tariff components!

@kwkid
Copy link

kwkid commented Feb 8, 2022

droff:
Your comment regarding the utility meter caught my eye. Based on my experience with this component it simply reports on the $ kWh rate charged during the appropriate timed tiers…the utility meter still plays a role and perhaps the integration component in calculating the daily and monthly $ consumption values.
I guess you can have an automation trigger on the state of this component..if you capture the old and new values you can calculate your consumption based on the kWh change over the period…perhaps I am missing something in how this component was intended to be used…can you share your insight on how you intend to use this…

@jrfernandes
Copy link
Owner

Unfortunately, it appears that that the OEB site no longer includes a page indicating the current peak. That didn't last long :/

The rates are still being pulled successfully, as it's part of their Open Data initiative. As for getting the current rate, we will need a new method to get that. I might take a shot at it during the weekend.

@jrfernandes
Copy link
Owner

droff:
Your comment regarding the utility meter caught my eye. Based on my experience with this component it simply reports on the $ kWh rate charged during the appropriate timed tiers…the utility meter still plays a role and perhaps the integration component in calculating the daily and monthly $ consumption values.
I guess you can have an automation trigger on the state of this component..if you capture the old and new values you can calculate your consumption based on the kWh change over the period…perhaps I am missing something in how this component was intended to be used…can you share your insight on how you intend to use this…

@kwkid - the way I'm using this component is with the Home Assistant's Energy monitoring functionality, where you can assign this sensor with any energy monitoring attribute you add there. It works great and no need for any automation or tariff settings madness as before.

@drooff
Copy link
Author

drooff commented Feb 9, 2022

As for getting the current rate, we will need a new method to get that.

Looks like Alectra posts the current peak and rate on their site: https://alectrautilities.com/time-use-pricing

@jrfernandes
Copy link
Owner

The problem with that is that they're updating the value of that element via JS on the client-side. The HTML will always have mid-peak hard-coded.

@maxshcherbina
Copy link
Contributor

@jrfernandes
Might be best to hard-code the peaks in ourselves at this rate and maybe scrape the holiday chart linked below to know when its 100% offpeak. Or hard code in those holidays as well?
https://www.oeb.ca/consumer-information-and-protection/electricity-rates/time-use-holiday-schedule

@jrfernandes
Copy link
Owner

jrfernandes commented Feb 11, 2022

@maxistviews - I thought about hard-coding it, the problem is that the on-peak and mid-peak periods switch during winter time. I didn't research if it's always the same time of the year or not, but it will definitely make things tricky, especially when odd events happen, like when in 2020 Ontario applied a 24-hour fixed rate.

I do however have an idea on how to get the current peak leveraging the site of one of the hydro companies. We should have this working again this weekend.

@maxshcherbina
Copy link
Contributor

maxshcherbina commented Feb 11, 2022

Great to hear it! Definitely looking forward to it :)

I think as a safety measure fallback, I will hard code a sensor myself and then use it only if this integration fails again ;) The OEB website makes it pretty clear that summer and winter time periods have consistent peaks, so I'll use that for my sensor.

Id be surprised if we'd get the 24 hour period again as that was just to do with the lockdown measures. But holidays that fall on weekends would need to be something to add to a hard coded sensor.

@jrfernandes
Copy link
Owner

I remember reading that when holidays that fall on weekends the following Monday will be off-peak. Should be confirmed.

Though, I do like the idea of having a fallback in case integration can't reach the EOB or other website. I might include something for that as well.

@jprasm
Copy link

jprasm commented Feb 11, 2022

Hi, I'm not able to get any data for Toronto Hydro (residential). My sensor says "unavailable":
sensor.toronto_hydro_electric_system_limited_residential_rate

@jrfernandes
Copy link
Owner

This issue should now be solved and the sensor is working once again.

@maxistviews - I took your advise and just added logic to figure out the current peak without scrapping the web.

@kwkid
Copy link

kwkid commented Feb 12, 2022

Life is good...Thx for resolving the issue. Much appreciated

@maxshcherbina
Copy link
Contributor

That's fantastic, thank you! :)

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

5 participants