Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Amend person card logic to allow for room presence #353

Merged
merged 2 commits into from
Apr 22, 2022
Merged

Amend person card logic to allow for room presence #353

merged 2 commits into from
Apr 22, 2022

Conversation

greghesp
Copy link
Contributor

@greghesp greghesp commented Apr 17, 2022

Fixes #348

I've adjusted the logic so that if the presence is "not_home", that is the only way the "not home"/home-export-outline badge icon can be shown.

It should then continue and check for zone icons, and will then default to the home icon.
Should users like myself use custom device_trackers which combine home/away presence as well as room presence within the home, they will get the correct device badge icon

@greghesp greghesp changed the title Amend login to allow for room presence Amend person card logic to allow for room presence Apr 17, 2022
@piitaya
Copy link
Owner

piitaya commented Apr 20, 2022

How do you track using custom device_trackers ? Can you provide example of state of your person entity?

@greghesp
Copy link
Contributor Author

greghesp commented Apr 21, 2022

How do you track using custom device_trackers ? Can you provide example of state of your person entity?

I need to double check my logic on this again, as I found a bug in my device tracker.

What I've done is created a custom device_tracker entity that essentially looks at the person entity to see if they're home or away, and then the sensor entity from the mqtt_room integration.

If their person entity is home, then it will push the room location to the device_tracker.see command, otherwise it'll push the location from the person entity

@greghesp
Copy link
Contributor Author

I've amended the push, and have also added some examples to the HASS demo for reference

@piitaya
Copy link
Owner

piitaya commented Apr 21, 2022

I don't understand. What is the state of your entity ? Device tracker and person entities can take home, not_home and zone names as state.
If you want the icon of your zone, just set an icon from Home Assistant settings.

@greghesp
Copy link
Contributor Author

greghesp commented Apr 21, 2022

device_tracker can accept any state, like zones. Not just home or not_home. So if you're using room detection, you can use the see service to set a device trackers state to say 'Living Room'

The issue is that if you're using a beacon for room presence,. The current code sets the icon as the away icon rather the home icon. I've changed that so it defaults to the home icon and colour, but does the home and zone check first

https://www.home-assistant.io/integrations/device_tracker/#device-states

@piitaya piitaya added the enhancement New feature or request label Apr 22, 2022
@piitaya piitaya merged commit 55a11a7 into piitaya:main Apr 22, 2022
@briandonahue
Copy link

I'm using the icloud3 device tracker and it's put people in the "Stationary" zone when you are outside the house but not moving for a period. In the person card this shows the home icon which is confusing. Would be nice if it could recognize statrionary as "away". I realize this may be unique to this tracker, so not sure what the best way to handle it would be...

@TravisWilder
Copy link

I have the same issue - it is not very nice this way

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
enhancement New feature or request
Projects
None yet
Development

Successfully merging this pull request may close these issues.

Person Card - Away icon logic incorrect
4 participants