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?