Prevent the switch from turning on the light

Hi fellas!

I have a Zemismart Zigbee switch and I would like to know how I can prevent it from turning on during the daytime. I created an automation that accomplishes this, but when I press the button, the light turns on briefly and then shuts off. Is there a way to achieve this without the light flickering?

alias: Nova Automação
description: ""
triggers:
  - trigger: state
    entity_id:
      - switch.interruptor_quarto_casal
    from: "off"
    to: "on"
conditions:
  - condition: sun
    before: sunset
    after: sunrise
actions:
  - action: switch.turn_off
    metadata: {}
    data: {}
    target:
      entity_id: switch.interruptor_quarto_casal
mode: single

How is the light turned on?

Pressing a wall switch.

I would be very surprised if there was a way to accomplish that. Physical switch must always work IMO.

1 Like

Unless the switch has a detached mode so it won’t control the light. Then you can create an automation to conditionally turn on the light.

2 Likes

Exactly. If the switch is directly controlling the circuit, there is no way. Otherwise, connect something like a Shelly 1 to the light and a Shelly i4 to the switch. The i4 tells HA simply whether the switch has been flipped. In HA you then decide what to do with that event.

2 Likes

I see, I thought it is like a soft switch, it is just a push button. So I need different circuits so they can be triggered separately. More expensive than I thought.

There might be alternative options. I just wanted to convey the idea.

But, if you have a Shelly i4, then you have 3 more inputs to which you can connect switches to control scenes or other things, to get a bit more value for money.

1 Like