Netatmo noise measurement to identify guests in home

Hi,

I would like my HA (v0.89.1) to identify guests in my home depending on my indoor noise level. I have a Netatmo weather station that report the decibel value in sensor.netatmo_indoor_noise. When I’m not home, or a sleep, the noise level is below 38db (pretty accurate) and when someone is home the noise is normally above 38db (peaks).

To do this I have made a binary sensor with the following code in configuration.yaml:

binary_sensor:
  - platform: template
    sensors:
      netatmo_guests:
        friendly_name: "Netatmo Guests"
        device_class: presence
        value_template: "{% if states('sensor.netatmo_indoor_noise') >  '38' %}true{% else %}false{% endif %}"
        delay_off: '00:20:00'

In HA config dashboard (http://IP:8123/config/person) I have created a Netatmo Guest person, but unfortunately I can’t use my binary sensor as device that HA tracks. The popup menu says “Invalid format”.

I’m stuck here… Maybe someone can point me in the right direction?

Yeah, I raised this issue already here: https://github.com/home-assistant/architecture/issues/163#issuecomment-469932794

According to @balloob you can create an automation to call the device_tracker.see service based on your sensor, and influence a devices state. I haven’t messed with it yet.

Maybe look at the Bayesian component and combine other sensors with your noise level.
This will remove false alerts as well (imagine: thunderstorms, dogs barking, car subwoofers, etc).

@NK553 Thanks for the info! Using device_tracker.see as @ballob says works :slight_smile:. Run it with “dev_id”: “binary_sensor_name” and
“location_name”: “home”. First time it’ll create the device in known_devices.yaml. Then make two automations to set it home/not_home.

@rtv Bayesian sounds a bit complex. I live on the countryside so cars and dogs etc is not a problem. But you’re probably right regarding bad weather. :stuck_out_tongue_winking_eye: