[plan : charging smart]

Let me introduce a first model of how I’ll build a smart charging algorithm. I will have to add one or two new methods for accessing statistical data but besides that, I think I’m already well set. In short: let’s take excess energy depending on the predicted use for the current times. Overriding to quickly charge with maximum energy should also be possible of course.

First model of an smart charging algorithm.

In the graphic you see one entry point. This represents the manual call for either starting smart charging or starting with a specified ampere number or stopping the charging. On the left side of it there is the trigger every five minutes, just like the ‘rough’ statistics are triggered in smartics. Basically, the two following routes exist: smart charging or fixed ampere number.

  1. smart charging enabled
    • I use the last 5 minutes of data: produced energy minus energy consumption = excess energy (this times 12 to get the Wh and divided by the voltage to get A)
    • The last 14 days of data I use to get the average percentage of excess energy a day: produced energy minus energy consumption = does enough energy exist to charge smart or do we need to overshoot anyway? This will be mainly used to round up or down defining how autonomic we are. It will be highly dependent on the weather due to the season of the year!
    • As threshold of when to actually charge I chose a minimum value of 2A of excess energy available (over the last 5 mins). This will then trigger charging with (for my 1-phase charger) 6A to a maximum of 16A.
    • The states set to the charger are: activate/deactivate, set color (by energy mix), set ampere.
    • What could be included (but can also be indirectly gotten by the average daily energy) is the predicted energy needed by charger each week (which itself can be replaced as soon as I also have statistic data for the charger)
  2. fixed charging with specified ampere
    • Enabling will set the specified ampere and activate charging. Besides that the default color will be sent to the charger. Disabling sends the deactivation.

Before any sending to the charger the state of the charger will be checked on the smartics database to keep updates to the charger to a minimum. The five minutes between automatic checks (if smart charging is enabled) will also lead to more stable charging states.


There is actually a bit of data needed to be stored additionally in the database for the charger. I will also implement statistics for the charging cycles – but more to that at a later point. Currently needed are:

  • mode: smart, fixed (unfortunately I cannot use anything on the go-e charger for that)
  • current ampere set (to prevent unnecessary checks of charger state)
  • voltage used (maybe fixed to 230V for now, as that is used around here in Austria)
  • average use a week (optional, to be calculated at later time)

I think with that I’m good to go and implement that algorithm next time. This definitely makes it more interesting to integrate some feedback from the car (via OBD). It screams basically for a: km/charge/autonomy graph. I will certainly think about that.

— Raphael


Leave a comment