Bayesian sensor as device tracker

Hi, is there a way to get the bayesian binary sensor to behave like a device_tracker. Such that it’s sates are home/not_home and is reflected as such in the UI ?

Thanks

See here for my implementation of Bayesian sensor for presence detection. You can find an explanation here.

1 Like

Thanks, I saw this from other thread but my question was how this can behave more like a device tracker device rather than a binary sensor. In fact, I’ve based my sensor on your example :).

You will have to write a custom component for that. Essentially opposite of what @abmantis has done here.

You can use a template sensor…

sensor:
  - platform: template
    sensors:
      james_home:
        value_template:
          "{% if is_state('binary_sensor.james_home', 'on') %}
          home
          {% else %}
          not_home
          {% endif %}"
        friendly_name: James

Then you’d need to replace binary_sensor.james_home with sensor.james_home in groups or pages to show in the gui (binary sensor itself will still display on/off, only the new sensor will display home/not_home)

The only drawback with this is when clicking on sensor.james_home it won’t show the binary sensor history graph

2 Likes

This is great. Thanks for your help

1 Like

Now there is a better way for that:

binary_sensor:
- platform: bayesian
  device_class: presence
1 Like