Group behaviour

I have a strange problem. I would really like the “person” object to be able to take input_booleans or binary sensor as part of presence decision, but that is seemingly not possible for some moronic reason. It only can only take device_trackers.
To be able to bypass that problem, I’ve instead created a group for each person in the household, and when one (or more) of the group members is on, the person is home.

The group consist of two device_trackers and one input boolean

erik_hjemme:
  name: Erik Hjemme
  entities:
    - device_tracker.eriks_ifaon
    - input_boolean.erik_gw_home
    - device_tracker.erik_ping

When I hit “Reload groups” in “configuration”, this group is either Home or Away. However, when I restart Home Assistant, this group change to be either On or Off. If I “Reload groups” again, it changes to Home or Away.
What is the reason for this?

Also another maybe unrelated problem; the group behavior is really strange, as the input_boolean in the group is the only one making changes to the group itself. The device trackers’ status does not impact the group state at all. Anyone got a clue?

I think the problem come from the use of two different device classes.
device_trackers are either home or not_home while input_booleans are either on or off.

Can I ask what the reason for the input_boolean is? When would you use it?

Perhaps, but I can not find any documentation stating this is not doable.
The input boolean is controlled by Google Wifi connection via IFTTT webhook.

Andy is correct.

The answer is to use something like an MQTT device tracker that you update with an automation (and templates) or two (no templates). This is exactly how I do it.

Based upon that inflammatory statement I’m expecting then that you’ve got a PR being worked on to address this?

No? Ah well…

1 Like

You can still use the input boolean, but have it set a ‘fake’ device tracker which you can then use in your group using the device_tracker.see service.

No, the device_tracker.see service is deprecated.
I used that before it was deprecated, and it worked great.

I can assure you that it is not.

Sorry, it is apparantly only the IOS companion app the device_tracker.see no longer supports.

But how can I create a “fake” device tracker, without having to do some major workarounds, like installing a MQTT broker and such?

automation:
  alias: Convert boolean to tracker
  trigger:
    platform: state
    entity_id: input_boolean.erik_gw_home
  action:
    service: device_tracker.see
    data_template:
      dev_id: erik_gw_home
      source_type: router
      location_name: "{{ 'home' if trigger.to_state.state == 'on' else 'not_home' }}" 

Creates entity device_tracker.erik_gw_home which is home if boolean is on and not_home when boolean is off.

1 Like

That’s awesome, man! Thanks a lot!
Why is this not documented?! I’ve been struggling with this for ages.

1 Like