Does Bayesian use historic sensor data?

@HarvsG, to what extend does the Bayesian integration take historical data from sensors into account? I have my motion sensors set pretty short, because I only want it to trigger on actual motion. But a motion twice or more within a certain period will certainly increase probability of something going on. I can’t find anything in the documentation or elsewere how the Bayesian integration handles this.

Looking at the source code, I see that it is reacting on upcoming changes but not taking into consideration what happened before defining the sensor.

Of course, with upcoming changes, it is refreshing its internal state and storing it and using it for further calculations.

So, it does not look like relying on recorder / history.

What happened before the sensor is of no concern. But it should increase probability if multiple events from the same sensor happen within a certain time. From the documentation it seems to me it only takes into account the ‘on’ or ‘off’ status and forgets about it after. But it could be implied in the baysian algorithm, i don’t know.

No, it is taking these into consideration and updates the probability and stores the new values into storage. But it is reacting to upcoming events not to historical ones

Can’t you use a helper or template sensor to detect this, then use that as an observation in the Bayesian integration?

The Bayesian integration can only look at the current state, it doesn’t know or care about previous states or frequency of state changes.

If you want to make it care I’d use templates which bayesian supports. Access the last_updated or last_changed attributes, right at the bottom of the documentation there’s a similar template included in the documentation.

Tnx for the reply. I’ll look into it.