Override automation?

I have 2 automations to toggle a power switch to turn my dehumidifier on and off like this.


alias: Turn on dehumidifier if high moisture
description: ""
trigger:
  - type: humidity
    platform: device
    device_id: 0536bfe33b61d0b0dcaa4a4c6c609951
    entity_id: sensor.aqara_temp_1
    domain: sensor
    above: 70
    for:
      hours: 0
      minutes: 5
      seconds: 0
    enabled: false
  - type: humidity
    platform: device
    device_id: 66d87300e346f7f0734c3e5ab4ca39c3
    entity_id: sensor.aqara_temp_2
    domain: sensor
    above: 69
    for:
      hours: 0
      minutes: 5
      seconds: 0
condition: []
action:
  - type: turn_on
    device_id: 240038c3a4f213f788c15da346e40033
    entity_id: switch.shelly_plug_s
    domain: switch
mode: single


alias: Turn off dehumidifier if low moisture
description: ""
trigger:
  - type: humidity
    platform: device
    device_id: 0536bfe33b61d0b0dcaa4a4c6c609951
    entity_id: sensor.aqara_temp_1
    domain: sensor
    for:
      hours: 0
      minutes: 5
      seconds: 0
    below: 67
    enabled: false
  - type: humidity
    platform: device
    device_id: 66d87300e346f7f0734c3e5ab4ca39c3
    entity_id: sensor.aqara_temp_2
    domain: sensor
    below: 66
condition: []
action:
  - type: turn_off
    device_id: 240038c3a4f213f788c15da346e40033
    entity_id: switch.shelly_plug_s
    domain: switch
mode: single

This is working good. However I would add a third (and possible fourth) job that will start the humidifier weekly or biweekly and run until humidity is at 60% just to dry things up. The problem is that it will interfer with my previous jobs. Is it somehow possible for one job to override another one?

Create an input_boolean helper called ā€œinterlockā€, or ā€œoverrideā€ or something similar.

Set this input boolean on in your third and fourth automation actions.

Use a condition in your first and second automations that wont run the actions if the state of this input boolean is on.

How you turn off this input boolean depends on what you are doing in your third and fourth automations.

Ah clever! But how do I do this in practice? I think I managed to create in in configuration.yml and then set it using the service thing. :slight_smile:

Yes you use a service to turn on or off the input boolean and you use a state condition in your automations to test it.

1 Like

Yeah I think I got it! Thanks!