Picture entity for "Home" / "Away" Status

Hi there,

I’m using some Profile Pictures for the HA users - and I have included them into a Picture entity for displaying the stauts of the person (Home, Away, in another zone)…

While this is working quite well, my initial Idea was that the picture should be greyed out / greyscale - when the person has left the “home” zone… but this does not happen.

Can someone pls. help me, what I need to change in order to get this done?
The picture should only be in color, when the person has entered the zone “home”

show_state: true
show_name: true
camera_view: auto
type: picture-entity
entity: person.christoph
image: api/image/serve/bd2fb006ed082246d9c425e2d1cb0dad/512x512

Instead of using just the image: option, use the state_image: or state_filter: option. https://www.home-assistant.io/dashboards/picture-entity/#state_image

E.g. usning the state_filter option:

show_state: true
show_name: true
camera_view: auto
type: picture-entity
entity: person.christoph
image: api/image/serve/bd2fb006ed082246d9c425e2d1cb0dad/512x512
state_filter:
  "home": grayscale(0%)
  "not_home": grayscale(100%)

Or using the state_image option:

show_state: true
show_name: true
camera_view: auto
type: picture-entity
entity: person.christoph
state_image: 
  "home": "/local/img/some_colour_image.jpg"
  "not_home": "/local/img/some_grayscale_image.jpg"
1 Like

thanks :slight_smile:
I’ve tried the “state_filter” but it seems, that greyscale will not be applied if the person has entered another zone (for example, workplace…) ?

I will check how it’s looking when my wife is leaving her workplace today…
Or do I need to translate the filter text?

It should work, see this post: Location not_home vs away - #6 by petro

So I guess if it isn’t working you’ll have to list all your other zones you want it grey for. e.g.

state_filter:
  "home": grayscale(0%)
  "not_home": grayscale(100%)
  "work": grayscale(100%)

thanks,

this is how it looks in the setup atm:

so I am in the “home zone” while my wife is not…

I just edited my post.

Ah! This is why: Location not_home vs away - #10 by petro

You do have to list all the zones for a person, but not for a device tracker.

Thanks again :slight_smile:
I’ve added the Zone Name “mwk” to her card, since this is how the zone is called, but it does not work either…

I’ve tried to crosscheck and set the greyscale to 100% for “home” on my picture, which did work…

So… following the post you replied, it should work with “not_home”… could this be a bug then?

Yeah but that was for trackers. Not persons.

Look in Developer Tools / States. What is the state of your wife’s person entity now?

Including capital letters. Letter case is important in Home Assistant.

The state calls “MWK” which I have added into the filter, but without any effects

Try

grayscale(100%)

Instead of:

greyscale(100%)

woops…
but it didn’t change anything.

Anyway - I think, I’ll keep it as it is…
I think the most important visual effect applies only, when someone isn’t in a defined zone…
Since I am using only a few zones (home of friends and family), and our local train station to trigger some automations which I haven’t done yet…

But yes, it seems that other zone names don’t apply to the grayscale atm…
I will check the behave when she’s away… and report back :slight_smile:

Yeah sorry I’m out of ideas.

Maybe someone else can help or confirm that this is actually a bug, in which case it should be reported. There’s one open for state filters with the picture elements card:

thanks :slight_smile:
I’ll wait and see if someone else might comment on this as well

Hi @tom_l,
I think, we’re really running into a bug here.

My wife has now left her working place and is on the way home.
The state of the “person” is shown as “not_home” - but the image isn’t greyed out.

Again, when I change the “state_filter” to “home” and grayscale=100% on my own picture while I am at home, this is working.

grafik

grafik

EDIT:
I don’t know, why I have still “greyscale” in the yaml for her picture… just noticed it… :-/ Thought, I’ve already corrected this.

1 Like