Persons Component to Include Binary Sensors

I have quite a few Binary Sensors that I use to track mine and my wife’s status. I think it would be awesome if I could include those in the Persons Component as well.

I second that, especially as I think the current handling with device-trackers is not usable (see “Bug”) report. Last device tracker change deciding on home / not_home is leading to false results.

With binary sensor support, we could even use the Bayesian sensor, which include prioritisation for devices.

i would also like to see binary sensors and device_trackers that have been grouped to be included.

groups
wifi_and_bluetooth_tracking:
name: wifi & bluetooth trackers
entities:
- device_tracker.adamsiponexsmax
- device_tracker.adamsaplewatch4
- device_tracker.adams_iphone_xs_max

gps_tracking:
name: gps all trackers
entities:
- device_tracker.***********************
- device_tracker.********************************
- device_tracker.tile****************************************

person:

  • name: Adam
    device_trackers:
    • group.gps_tracking
    • group.wifi_and_bluetooth_tracking

This is something I also would like to see added. The most reliable and quickest presence detection I use is the SmartThings presence binary_sensor. It’s almost always the first to indicate I’m actually home.

This is exactly what I need. My router doesn’t have a device_tracker component, but it does have its own cloud component that is able to ping IFTTT when a device joins or leaves the network. I’ve implemented a binary_sensor for it, but I have no way to add it to my “person”.

:heavy_plus_sign::one: I was just about to submit a feature request for this when I noticed this post! My primary device tracker is posting updates via MQTT and I’m using a binary sensor to track presence.

I thought about this a little bit and looked at the code to see how difficult of an enhancement it would be. The problem I see is that the binary sensor component would also need to be updated to allow a presence binary sensor to be associated with a particular zone. It can default to the main zone if there is only one, but in the case where a user has multiple zones, the person component would need to know where the “present”/“On” state is being triggered in order to manage the location state of the person.

As far as I can tell, there is no special handling for binary sensors of a particular device class, so any change to support this would have to be thought out carefully to ensure it would extend cleanly for other device class specific future integrations.

Not necessarily. My “Ping” device tracker only has two states; “home” and “not_home”. The Person component would just to need to interpret a binary sensor’s “on” state as “home” and its “off” state as “not_home”.

I was thinking about this again and realized that this can be achieved via an automation that calls the device_tracker.see service to set the state of a fake device which can then be referenced in the Person component. I haven’t tested this, but this would be the basic structure:

automation:
  - alias: 'Mark device tracker as home'
    trigger:
			platform: state
			entity_id: binary_sensor.paulus, binary_sensor.anne_therese
			from: "off"
			to: "on"
    condition:
      condition: template
			value_template: "{{ (state_attr(trigger.entity_id, 'device_class')) == 'presence' }}"
    action:
      service: device_tracker.see
      data_template:
				dev_id: "{{ trigger.entity_id }}"
				location_name: "home"
	- alias: 'Mark device tracker as not_home'
    trigger:
			platform: state
			entity_id: binary_sensor.paulus, binary_sensor.anne_therese
			from: "on"
			to: "off"
    condition:
      condition: template
			value_template: "{{ (state_attr(trigger.entity_id, 'device_class')) == 'presence' }}"
    action:
      service: device_tracker.see
      data_template:
				dev_id: "{{ trigger.entity_id }}"
				location_name: "not_home"

That’s actually not a bad idea. I should probably look into doing similar. Good call.

Apologies for jumping onto an old post. Did anyone find a why to add smartthings binary sensors to Persons as device trackers?

Sorry to dig up an old post. Did anyone find a working solution?

I basically have my cats setup with a people profile in HA. clearly, unless they are hiding it from me that both of my cats don’t have mobile phones. However, they are set up on on their Cat flap which uses a binary sensor.