Hide tracked device when away not working

I have seen a number of posts around this subject but they don’t seem to offer a solution to the problem.
I am tracking our iPhones to establish presence. This works fine. However, I would like to hide the device/person when not at home.

It says here that the trick is to add

hide_if_away: True

to configuration.yaml.

That’s what I did but it still not makes the device go away. (Using lovelace with latest HASS.IO) How does it work?

Actually that setting goes in known_devices.yaml, not configuration.yaml.

1 Like

Hmm, tried that but that doesn’t make my devices go away either.

That’s what I have in known devices:

nameofdevice:
  icon:
  mac: 74:DA:38:02:00:04
  name: namehere
  picture: /local/pic.png
  hide_if_away: true
  track: true

Did you restart HA? This file is only read on startup.

Yes, I did. Even did a full restart but it still shows the “Away” devices.

When you say “shows”, what exactly do you mean? On the map? In the frontend, and if in the frontend, are you using Lovelace or another custom UI?

FWIW, when I used this feature the devices no longer showed up on the map, nor in the frontend. (I’m using 0.77.2, and I’m not using Lovelace or any custom UI.)

The plot thickens! I tried it both with Lovelace and without and with the normal user interface the away device doesn’t show up, with Lovelace it does.

Has anyone gotten it to work with Lovelace?

Sounds like a bug that needs reporting.

Although, can’t you set this within lovelace itself making the known_devices option superfluous?

It is devices that I want to show or not based on the presence detection, so I don’t want to remove them permanently.

Yeah, I know, but isn’t there like a ‘conditional’ in lovelace?

“I want this device to be on this card unless it’s in a certain state then don’t show it”

Edit -

Yes, that seems to be it but it seems I am too confused to put the code together.

This is what I have right now:

title: Home
views:
  - title: default_view
    cards:
      - type: entities
        entity: device_tracker
        title: Who is home?
        entities:
          - device_tracker.name1
          - device_tracker.name2
          - device_tracker.name3

Now, I want to only show the device trackers when the state is “Home”.

So I would do:

title: Home
views:
  - title: default_view
    cards:
      - type: conditional
        conditions:
          - entity: device_tracker.name1
            state: "Home"
          - entity: device_tracker.name2
            state: "Home"
          - entity: device_tracker.name3
            state: "Home"
      - type: entities
        entity: device_tracker
        title: Who is home?
        entities:
          - device_tracker.name1
          - device_tracker.name2
          - device_tracker.name3

But this doesn’t work. Any suggestions?

1 Like

I haven’t played enough with lovelace yet to help on this, sorry, hopefully somebody else will chip in and give you a hand :slight_smile:

Anyone ever figure this out? I like to have my family always show and show home or away and friends to disappear when they have left. Worked fine till Lovelace

I don’t know if this is this relevant. But the conditions are an AND statement. So you need to include OR otherwise the card will only show when all 3 devices are at home

Did you get it working? I have the same problem, but can’t figure out what is wrong.

No, I didn’t.

@sapnho Use an entity filter card. The example shown on the page is exactly what you are looking to do.

```
type: entity-filter
entities:
  - device_tracker.demo_paulus
  - device_tracker.demo_anne_therese
  - device_tracker.demo_home_boy
state_filter:
  - home
card:
  type: glance
  title: People at home