Complex control, how?

Not beein trying much with HA apart from the Community plugins, Node Red etc. I can write some Python (Can code in multiple languages, but very little Python experience)
But now I am in a situation where I need to do some more complex automation.
I want to control charging of my car - How do I get started ? I guess I would have to do some Python - Should I just move everything away from HA, and have it run externally, using MQTT to publish charging status ?

To control charging I have the following inputs I need to take into consideration:
Electricity price (Nordpool integration, every day between 13:00 and 14:00 I get electricity prices per hour). Price is usually positive or in rare cases negative.
Solar Power production + solar power production forecast (sun forecast - Still need good source, have it in my WeatherPro app on iPhone). I sell surplus for market price less 0.18 DKK (But saves all the taxes on re-import/consumption right away).
Power consumption from meter
Weekday charge goal.
EV Charger status
Power cost is calculated net per hour. So 15 minutes at full load, or 60 minutes at 25% is same cost.
If possible when I get my EV, current battery level.
Is there any good free sources of solar power production forecast ?

What I want is that I want to charge my car to 90-100% in the weekend when power is expected to be cheap
During the week, I want to make sure that I always charge to at least 30% remaining battery, at best possible time when I plug car in (typically around 16:00-17:00). HA will see when car is plugged in from the charger integration, as well as how much power the car charges. If I have no battery status from car, I would expect to charge 10-12 kWh per day.
During a day I want to charge at the hours where electricity is cheapest (say 2 hours). Considering both Solar production sell or use, and the often lower price at night.
If I determine it is cheaper to use my solar power, then I would have to make sure I do not use too much. So I need start/stop charging such that I within the hour do not use more than my surplus production.

I guess many people would like such an integration, basically lots of user adjustable inputs, and it should output a charge/no charge state, which can trigger the charger integration.

1 Like

The next release of HA contains an energy management integration, it is very possible that if you get it al set up, the logic behind power price forecasting will be far easier, I am not familiar enough with the integration to know for sure

Great - what release would that be ?

The one from today!