3D table-type entity (data in X, Y, Z) for use in electric vehicle charging automation (like a charging curve)

I have been using HA to charge my electric cars from SoC X to SoC Y, depending on the charging current configured in the Wallbox, through timings, since the JLR integration no longer works on HA (and practically all known APIs).

Electric vehicles have different charging curves and therefore take longer or less time to go from SoC X to SoC Y depending on the charging current/power as well as effectively the value of SoC X and SoC Y, i.e. the charging time, for example from 20% to 30% at 10A is different from 40% to 50% also at 10A or charging from 20% to 40% at 10A is different from half the charging time from 20% to 40% at 20A.

This part was just to put into context why I wanted to do this…

So, I thought I’d create a table where one of the axes is the starting SoC (SoC X) and the other is the final SoC (SoC Y) and at the intersection of each row and column, I’d have the time (in minutes or seconds or something like that) that the car takes to charge from SoC X to SoC Y… It would then be a normal table, with 101 rows and 101 columns (counting the headings).

To make the subject more complex, this table would have several “sheets”, or a “cube” if you want to think in 3D, in which each sheet would be the variable of the charging current or power, i.e. sheet 1 would be, for example, these values for a charge at 6A, sheet 2 would be the values for a charge at 7A and so on (possibly between 6A and 32A in 1A increments).

At the end of the day, I wanted to create a entity in the Home Assistant, which would be this cube filled with this information that is nothing more than the quantification of a vehicle’s charging curve, but in numbers.

The ultimate goal would be to create an automation that takes the car’s current SoC (SoC X), takes the desired SoC (SoC Y), takes the charging current/power and returns the charging time required for that action (i.e. the number in the x,y,z coordinates of this “3D table”.

How can I put this 3D table into the Home Assistant so that it can be consulted when programming an automation?

At the moment I use a basic, linear fĂłrmula to calculate the charging time, but sometimes it ends up higher than I want and sometimes lower (because of the variation depending on the initial and final SoC and current/power of charge).

Based on the experience I have with each real charge, I wanted to fill in (or manual change thought time) this 3D table so that the automation would read it each time it had to create a timer.

I hope I haven’t been too confusing. In my head this all makes sense, but I realize it’s hard to visualize.

I’ve explored the HA auxiliar entities and I can’t find any that I can create to support this idea. I’ve also explored Google Sheets integration (I could create the table in Google Sheets), but apparently it’s only for send info to Google Sheets and I can’t read anything from there (and what I want is to read the value of the x,y,z coordinate of this 3D table of mine). I’ve explored the Home Assistant Database concept, but I couldn’t figure out how to do it with a database (how to write it and then access it in automation).

I’m out of ideas and could use some help.

It seems to me to be a very interesting concept that can be used for many other functions and developments.

I appreciate you taking the time to read my challenge and I’m all ears for any help you can give. Even if you don’t think it solves the problem, you can give me “directions” on where to look and explore and I’ll do it.

1 Like

I am sure that there will be suitable libraries in python that will work for your custom configuration.

I suggest you stop trying to tack things on using spreadsheets and the like, and concentrate on proper python programming.