this post was submitted on 30 Sep 2025
26 points (96.4% liked)

homeassistant

16424 readers
80 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
 

Currently, I have an automation that turns on my air conditioner for 37 minutes, every 3 hours. However, during that time, I cannot do anything like update, HAOS, etc. Because it breaks the timer, and then I have to manually shut it off.

you are viewing a single comment's thread
view the rest of the comments
[–] christianhawkins@feddit.org 2 points 6 days ago* (last edited 6 days ago)

There are many ways how you could go about this.

The easiest way with the fewest helpers imo is to execute it every minute, check if the ac should be on or off based on your time rules and then turn it to the state you want it, if it is not in that state.

description: Turn AC on between minutes 0-37 of hours 0,3,6,9,12,15,18,21; off otherwise
trigger:
  - platform: time_pattern
    minutes: "/1"  # runs every minute

condition: []

action:
  - choose:
      - conditions:
          - condition: template
            value_template: >
              {% if now().hour in [0,3,6,9,12,15,18,21] and 0 <= now().minute <= 37 %}
                true
              {% else %}
                false
              {% endif %}
        sequence:
          - condition: state
            entity_id: switch.ac
            state: "off"
          - service: switch.turn_on
            target:
              entity_id: switch.ac
    default:
      - condition: state
        entity_id: switch.ac
        state: "on"
      - service: switch.turn_off
        target:
          entity_id: switch.ac
mode: single```