Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Stop an automation? #17

Open
iantait opened this issue Nov 22, 2023 · 1 comment
Open

Stop an automation? #17

iantait opened this issue Nov 22, 2023 · 1 comment

Comments

@iantait
Copy link

iantait commented Nov 22, 2023

Do you think its possible to stop an automation?

Use case - a motion sensor detects motion and turns on some lights, there is also a rule to turn the lights off after a couple of mins.
Say its a room that today you're going to be in a while, it would be nice to cancel the lights off automation rule if a switch or similar turns the lights on.

@Anonym-tsk
Copy link
Owner

How to stop automation? By automation id?
Look at my solution:

kitchen_workspace_on_by_motion:
  trigger:
    platform: state
    entity: Motion Kitchen
    attribute: occupancy
    state: true
  action:
    - entity: Kitchen Workspace
      service: custom
      data:
        state: 'ON'
        brightness: 250

kitchen_workspace_off_no_motion:
  trigger:
    platform: state
    entity: Motion Kitchen
    attribute: occupancy
    state: false
    for: 120
  condition:
    platform: state
    entity: Light Kitchen
    state: 'OFF'
  action:
    - entity: Kitchen Workspace
      service: turn_off

Kitchen Workspace light turns on by motion sensor and turns off if no motion for 120 seconds but only if Kitchen light (base light) disabled.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants