lovelace-mushroom icon indicating copy to clipboard operation
lovelace-mushroom copied to clipboard

Person - Greyscale Entity Picture on Away

Open capandcamera opened this issue 2 years ago • 6 comments

Currently within Musthroom, when a person is marked as away the state changes and the icon is amended, However as a fast glance option it would be useful to have the entity_picture apply a filter of greyscale on away

filter: grayscale(100%);

This could be optional for example:

- type: custom:mushroom-person-card
  entity: person.me
  use_entity_picture: true             
  hide_name: true
  greyscale_on_away: true

capandcamera avatar Mar 30 '22 11:03 capandcamera

Is there a way to do this with the card-mod frontend module?

davidcoulson avatar Apr 10 '22 13:04 davidcoulson

I have a draft of this working, but the issue we currently having is knowing which zone is at home, and which zone is away.

The icon for example goes lighter if the entity state is not home, however since a person can also be in a room from the mqtt_room integration, it shows the icon as the lighter colour for this when they're still at home. Applying the same logic here would make the picture greyscale when they're in a room, as their state isn't home.

Unsure how best to handle this one, as it is technically a bug as well

greghesp avatar May 17 '22 09:05 greghesp

My proposal :

  • if state is away or unavailable : grey-scale
  • if state in home or zone : colored

I don't think we should split zones into 2 types (not home/home). The passive zone options can be used to exclude zones you don't want to be considered as home.

piitaya avatar May 17 '22 10:05 piitaya

My proposal :

  • if state is away or unavailable : grey-scale
  • if state in home or zone : colored

I don't think we should split zones into 2 types (not home/home). The passive zone options can be used to exclude zones you don't want to be considered as home.

Right now, the grey-scale icon is shown based purely on if state === home

Should be a simple logic change, but this does mean that if you're in the zone labelled as office as per the dev container, you'll be showing in colour, not grey scale, even though you're not home?

I can make the PR if you're happy with that flow?

greghesp avatar May 17 '22 10:05 greghesp

Yep but you are in a known zone. 😅

piitaya avatar May 17 '22 10:05 piitaya

I will give some tests. Zones entity contains a person list. What happen if you define a zone inside the home zone ? 😅

piitaya avatar May 17 '22 10:05 piitaya