I want to have a card visible to everybody BUT me. It seems to be impossible without a hacs download. There are already AND and OR operators; why not just add NOT?
Here’s an example: I was trying to make a custom card that is only visible to guests, which to me means, anyone who isn’t me or my partner. I didn’t want to have to select everyone but me or my partner, because if someone else gets an account or if I make a generic guest account I have to adjust this. I guess I could make another guest dashboard or something, but I want to be able to have this individual functionality for my cards so I don’t have to remake an entire dashboard. I understand this is minor, but it’s because it’s minor that I think it’s an easy adjustment to make.
My example:
(blurred for privacy)
It’s also just frustrating that there are already OR and AND operators but there isn’t a NOT operator. That would just round out all of the operators
Another example is a chip card I wanted to make for when our car is not home, that just shows an empty garage icon. So I would want to make the condition, when car entity state != home, make visible. But instead I had to make a switch and if it IS = off (car is not in garage) then it’s visible. This just feels clunky to do and have yet another helper for a one off use case.
Thank you all for being so welcoming and eager to understand my issue. Love this community, and if I’m just missing something or If anyone has any better suggestions I am all ears.
I agree.
Being able to enter a template from the UI would be an option too, albeit not as accessible for a new user. I wonder if you can use a template in YAML…
I agree a NOT
operator would be handy.
Just wanted to make sure you know about the state_not:
parameter for conditions in conditional cards and rows. You can often accomplish what you want with that.
- type: conditional
conditions:
- condition: state
entity: sensor.bathroom_speaker_next_alarm
state_not:
- unknown
- unavailable
row:
entity: sensor.bathroom_speaker_next_alarm
name: "Active Alarm"
format: datetime
How can this be used in my situation if you’re willing to elaborate. I’m afraid my understanding of YAML is pretty limited.
Creating a generic guest account probably easiest for example one?
Example 2
I had to make a switch
Why? What is your car entity? Device tracker?
There is nothing wrong or clunky with this.
- condition: state
entity: device_tracker.car
state: not_home
Also, the state_not
parameter is available in the UI.
Here’s that same condition from above done in the UI.
I’m not sure if this clears it up, if the car is in a zone that is like “office” the state no longer equals “not_home” I guess I could use an or for each of the locations, but I not would be easier I think.
If the state is “Office” it is not equal to “home”. If the state is “Away” it is not equal to “home”. If the state is anything other than “home”, the state is not equal to “home”.
state_not: home
or “State not equal to” to “home” in the UI.
You don’t need the switch.