Automation Issue: Turn Off Most Lights

Evening All,

I have an odd issue here. I have zigbee switches in most rooms and if you single tap them they will toggle the light in the room on or off. If you double tap it will turn off most lights (basically all “room” lights).

The button calls lights.turn_off on group.all_lights2 (as I don’t want to turn off all lights I have created this group).

  name: "All Lights"
    - light.landing
    - light.bedroom_light
    - light.daughters_light
    - light.nightlight
    - light.sons_light
    - light.gateway_light
    - light.livingroom
    - light.hallway
    - light.cupboard
    - light.porch_light

Now all of these work bar ‘light.hallway’. I have a mixed bag of smart bulbs, smart switches and RF switches. The hallway one is an RF switch. The problem is the hallway one turns on instead of off. You’d think it would be me having the RF codes the wrong way round or perhaps I’ve learnt an RF code for toggle rather than off. This isn’t the case though as if I call ‘light.turn_off’ it turns off the switch. If I call it twice it keeps the switch off (ie it’s not a toggle RF code).

I can’t for the life of me figure out what this is, has anyone experienced something similar to this?

I forgot to mention the RF code is saved as a RM pro switch. Then pulled through with a template_light (as are a couple of the other lights in the group which work fine).

I imagine this may be fixed by learning a couple of new RF codes but I thought I’d ask the question first.

have you tried this in a light group instead of a group group?

I hadn’t but I have since your post and have the same result. Very confusing.

are you using homeassistant.turn_off to call turn off on the group?

No I will try that though, I’m using light.turn_off.

Update: Tried homeassistant.turn_off, same issue. I’ve very confused as I’v added 2 more lights (rf) today and they work. I have also changed the RF code (using different fob, learnt new code) and the issue persists. The thing that’s really messing with my brain is if I turn that light off through home assistant by itself it works…

is the state of the device known in home assistant?

As it’s a template switch (using RF) it’s not truly known, it’s based on the last state that was processed through HA.

Edit: I might just set my automation to all_lights2 and take out the hallway light, then next step turn off hallway light by itself.

Have you turned on debugging for logger and watched what happens when you turn off the group?

1 Like

Right, figured it out… one of the other RF codes was, for some reason, hard coded as the toggle code for my hallway light. Replaced the light switch with a spare, re-learnt the code and done. Thanks for your help :).

Hah, that’s an interesting typo. Glad you figured it out.