The Future of the Bayesian Integration - Thoughts wanted

I am working on a UI set up - it will come with time

4 Likes

In my Search around Bayesian sensor adding to person entity I bumped into this post. @HarvsG any thoughts on the possibility to make it available for the person entity hence it improves presence/person detection.

Combining bayesian with the person would make Automations (for me) less vulnerable to false positieves or device malfunctions (simply replace tracker linked to person.x instead of changing al entities in several automations.

Ooo, think is an interesting and good point.

I’m not sure what the entity filter is on the person entity

Edit: it seems that it is filtered for device_trackers only and I’m not sure of a built-in way I could optionally turn the Bayesian sensor into a device tracker.

In the meantime there is some discussion of doing this with an automation here that you might find helpful:

It relies on a little know action device_tracker.see which allows one to manually change the state of a device_tracker.

If you find a simple, elegant and ideally blueprint able way of doing this then I could add it to the Bayesian Docs.

1 Like

This is quite an old thread (I see the number of active installations is down to 254 since it started :slightly_frowning_face:) and things have probably (heh) moved on, but…

I use the integration quite a lot (without, I confess, understanding much of the theory) and I find that one of its limitations is the fact that the HA sensors it generates are binary - which seems counter-intuitive, given you’re trying to decide whether something is probably true.

In practical terms, the probability attribute is extremely useful and the integration would benefit from making it a sensor in its own right.

For room-level presence detection, for example, I have a Bayesian entity for each room and a template which compares their probability attributes and picks the highest. This compensates for phones being left in the other room, dogs triggering motion sensors and all the other stuff that makes binary presence detection go wrong.

Just a thought…

2 Likes

Not sure if it’s a good Idea when the bayesian is fed by the Same device_tracker that is going to be changed by the .see action

Yes, I agree with this. Especially as the probability could be converted into a binary sensory with the aid of a threshold helper.

However it would be a big breaking change to switch this. So I think the solution in future is going to be to create a template sensor from the probability attribute. I believe these can now be blueprinted, so my plan is to make an official blueprint and add it to the docs.
See this PR Add template blueprint for Bayesian by HarvsG · Pull Request #130376 · home-assistant/core · GitHub

I expect the user base to pick up once the Config Flow UI PR is merged

3 Likes

@hastaboera No that is not a good Idea.
The idea would be to create a new device tracker and create an automation that couple the state of Bayesian sensor to the new device tracker using the .see action.

1 Like

I really like the idea of this. But it seems to me that it needs to be a component of something else. I am a developer and have two computer Science degrees so I am OK putting it together. I would think that most HA users just want it to work. For example, I have sensors of various sorts throughout my house. I could use the Bayesian Integration to calculate the probability of my wife or me being in each room. I could then combine the to specify which room I am in.

Maybe a blueprint would work for this. I have used blueprints but not delved into creating one. I will have to investigate this.

2 Likes

As the template sensor now (and has for some time) supported actions, you could also use that to call device_tracker.see based on changes in the binary sensor whilst also implementing logic that mimics the ‘consider_home’ behaviour

Exactly this - I extract this with a template sensor for all my Bayesian Sensors

It would have to be quite complex to handle all the observations correctly - I’ve been using a spreadsheet to do it and it still takes a lot of thought.

Edit: The spreadsheet comes from here:

1 Like