Back when I started with HA, I posted a feature request for doing a ‘not’ operator on state_filter.
I can see it can be done in a Entity Filter Card (it has the != operator way), even the conditional in picture entity card has it. Has it been implemented in state_filter for picture entity, and just me that can’t figure it out, or is it still missing?
The reason is that I have set up several zone’s in HA, and I’ve made a state_filter for ‘not_home’ to apply a grayscale to the picture, it works perfectly as long as the zone is ‘undefined’, ie. set to not_home but if it shows something else like ‘Mall’ or ‘School’ or something else it doesn’t apply the filter (of course).
So I can make extra template sensors for this to be true for home, and false for anything else, but it seems like overkill to do that, or I can include all the zones in a state filter, but either way, it is silly.
According to the examples, it should be possible to add a filter for the standard picture, but I’m unsure if I can revert that for a state. Furthermore it doesn’t seem to apply to the picture at all.
So far I’ve tried this.
This doesn’t work, it is never grayscaled.
aspect_ratio: 100%
entity: person.nathalie
hold_action: none
image: /local/images/person_nathalie_home.jpg
show_name: false
show_state: false
filter: grayscale(100%)
state_filter:
home: grayscale(0%)
tap_action: none
type: picture-entity
This way it doesn’t show ‘away’ if the zone is something else than ‘not_home’
aspect_ratio: 100%
entity: person.kenneth
hold_action: none
image: /local/images/person_kenneth_home.jpg
show_name: false
show_state: false
state_filter:
not_home: grayscale(100%)
tap_action: none
type: picture-entity