Hi All,
Apologies if this may seem long. I have a light entity which is driving me absolutely crazy and I’ve no idea why it’s doing this. Bit of background story I’ve recently changed all of my lights from localtuya to tuyalocal. All of the lights have added absolutely fine but I have one which is causing me some issues.
My son has a galaxy lamp which exposes 3 entities, switch.star_lamp, light.laser and light.background. He has already set the colours he needs etc so switch.star_lamp is the only one I need. I have changed “show switch as” to a light which creates a light.star_lamp entity. On my dashboard I have a counter for each room to show total number of lights on. This is done by expanding the area which light.star_lamp is a member of and counting total devices on, this part is working fine.
icon: >-
{{ 'mdi:lightbulb' if expand(area_entities('rhys_bedroom')) |
selectattr('domain','eq','light') | selectattr('state','eq','on') |
list | count > 0 else 'mdi:lightbulb-outline' }}
Now this is where the fun begins. The icon can also be used to toggle all lights for that area on / off via the below code.
tap_action:
action: call-service
service: light.toggle
target:
area_id: rhys_bedroom
The light just will not react when using light.turn on, light.turn off and light.toggle via area, if how ever I use the entity for these it will turn on/off/toggle.
Does anybody have any idea why it is doing this behaviour? The fact the light is counted within the counter shows to me it is being picked up under the correct domain within the correct area id.
I just can’t see why it’s not working.
Thanks very much.