Probably something stupid, but I cannot find why line breaks are at the wrong position (also after correction). They should be after each ‘;’… Result is that the tab icons only get the default color (white).
cch:
conditional_styles:
template:
- tab:
- '2':
- icon: >
if (states["sensor.postnl_deliveries"].state <> 0)
"mdi:mailbox"; else "mdi:mailbox-up";
- color: >
if (states["sensor.postnl_deliveries"].state <> 0) "#FFFFFF";
else "red";
- tab:
- alarm:
- icon: >
var alarm = entity["alarm_control_panel.thuis_alarm"].state;
if (alarm == "disarmed") "mdi:shield-check"; if (alarm ==
"armed_away") "mdi:shield-lock"; if (alarm ==
"armed_custom_bypass") "mdi:security"; if (alarm ==
"armed_home") "mdi:shield-home"; if (alarm ==
"armed_night")"mdi:shield-home"; if (alarm == "pending")
"mdi:shield-outline"; if (alarm == "triggered")
"mdi:bell-alert"; "mdi:shield-check";
- color: >
if (states["alarm_control_panel.thuis_alarm"].state ==
"disarmed") "#00FF00"; else "red";
I formatted like below but after saving, reloading and re-opening the text editor it is automatically changed to the format above.
cch:
conditional_styles:
template:
- tab:
- 2:
- icon: >
if (states["sensor.postnl_deliveries"].state <> 0) "mdi:mailbox";
else "mdi:mailbox-up";
- color: >
if (states["sensor.postnl_deliveries"].state <> 0) "#FFFFFF";
else "red";
- tab:
- 'alarm':
- icon: >
var alarm = entity["alarm_control_panel.thuis_alarm"].state;
if (alarm == "disarmed") "mdi:shield-check";
if (alarm == "armed_away") "mdi:shield-lock";
if (alarm == "armed_custom_bypass") "mdi:security";
if (alarm == "armed_home") "mdi:shield-home";
if (alarm == "armed_night") "mdi:shield-home";
if (alarm == "pending") "mdi:shield-outline";
if (alarm == "triggered") "mdi:bell-alert";
else "mdi:shield-check";
- color: >
if (states["alarm_control_panel.thuis_alarm"].state == "disarmed") "#00FF00";
else "red";