Closed notabene00 closed 5 years ago
You can handle that yourself
${states['light.ls1'] ? states['light.ls1'].state === 'off' ? 'mdi:led-off' :
'mdi:led-on' : 'mdi:led-off'}
Oh, okay, thanks. So, it is expected behaviour?
OR, I like this better
${!states['light.ls1'] || states['light.ls1'].state === 'off' ? 'mdi:led-off' : 'mdi:led-on'}
You are in control of your own destiny. If your entity might be unavailable, do a check before you try to access it's elements to be safe
I have something like this:
And when
light.ls1
is not available, the whole card is not displaying. There is something about template processing inside oficon:
, I think. Because if I remove the line with template, the whole card appears back again.