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
Unable to use the workday integration for next days values in additional costs. #357
Comments
The easiest way i can think is to check if utcnow and now is the same date. The integration patches now so it always in the context of the current hour. So if the day isnt the same its tomorrow. |
Does that mean that the additional cost template is evaluated per hour and takes date into account? If that is the case I suppose my template should work as intended? |
Ah, no, it does not work. |
Or does |
https://github.com/custom-components/nordpool#additional-costs Yes, its patched so it always refer to the hour for the price. |
Instead if a static list of holydays you can use https://github.com/partofthething/next-holiday-sensor |
Oh, the list is not static, it is dynamically provided by the Holidays integration (https://github.com/bruxy70/Holidays). It seems it does much of the same as the one you suggest? |
Yeah. All you need just a sensor that has a holiday attribut. The example i provided has dict of all holydays so you can format the datetime to a str and use a .get and check if the value is not None. |
Please post your solution so other can reuse it if they face the same issue. |
Sure! :-)
I've also posted it in the HA community forums (HA Foums) and at Hjemmeautomasjon.no (Hjemmeautomasjon) |
Version of the custom_component
0.0.14
Homeassistant version
2023.12.0b1
Configuration
Describe the bug
I am using the workday integration to determine if today is a holiday or not, as this defines one level of the additional cost here in Norway. This seems to work as expected in the provided template for additional costs, but I cannot find a way to provide the nordpool integration with an additional workday sensor for tomorrows prices.
Debug log
The text was updated successfully, but these errors were encountered: