this is so cool. I've been attempting something similar recently. My idea was to use a Java program (I'm more familiar with Java), and I called into HA to get the values. Then I tried to simulate what would happen over the day with expected solar generation and usage. One difference here in the UK is that I have Octopus Agile import tariff, which means every 30 minutes the price changes. Sometimes the price can be negative, and at other times it can be very expensive. My current model tries to simulate [charge,discharge,do_nothing] for each time slot and estimate the best possible return. However, this usually flattens the battery as it's looking to maximise profit. This is also quite cpu intensive as I have to calculate several million possibilities.
I love this level of AI usage. AI has helped, and your HA works even smarter. It's a great level of nighttime home entertainment. :) Thanks for sharing!
This is something i've been trying to do for several years (optimise when battery is charged based on next day forecast and predicted load) Awesome idea to use AI. Would you consider writing this up in a blog format so others with less AI knowledge could try to "follow along" ?
Interesting approach. I have realized excess-energy charging two electric cars with a function in node-red. The function I programmed in JAVA together with ChatGPT. It does what it should except to some small problems when connecting a car and updating status correctly. This is mostly due to the node-red function being retriggered on every data input. On the other hand I have very easy input smoothing there. Like smoothing out solar fluctuations and so on. I have it running continously for adjusting the car charge-power though. I think that makes a lot of sense and really makes sure that clouds don't make the car charge from the battery during the day. Also I added a couple of practical buttons like "override charge" for each car, and a number to set the override-charge power, so that I can push a button and the car of choice charges whenever I want it, no matter where the energy is coming from. Also a button "night charge" which charges the car of choice to a limit value with a specified charge power. In case I need a fully charged car the next day. What I didn't integrate at all are your ideas about the cost of the battery-energy and scheduling according to weather. I'll look into that. But I had never heard of App-Deamon before and now I will probably tell GPT to take my JAVA script and move it to python. Thank you for that input! The smoothing I may still do in node-red though. I will have to see how easy it is in python. I'd certainly make it a long running script though. Not just triggered every 15 minutes.
I have been working with GPT to create some amazing out of my stations in my home that I would have never have been able to do on my own. This is truly an amazing tool
I was thinking to build a similar solution, but with the automation implemented as a finite-state-machine, because our events/needs are crazy asynchronous. It would be nice to give a look at the prompt you used, just to eventually catch some inspiration. Great video, as usual!
I have also become addicted to using AI to write my HA automations. AI has changed my concept of "good enough". It's not terribly difficult to say, "please rewrite this to consider if my wife is home alone on a Tuesday in July and needs to dry her hair before our usual date night which always starts after 4pm on days when there is no rain because I will be playing golf with my friends with a 12:30 tee time, unless I have something else on my calendar in the afternoon on that day. I always need at least an hour to get ready after my last appointment". Copy...Paste...Enjoy Date Night!!
Very Cool. An Inspiration! like many I want to manage the solar and Grid power, home load etc also. Here down under I only have (like you) high & low grid tariffs, no Electric car charging but desire to manage house load better, ie heat pump Cooling and Heating, and simpler other load to you. I might have to give this AI thing a whirl... :) Great Video, as normal. thanks for sharing.
the problem with generative Ai is that you cannot relay on its results... genAi nature is to provide you slightly different solutions each and every time. you can play with "temperature" model parameter, which makes it more strict in responses. but on the current level, it is nightmare to debug this. I believe it is much convenient to write script for that purpose. by utilizing simple logic you can program most of your scenarios. and it will give you stable and expected results
This is why I do not use LLM to do the actual control, but to develop the automation that then works consistently. It might not work right out of the box, this is why I was showing how I tuned that in Cursor. And hey, it works. And it is generally a good start, I can always (let it) rewrite the pieces that do not work exactly the way I want.
That's quite a good example. Can Home Assistant modulate the charging speed of your car (to let the pump run at the same time when the PV power isn't great)?
@@bruxy70 I probably didn't pay attention enough but does the script do it? Have you measured the efficiency of charging at different powers (I believe a lower charging speed isn't always more efficient as the air conditioning pump is running for longer...on cars that use air conditioning during charging)
@@NicksStuff Yes, the script is setting a helper with the charging power. You are right about the efficiency. The script does not deal with it. OTOH, when charging from PV I kind of do not care. And when it charges from grid it charges full power.
this is so cool. I've been attempting something similar recently. My idea was to use a Java program (I'm more familiar with Java), and I called into HA to get the values. Then I tried to simulate what would happen over the day with expected solar generation and usage. One difference here in the UK is that I have Octopus Agile import tariff, which means every 30 minutes the price changes. Sometimes the price can be negative, and at other times it can be very expensive. My current model tries to simulate [charge,discharge,do_nothing] for each time slot and estimate the best possible return. However, this usually flattens the battery as it's looking to maximise profit. This is also quite cpu intensive as I have to calculate several million possibilities.
I love this level of AI usage. AI has helped, and your HA works even smarter. It's a great level of nighttime home entertainment. :) Thanks for sharing!
This is something i've been trying to do for several years (optimise when battery is charged based on next day forecast and predicted load) Awesome idea to use AI. Would you consider writing this up in a blog format so others with less AI knowledge could try to "follow along" ?
Interesting approach. I have realized excess-energy charging two electric cars with a function in node-red. The function I programmed in JAVA together with ChatGPT.
It does what it should except to some small problems when connecting a car and updating status correctly. This is mostly due to the node-red function being retriggered on every data input. On the other hand I have very easy input smoothing there. Like smoothing out solar fluctuations and so on. I have it running continously for adjusting the car charge-power though. I think that makes a lot of sense and really makes sure that clouds don't make the car charge from the battery during the day.
Also I added a couple of practical buttons like "override charge" for each car, and a number to set the override-charge power, so that I can push a button and the car of choice charges whenever I want it, no matter where the energy is coming from. Also a button "night charge" which charges the car of choice to a limit value with a specified charge power. In case I need a fully charged car the next day.
What I didn't integrate at all are your ideas about the cost of the battery-energy and scheduling according to weather. I'll look into that. But I had never heard of App-Deamon before and now I will probably tell GPT to take my JAVA script and move it to python. Thank you for that input!
The smoothing I may still do in node-red though. I will have to see how easy it is in python. I'd certainly make it a long running script though. Not just triggered every 15 minutes.
I have been working with GPT to create some amazing out of my stations in my home that I would have never have been able to do on my own. This is truly an amazing tool
I was thinking to build a similar solution, but with the automation implemented as a finite-state-machine, because our events/needs are crazy asynchronous. It would be nice to give a look at the prompt you used, just to eventually catch some inspiration. Great video, as usual!
I have also become addicted to using AI to write my HA automations. AI has changed my concept of "good enough". It's not terribly difficult to say, "please rewrite this to consider if my wife is home alone on a Tuesday in July and needs to dry her hair before our usual date night which always starts after 4pm on days when there is no rain because I will be playing golf with my friends with a 12:30 tee time, unless I have something else on my calendar in the afternoon on that day. I always need at least an hour to get ready after my last appointment". Copy...Paste...Enjoy Date Night!!
Lol
Very Cool. An Inspiration! like many I want to manage the solar and Grid power, home load etc also. Here down under I only have (like you) high & low grid tariffs, no Electric car charging but desire to manage house load better, ie heat pump Cooling and Heating, and simpler other load to you. I might have to give this AI thing a whirl... :) Great Video, as normal. thanks for sharing.
Wow what a challenge you have made, really exciting, well thought out
the problem with generative Ai is that you cannot relay on its results... genAi nature is to provide you slightly different solutions each and every time. you can play with "temperature" model parameter, which makes it more strict in responses. but on the current level, it is nightmare to debug this. I believe it is much convenient to write script for that purpose. by utilizing simple logic you can program most of your scenarios. and it will give you stable and expected results
This is why I do not use LLM to do the actual control, but to develop the automation that then works consistently. It might not work right out of the box, this is why I was showing how I tuned that in Cursor. And hey, it works.
And it is generally a good start, I can always (let it) rewrite the pieces that do not work exactly the way I want.
@bruxy70 and you know what? this is very good approach!
That's quite a good example. Can Home Assistant modulate the charging speed of your car (to let the pump run at the same time when the PV power isn't great)?
Yes, I have a wallbox integration that can change the maximum charging power between 1.4 - 11kW
@@bruxy70 I probably didn't pay attention enough but does the script do it?
Have you measured the efficiency of charging at different powers (I believe a lower charging speed isn't always more efficient as the air conditioning pump is running for longer...on cars that use air conditioning during charging)
@@NicksStuff Yes, the script is setting a helper with the charging power. You are right about the efficiency. The script does not deal with it. OTOH, when charging from PV I kind of do not care. And when it charges from grid it charges full power.
Hey this is really cool. I actually have my workigns that solar energy costs £0.15/kWh as that's its static sale value!
Ahoj, Vaclave. Skvele video, diky za nej. V puvodnim promptu bylo u bazenove pumpy neco jako TEMPERATURE / 2. Proc? Jsou tam dve pumpy?
Nene, to je nějaká empirická hodnota. Čím teplejší voda, tím dele filtruji. O pul hodiny ma stupeň vice. Tak nějak to vychází.
First ha. Keep it up bud.