Automatic learning based on input and predefined items?

Hi all, I have a thought in my head, not sure even where to put it on the forum.
I am in process of automating the windows blinds based on lux value and sun position. Since it requires a lot of fine tuning, I suddenly had a vision that I would like to share and discuss, perhaps inspire someone more creative to come with more suggestions.

Simple scenario: adjusting lights in a room based on lux item (ideally multiple values).

Instead of me making bunch of if/else rules around lux item, I could give openhab command “learn blinds now based on lux item”, and I would set the desired value of the lights myself, and openhab would pick up my lux value and create some rule on that. And make some (linear?) formula of lux values in regards to my desired values.

This could be perhaps logged somewhere, where I could make switch cases later, but not having to manually write down all the values during the day?
Maybe this is even solved somehow? Or are google and amazon working on this with most powerful AI and I am just oversimplifying it?


Would like to hear of anybody who thinks he can contribute to this.

I have had mostly the same idea, written down here. But noone took the ball so far.

1 Like

yeah, sounds about right :slight_smile: I was on some conference where on a workshop we used a machine learning on a spotify playlist and music genres. I didn’t understood much of it to be honest, but it is “all about” the data set and info, as you mentioned, probably Nest and others are working like this.

I would be very happy with a simple “replicate these values” for start, something similar to google calendar scheduler openhab already has. Perhaps something like this could be used to at least visually help the user get the interesting values? Perhaps this is already very easy data to get from graphana now that I think about it, by simply comparing relevant items…

Look at Digital Twins and Machine Learning.

A simpler non-learning approach might work though.

You need persistence set up on your Items that need to interact with one another. Then use Presence Simulation to play it back after you’ve recorded the states.

What this will do is record all the state changes that take place on the Items into the database. Then one week later, it reproduces all of the recorded state changes. This would work well for adding events. Deleting them gets a little more tricky as you would have to remove the event from the database.

It’s not ideal but it could get you 80-90% to where you want to go.

thanks @rlkoshak that is very close to what I was thinking. Only thing is that this would play back based on time, whilst I would like to play it back based on related items (when lux between 100-200 set light 35%, when lux 200-400 light 55%, when lux over 10.000 lights 0% etc…). I am imagining grafana can visually show some relation like this and that I can manually get these values from a graph, even if that means that manually writing the rules is the only way to go.
I will install grafana and start using the data more analytically (maybe even default graph engine could be used for getting the overview).

What I am imagining now in my head as a perfect input interface could be one graph where you can show data from relevant items (f.eks. two lux sensors), and then one line on the graph where you adjust the desired one (light). Thinking of it like curves in photoshop or curve in sound equalizer.

The system would then try to fallow the graph and somehow calculate the desired output for your lights. So it doesn’t have to be that smart, graph input with simple threshold would do it for this scenario (same could be applied for heating, window blinds, all sort of lights etc)