My Renault and Tibber


I’d like to setup a “optimal charging” algorithm with tibber and the my Renault app/API for Home Assistant.

I’d need to define those parameters:

  • target charging level, e.g.80%
  • deadline to reach level, e.g. 8 AM (the next morning)

Then when the charger (just a 3.7kw charger that is dumb and not remote controllable) is plugged in and the car is at home, I’d like to calculate how many hours I need to reach the target level. That is easy by calculating (target_level - current_level) * battery_capacity / charging_power where battery_capacity=22kwh and charging_power=3.7kw. This is not 100% correct but by doing it every hour again it should be “good enough” - especially at those low charging power.

Then I’d need to identify the cheapest hours from now until the deadline and make sure I’m charging at those hours. Either by

  • sending a defined charging cycle plan to the car (those plans are limited though)
  • turning on and off charging by switching between “charge now” and “charge at a plan that is never”.

My biggest concern there is that the Renault API is very unreliable with my Twingo ZE. I’ve doubt it does proper retrying.

But the more straightforward idea to control the charging by turning on and off a Shelly plus 1 PM “in front” of the charger does not work since powering on does not wake up the Twingo and thus the charging does not start.

Maybe that Shelly is helpful nevertheless since it can check if I’m actually charging (by measuring the power independent of the car).

Did anyone do something like that around the Renault API? If so, how exactly? Did it work? Any hints on how to best implement such an algorithm?