ngardiner / TWCManager

Control power delivered by a Tesla Wall Charger using two wires screwed into its RS-485 terminals.
The Unlicense
130 stars 55 forks source link

[Feature Suggestion] Weather API integration to e.g. delay charging on next day being sunny #243

Open GMerg opened 3 years ago

GMerg commented 3 years ago

It would be great if we could somehow integrate a weather forecast into the scripting. We would be able to use them in the policy scripting and e.g. define to only "charge now" if next day isn't sunny, else wait and charge tomorrow. That would safe a lot money if you are producing your own energy.

MikeBishop commented 3 years ago

A straightforward way to add this might be a module that isn't actually leveraged from the core code, but could be used in policy restrictions. For example, if there were an OpenWeatherMap module, you could then add a restriction to Scheduled Charging that caused it to only activate when cloud cover was forecast for the following day.

GMerg commented 3 years ago

Yes, that souds perfect. I really would like helping with that but my phyton knowlage is still limited. I can do some research if thats needed...like what API to call and how to get the data wanted.

MikeBishop commented 3 years ago

I know from previous projects that it's hard to find a free/cheap-for-individual API that's sufficiently local to make these decisions on. Dark Sky was nice, but it's being EOL'd. OpenWeatherMap is probably the best choice for new work, IIRC.

EricE commented 3 years ago

Another possible option though very new: https://www.reddit.com/r/homeassistant/comments/lwkidx/for_anyone_using_the_soon_to_shut_down_dark_sky/

GMerg commented 3 years ago

We could also use e.g. OpenWeatherMap as a PseudoInverter that gives back the kW value based on the current weather condition. That way it will work with ANY solar system (not as accurate as with a real inverter interface, but better than nothing).

Needed to configure :

Coding work:

Having this as an extra module is of course better for policy scripting, but for people without being able to access there Inverter easily, an alternative.

GMerg commented 3 years ago

I have now written a module with my limited python knowlage: https://github.com/ngardiner/TWCManager/issues/262