IOIIOOO
(Jason Cross)
June 2, 2020, 6:57pm
1
I have two workshop hanging lights controlled by MQTT wifi smart plugs. These are grouped together currently.
group:
workshop_lights:
name: Workshop Lights
entities:
- switch.workshop_east_hanging_lights
- switch.workshop_west_hanging_light
icon: mdi:ceiling-light
On my dashboard, I have these showing where I can switch them on and off, but I’d also like the icon to change when turned on to be yellow like the “lights” that are on. Is there a way to do this?
tom_l
June 2, 2020, 7:08pm
2
Use the state_color option in your Lovelace entities card:
entities:
- entity: group.workshop_lights
state_color: true
- etc...
IOIIOOO
(Jason Cross)
June 2, 2020, 7:35pm
3
Ok, when I do:
entities:
- entity: light.living_room_lights
- entity: light.front_patio_lights
- entity: switch.jasco_products_12722_on_off_relay_switch_switch
- entity: light.jason_office_lights
- entity: group.workshop_lights
state_color: true
- entity: switch.jasco_products_12720_outdoor_smart_switch_switch
title: Lights / Power
type: entities
I get:
Expected a value of type {entity,name,icon} | entity-id
for entities.4.state_color
but received true
.
IOIIOOO
(Jason Cross)
June 2, 2020, 7:42pm
4
Ok, along that path I changed it to:
entities:
- entity: light.living_room_lights
- entity: light.front_patio_lights
- entity: switch.jasco_products_12722_on_off_relay_switch_switch
- entity: light.jason_office_lights
- entity: group.workshop_lights
- entity: switch.jasco_products_12720_outdoor_smart_switch_switch
title: Lights / Power
state_color: true
type: entities
This still gets an error: Expected a value of type undefined
for state_color
but received true
.
The weird thing is that some devices that didn’t change color before now do, but this one doesn’t.
How about a light group instead, might behave differently?
You’d need to make the switches lights as well, presumably.
IOIIOOO
(Jason Cross)
June 2, 2020, 7:55pm
7
I don’t think I can make these into lights as they are smart plugs. I believe they were discovered as switches automatically.
tom_l
June 2, 2020, 7:57pm
8
That does look like a bug.
You can make light entities based on switches:
petro
(Petro)
June 2, 2020, 8:01pm
9
Are you using the GUI? If yes, this is a warning (yellow = warning) not an error. You’ll notice that your switches will now be yellow when on.
petro
(Petro)
June 2, 2020, 8:10pm
11
what version are you on?
Working on latest on an entities card
IOIIOOO
(Jason Cross)
June 2, 2020, 8:35pm
12
Yours is using a switch entity directly. Mine was using a group. There appears to be a bug with groups not updating the state_color.
BTW, I made light entities out of the switches, grouped them as a light group, and it works great now.
petro
(Petro)
June 2, 2020, 8:37pm
13
Groups have more than on/off states, they have never worked with state_color. Groups can have home, not_home, sensor values, zone names, on, off, as states.