this post was submitted on 03 Apr 2026
1 points (100.0% liked)

homeassistant

19372 readers
1 users here now

Home Assistant is open source home automation that puts local control and privacy first.
Powered by a worldwide community of tinkerers and DIY enthusiasts.

Home Assistant can be self-installed on ProxMox, Raspberry Pi, or even purchased pre-installed: Home Assistant: Installation

Discussion of Home-Assistant adjacent topics is absolutely fine, within reason.
If you're not sure, DM @GreatAlbatross@feddit.uk

founded 2 years ago
MODERATORS
 

Scenario: I have an automation called John's AC. John's AC has four separate triggers. Max, minimum lower temperature, lower temperature, upper temperature, and max upper temperature. If the room temperature is below max lower temperature or lower temperature and it warms up to either of those two triggers, the automation gets triggered and creates a log event.

Question: Is there some way to make triggers enable and disable other triggers in their conditions? What I was thinking about doing is having upper temperature and max upper temperature be the only two active triggers. If either was hit, John's AC would then turn on and the triggers for lower temperature and max lower temperature would be enabled until one of those two triggers was hit, at which point John's AC would turn off, and those two triggers would be disabled. until upper temperature got hit again.

Admittedly, it's a lot of work, just to avoid a couple of log messages, but just for shits and giggles, I wonder if it's possible.

you are viewing a single comment's thread
view the rest of the comments
[–] solidgrue@lemmy.world 0 points 1 month ago

You can use trigger IDs and conditional execution to accomplish this. Not precisely your use case, but I have an automation that manages two ornamental lamps via two smart buttons: one lamp and one button on each nightstand to either side of the bed in our main bedroom.

A single click of either button toggles the lamp on that nightstand. A double click on either button turns off both lamps, and a long press on either button calls a script that turns off all the lights inside and outside the house, by area.

I use trigger IDs to tag the button events, and then use that ID in conditional action logic to toggle the lamps, turn them off, or call the shutdown service.

You can probably use trigger IDs for your upper and lower bounds to conditionally execute your air conditioner functions.

Here's the YAML, if you'd like to see how I use it.

alias: "QoL: Bedroom Smart Button Features"
description: |-
  Short press toggle local ornamental lamp (amethyst, salt)
  Long press turn off both ornamental lamps
  Double press call Shutdown Everything automation
triggers:
  - device_id: b11766b6ab9a7ae6f752e70514562f18
    domain: zha
    type: remote_button_short_press
    subtype: button_1
    trigger: device
    id: bedroom_button_short_press_right
  - device_id: b11766b6ab9a7ae6f752e70514562f18
    domain: zha
    type: remote_button_double_press
    subtype: button_1
    trigger: device
    id: bedroom_button_double_press_right
  - device_id: b11766b6ab9a7ae6f752e70514562f18
    domain: zha
    type: remote_button_long_press
    subtype: button_1
    trigger: device
    id: bedroom_button_long_press
  - device_id: 2a9e9c869c5e611e791232491169da77
    domain: zha
    type: remote_button_short_press
    subtype: button_1
    trigger: device
    id: bedroom_button_short_press_left
  - device_id: 2a9e9c869c5e611e791232491169da77
    domain: zha
    type: remote_button_double_press
    subtype: button_1
    trigger: device
    id: bedroom_button_double_press_left
  - device_id: 2a9e9c869c5e611e791232491169da77
    domain: zha
    type: remote_button_long_press
    subtype: button_1
    trigger: device
    id: bedroom_button_long_press
conditions: []
actions:
  - if:
      - condition: or
        conditions:
          - condition: trigger
            id:
              - bedroom_button_short_press_right
    then:
      - action: light.toggle
        metadata: {}
        data: {}
        target:
          entity_id: light.salt_lamp_switch
  - if:
      - condition: or
        conditions:
          - condition: trigger
            id:
              - bedroom_button_short_press_left
    then:
      - action: light.toggle
        metadata: {}
        data: {}
        target:
          entity_id:
            - light.amethyst_lamp
  - if:
      - condition: or
        conditions:
          - condition: trigger
            id:
              - bedroom_button_long_press
    then:
      - action: light.toggle
        metadata: {}
        data: {}
        target:
          entity_id:
            - light.salt_lamp_switch
            - light.amethyst_lamp
  - if:
      - condition: trigger
        id:
          - bedroom_button_double_press_right
          - bedroom_button_double_press_left
    then:
      - action: light.turn_off
        metadata: {}
        data: {}
        target:
          entity_id:
            - light.amethyst_lamp
            - light.salt_lamp_switch
mode: restart

Another idea, you could use a wait_for action in the turn_on action to wait for a lower bound trigger to execute your turn_off action. I've used that for actions that turn on a light when motion is detected, and then wait for motion to clear before turning off the light.

Really, you could peel.it a bunch of different ways, but these are trucks I've used in my automations.