Automation for mode change without relying on crossing threshold?

Hi everyone. I’m trying to get my HVAC to switch modes when temperatures cross a threshold. Condition being my presence being detected.

The issues i’m facing are :

  • the temperature threshold is crossed when i’m not present, so there is no trigger.
  • when i’m present, the temperature has long crossed the threshold, so it the automation doesn’t trigger as well.

Is there any way to get the automation to poll every x minutes to check if the temps are below a certain value, without having to rely on it crossing the preset threshold?

Thanks

alias: AC Dry Mode
description: ""
trigger:
  - platform: numeric_state
    entity_id:
      - sensor.sonoff_1001031489_temperature
    for:
      hours: 0
      minutes: 0
      seconds: 0
    below: 30
condition:
  - condition: state
    entity_id: sensor.keys
    state: room
  - condition: or
    conditions:
      - condition: state
        entity_id: sensor.wallet
        state: garage
action:
  - service: script.dry_mode_code
    metadata: {}
    data: {}
  - service: switch.turn_on
    metadata: {}
    data: {}
    target:
      entity_id: switch.sonoff_1000bddb1b_3
mode: single

Well for a start this is not how you OR two conditions:

condition:
  - condition: state
    entity_id: sensor.keys
    state: room
  - condition: or
    conditions:
      - condition: state
        entity_id: sensor.wallet
        state: garage

That is still AND logic. condition 1 AND (condition 2 OR nothing ).

You do it like this:

condition:
  - condition: or
    conditions:
      - condition: state
        entity_id: sensor.wallet
        state: garage
      - condition: state
        entity_id: sensor.keys
        state: room

To solve your other issue,

add another trigger that fires when you arrive home, and another condition that checks the temperature.

3 Likes