Service "light off" turns light on

Hi,

I have opened a GitHub issue already https://github.com/Koenkk/zigbee2mqtt/issues/21879.

I have a script which fully closes some blinds and turns off the remaining lights. However, for some reason, one light group (a lamp with three bulbs) always get’s turned on when this script is called and the lights are out. Strange thing is, in HA all lights of this group remain off and the lights are very dimmed. Maybe 10% brightness.

This is the script:

alias: Schlafen
sequence:
  - alias: Sud_1
    if:
      - condition: numeric_state
        entity_id: cover.sud_1
        attribute: current_position
        above: 1
    then:
      - service: cover.close_cover
        data: {}
        target:
          entity_id: cover.sud_1
    enabled: true
  - alias: West_1
    if:
      - condition: numeric_state
        entity_id: cover.rollo_west1
        above: 1
        attribute: current_position
    then:
      - service: cover.close_cover
        data: {}
        target:
          entity_id: cover.rollo_west1
    enabled: true
  - service: input_boolean.turn_on
    data: {}
    target:
      entity_id: input_boolean.schlafen
    enabled: true
  - service: light.turn_off
    target:
      entity_id: light.licht_obergeschoss
    data:
      transition: 3
mode: single
icon: mdi:chat-sleep-outline

Maybe someone has a clue?

You could add a condition to only call light.turn_off if the lights are on…

Yeah, I thought about this as well, but I am trying to understand the problem and if this is code related, or maybe indeed something with a misleading zigbee signal.

I somehow do not want to delete the lights from the whole group just to have it fixed in this single script.

Is this a zigbee group?
If you issue turn on/off commands manually to the devices and the group itself, do they all respond properly?
Is this something that happens every time you run just this script?
Can you try toggling the light/lights from Z2M dashboard and see if it does the same thing?

Also, can you try to remove this from the script and see if it has the same behavior? Not all bulbs like transitions.

Yes, this is a zinger group. IKEA Tradfri GU10
Yes, they are fully responding to all manual commands.
Yes, it is happening every time I run the script.
Manual toggling from anywhere in HA (dashboard, entities, Z2M dashboard) is not the problem. Only the script.

With regards to the transition, I have various other lights of the same category (IKEA tradfri GU10) and they do not show any issues.

Hmmmm… I’m not a fan of Ikea bulbs (well known around the forums lol). I would suggest removing that bulb and swapping in another into the group, but I am not sure if it’s the bulb. It might be that the transition is being badly received by just that one bulb. I’m just not sure, tbh.

I guess as a test, you could remove the transition from just that script OR go into Developer Tools > Services > Light: Turn On and use that group and set a transition on it and see if you can replicate the behavior.

I still had them lying around that’s why I used them :slight_smile:

I will give it a try with the removal of the transition.

Would there be away to see if there could be a wrong zigbee signal being send to the group just to exclude any protocol issues maybe? Or do you think this could not be a problem?

You could turn on debug logging in Z2M and see what that shows. But if you have other groups that are transitioning properly and working properly, then I don’t think you’re going to learn much really.

Sadly, I still have some lying in a drawer that is full of my old bulbs. I just can’t bring myself to throw them away (e-waste), but at the same time, they’ll never touch my mesh again. lol

1 Like

The transition was indeed the problem. I removed it and it worked as it should. Really strange.

Thanks for pointing me in the right direction :slight_smile:

1 Like