Switch & light entity icons not changing color on state change (on / off)

Tags: #<Tag:0x00007f739f019360>

Running on HASSOS 3.11 / HASSIO 0.106.0 on Rpi3b+.

On upgrading earlier today from 0.105.4 the switch and light entities do no longer change color (yellow / blue) on state change (on / off)…

Could this be related to the new features on lights in 0.106?

2 Likes

Yes this is a new feature in 0.106 and not a bug the way around it is to add state_color: true to the entity setting.

1 Like

Maybe an idea to set the default state of this setting to true…

@flyingpenguin Yes I think you can do that in your configuration.yaml file. Also if you have switches that are actually lights change the type to light they are so much simpler to group then.

How would you add that to the configuration.yaml file?

I have not tried it but I think it should be possible under the customize: section
# Add an entry for each entity that you want to overwrite.
Please try and se if it works…

Sofar only got it to work by adding the state_color option in the lovelace card:

- entity: switch.shelly_1_1_relay
        icon: 'mdi:lightbulb'
        icon_height: 40px
        state_color: true
        type: entity-button

Adding state_color as an attribute under customizations for this switch does not make a difference in its behavior.

1 Like

You can’t do that.

There’s a reason for that - it’s the only way you can do it. Really should read breaking changes.

1 Like

This is what my card looks like…

entities:
  - entity: switch.garage_north
  - entity: switch.garage_south
  - entity: switch.entrance
  - entity: switch.wardrobe
  - entity: switch.backyard
  - entity: light.gateway_light_04cf8c97e526
show_header_toggle: false
title: Lights
type: entities
icon_height: 40px
state_color: true

I also changed the icons for the switches in customize.yaml
For example:-

switch.backyard:
  friendly_name: Backyard
  icon: mdi:lightbulb

This does not seem to work for the the filter card. Works for entities card though.

Capture

card:
  title: Lights currently ON
  type: entities
entities:
  - entity: switch.strip_cord
    name: Arc Lamp
  - entity: light.nursery_lamp
    name: Nursery Lamp
  - entity: switch.master_bedroom_light
    name: Master Bedroom Light
state_filter:
  - 'on'
type: entity-filter
show_empty: false
state_color: true

Looks like I have to put the state_color under each entity.

card:
  title: Lights currently ON
  type: entities
entities:
  - entity: switch.strip_cord
    name: Arc Lamp
    state_color: true
  - entity: light.nursery_lamp
    name: Nursery Lamp
  - entity: switch.master_bedroom_light
    name: Master Bedroom Light
    state_color: true
state_filter:
  - 'on'
type: entity-filter
show_empty: false

What am I doing wrong?

type: entities
title: Gunner's Room
entities:
  - entity: switch.shelly_gunner_s_fan_light
    state_color: true
  - entity: switch.gunner_s_lamp
    state_color: true

Expected a value of type `{entity,name,icon} | entity-id` for `entities.0.state_color` but received `true`.