I deployed it in Node-Red and lo and behold it worked.
The eventual plan is that a solar installation can be controlled by expected weather in the coming days. (I have no idea how to do that yet, but I suppose getting the weather forecast data to work with is half the battle).
Now when I say it worked, it was 2 hours time-shifted. So I modified the code ever so slightly for ZA.
I attach the modified ZA file. (Flow). It is in Notepad format and the text should be imported from the Node-Red Clipboard.
Edit: For some reason I cannot attach a text file, so copy the following post in its entirety.
No, this didn’t work properly either.
I think the Zip file in the previous post is working though.
Edit: It is, don’t forget to add your own Long. Lat & API key in the “settings” node.
I am looking forward to someone who is a bit more familiar than me with Node-Red making a flow that will base a charging/usage profile on expected weather.
I have a feeling that the wind direction may be coded for the Northern hemisphere.
North and South may be flipped.
Remember a wind is called after its origin and not its destination.
Just a thought to ponder on, Paul crafted a NodeRed section that adjusts the inverter wattage based on solar production, by using what is drawn from the battery as a guide.
@TheTerribleTriplet Yes, Paul seems like an advanced user.
Although the approach as you’ve described sounds reactionary. I was thinking more along the lines of postponing loads in advance of bad weather or conversely scheduling loads when good production is expected. Sort of proactionary.
Incidentally, there are a number of ESKOM load-shedding Node-Red flows to be found on the web. I thought that this and the weather forecast flow could be combined to tailor a dynamic usage pattern.
Sadly though I think the ESKOM API is no longer functional.
I have one weather feed installed, pretty decent but comparing it against Accuweather at times, or the Wife’s weather predictions, the predictions vary all the time as with all predictions relating to weather.
Hence me thinking that ± 30sec to a minute could have fewer “debates”.
The challenge that I found with that approach ( I have tried that as well ) is that , here in the highveld , the weather can be perfect and the next moment you will have a thunder storm. Or you will have that high cumulus clouds that comes over.
You are also heavily reliant on the accuracy and availability of 3rd party provider to manage your loads.
The battery watts tends to be a fairly accurate predictor of the weather and on some loads I have a trip as well. So if the battery w are going to be -1000w while the geyser is one for three times in an hour disconnect the script and restart tomorrow.
What I love about all of this is that there are so many options around.
There is a solar forecaster built into Home Assistant that I use with my Node Red Flows to decide whether to switch my pool pump on in the morning with. I use Node Red as a plug in for HA which makes things a load simpler.