-
Notifications
You must be signed in to change notification settings - Fork 19
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
Hide indicator when value 0 and entity unavailable #149
Comments
It is har to tell but my guess is that you should check if the value is equal to |
just for reference. In my first post I showed the wrong code snippet. this is the right one for the plug indicator:
so I already did hide the icon if the value is 0. like here This is working correctly if the plug is off. I think I have to add to this code snippet or statement to also hide when it’s unavailable or 0 but I don’t know this type of syntax to add or statements. |
try |
Thank you very much, I’ll give that a try Edit: It is working as expected. You can close the issue. THX |
I tried to hide an indicator when value is 0 and it’s working.
This entity I’m using is a simple power plug and it’s sometimes disconnected so the entity is sometimes unavailable.
is it possible to hide it when value is 0 AND entity is unavailable? I can’t get it to work.
My actual code looks like:
battery: icon: template: '(value) => (value === ''off'' ? ''mdi:battery-low'' : ''mdi:battery-high'' )' style: '(value) => (value === ''off'' ? {color: ''#FD5901''} : {color: ''#008083'' })' source: values: 'off': Voll 'on': Leer entity: binary_sensor.buro_damian_thermostat_batterie mapper: value => this.source.values[value]
My card looks like this when entity is unavailable (mobile):
I want to hide that „turbo“ icon when it’s unavailable.
The text was updated successfully, but these errors were encountered: