Table for generating values\variables - and tables for storing multiple values,variables

TL:DR I need to store hundreds of values in a table, with time\hour on the x axis, and dim level on the y axis

I am coming from the world of engine tuning and I am missing using tables with x y factors to pick out a value.

In the engine world the ECU uses a table like this to decide the correct fuel amount dempending on manifold pressure (amount of air) and engine speed (rpm) to get the correct fueling for every moment.

The table essentially produces a variable, depending on external conditions (rpm and air pressure)

I would like to have a similar table in homey, to create a variable that can be used in flows.
For now, lets call this new type of variable a “table variable”

Imagine the view in Advanced Flow, where the entire table is put in as big “flow card” - where you can edit the tables values, and what should be on the X and Y axis.

Use case 1: Different dim levels according to hour of the day.
Here we could create a “table variable 1” with hours of the day on the x axis, and actually nothing on the y axis. The table will then have one numeric value from 0-1 for each of the hours of the day.

When I use a flow to set “dim level bathroom” to variable “table variable 1” - the homey will look up the value to get in the table, according to which hour we are in.

This use case is easily solved with an advanced flow - I understand that - It would amount to 24 When “time is” cards, and 24 then “dim to level” level cards. Easily solvable as advanced flows work now.

Use Case 2 - Dim level according to hour of the day, and week of the year.

We create “table variable yeardim”
It has the week of the year on the y axis, and the hour of day on the x axis.
I can now plot in 1248 different values into one singe “table variable”

When we set dim level to “table variable yeardim” it will retrieve the value according to hour of day, and week number.

You can enter the 1248 different values by hand - but a better solution is to use the “set variable” function - and automatically enter the set dim level to the table as the year progresses.

An example of this would be to set “table variable yeardim” to “dim level bathroom” - when the week number is 52 and the hour of the day is 18:00-19:00 the value at that intersection in the table would be changed.

This way, with “table variables” we can handle a large number of values without creating hundreds of different variables for every thinkable hourerly and weekly time. And in the second use case we get a sort of “learning” dimmer - so that everytime it is trigger by a motion detector we can more accurately set the dim level out lives - and every time my wife changes the dim level with the physical switch the table will change, and it will therefore be more accurate the next time.

I think there probably are more interesting use cases, like maybe different colors depending on time of day and outside temperature,

Or perhaps setting thermostat temprature depending on time of day and energy price - here you could have a higher setpoint (more comfort) when the price is low when you are home, and lower setpoints for lower prices, but only during times it is less important.

This will empower advanced flow users, and seems like a small step up in what we can do with our home automation systems. One that can bring us onwards from reactive systems, towards more adaptive and learning systems.

What other use cases can you see this being applied for? and do you think it will be useful?

2 Likes

Second that request. :+1:

It was my question to Athom to make it the new Friday project.

With dynamic energy prices you need also a lot of data.
Plans are to go to for every 15 minutes a new price.

Also reading in JSON data would be nice.

I’m new here, what’s the friday project?

And i have no idea what Json is, but what would be the benefits? I’m genuinely curious :grin:

On Friday they may working on own idea’s.
The last one was the Dashboard what now is in official beta status.

JSON (JavaScript Object Notation). Like:

{"status":"true","data":[{"datum":"2024-11-06 06:00:00","prijsEGSI":"0.395819","prijsEOD":"0.394090","prijsAA":"1.256981","prijsAIP":"1.292071","prijsANWB":"1.243491","prijsBE":"1.259391","prijsEE":"1.311251","prijsEN":"1.256631","prijsEVO":"1.243491","prijsEZ":"1.244381","prijsFR":"1.262189","prijsGSL":"1.243491","prijsMDE":"1.243491","prijsNE":"1.243381","prijsVDB":"1.291001","prijsVON":"1.264281","prijsWE":"1.269081","prijsZG":"1.243491","prijsZP":"1.264381"}],"code":"5"}

For more information you can look on Google.

1 Like