Replies: 2 comments 10 replies
-
Ooh, this is very interesting. Thank you for all your hard work on this. I agree Jinja templating code is counter-intuitive, what bit I’ve done is lots of trial and error. Some questions:
Super, looking forward to incorporate into my own predbat forecast |
Beta Was this translation helpful? Give feedback.
7 replies
-
Beta Was this translation helpful? Give feedback.
3 replies
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
-
Hi all,
It's been a bit of a mission (templating has been possibly the least intuitive programming challenge I've taken on in living memory...), but I'd like to share a wee contribution: here is a home assistant template to predict heat pump demand from forecast temperature. It grabs the hourly forecast temperatures for the next 24 hours from the Met.no integration, and converts that to a predicted energy demand for use in Predbat's Load Forecast input based on a curve fit to data which you'll need to gather for your own house & heating.
Here, I've plotted my Vaillant system's total (heating + DHW) daily energy consumption against the daily average outdoor temperature, then fitted a quadratic curve to it. (I think it's probably important to have a dataset with consistent underlying settings, hence my somewhat reduced dataset here (made some big heat curve/scheduling changes a month or so back) - will probably update the coefficients in due course once this has been filled out a bit more.)
You will then need to put the coefficients into a, b & c (from line equation y = ax^2 + bx + c) in the template code below, and add this to your configuration.yaml file.
This is working for me (can see the effect in Predbat’s load forecast column), by adding the following lines at the relevant place in Predbat’s apps.yaml:
(The final part I'd like to add would be to update the state from its placeholder timestamp to show the total forecast energy (i.e. the sum of the hourly_energy values, or the final value in the incr_energy_list). Suggestions on how to achieve this welcome!)
Hopefully this is helpful to someone!
All the best,
Jo
Beta Was this translation helpful? Give feedback.
All reactions