Automation Not to Override Current State

Good Morning,

I would like to find a clean way on how to have automation not overriding my current of lights.

So what I mean is if that i switched the lights manually i don’t want my automation to over ride it.

Any Examples on how i could do it please?

Regards,
Etienne

Questions does HA know if the Switch been Turn on Manually

if so U just need to add a condition to the automation

    condition:
      - condition: state
        entity_id: switch.manuallyswitch
        state: 'off'

By Manual I meant that not via automation. The majority of the times they would be switched on from Home Assistant Its self but not via an Automation.

tell us how exactly you do that.

Hi,

For example I have an automation to switch on an RGBW led strip which is triggered by a pir using condition between sunset and sunrise and this switches on with brightness 100, and switches of after 30 second of no movement detected. Now if from the home assistant control panel I switch on the LEDs with 255 brightness I don’t want for the automation to kick in if the pir senors is triggered or no movement is detected. . I would only like for the automation to kick in once i switch it off from the Home Assistant Control Panel.

I would still like to know how exactly you switch your lights on/off. A snippet of your config/screenshot will do the job.

hard work training some people LOL

Hi,

Example switching on this lamp on and off and setting up the color. That’s done from home assistant and its not part of the automatons.

If I get it right, you want to distinguish between turning your light on/off from HA fronted and from an automation.
As you haven’t provided any config, I’ll use what I have - switch.wall_switch_study (it’s an RF wall switch to control my light).

You will need an input_boolean to tell if the switch was turned on manually

input_boolean:
   manual:

Then you need a template switch switch.test you’ll use to turn the switch on/off from the frontend

switch:
- platform: template
  switches:
    test:
      entity_id: switch.wall_switch_study
      value_template: "{{ states('switch.wall_switch_study') }}"
      turn_on:
        - service: input_boolean.turn_on
          data:
            entity_id: input_boolean.manual
        - service: switch.turn_on
          data:
            entity_id: switch.wall_switch_study

      turn_off:
        - service: input_boolean.turn_off
          data:
            entity_id: input_boolean.manual
        - service: switch.turn_off
          data:
            entity_id: switch.wall_switch_study

And finally a test automation

automation:
- alias: test_wall_switch
  trigger:
    platform: event
    event_type: whatever

  condition:
    - condition: state
      entity_id: input_boolean.manual
      state: 'off'
      
  action:
  - service: switch.turn_on
    data:
      entity_id: switch.wall_switch_study

So I was able to control my wall switch using switch.test and the automation.test_wall_switch took into account that input_boolean.manual's state.
Hope it helps.

hi,

Thanks, i shall give you the config later as i’m not at home at the moment as i’m traveling. Thanks again.