Turn on a hot water switch for 1 hour on Tuesday and Thursday

Hello,
Noob help please. Seems quite easy in theory but I cannot figure out how to do this so would appreciate some help.

Requirement:
I want to create an automation that switches on a hot water tank (via a smart switch in HA) for 1 hour from 04:30 and switches off by 05:30 every Tuesday and Thursday.

Can someone help me how to create this?

Hi @google_was_my_idea

Something like this may help. You’ll need to change the entities for the thing you are turning on and off.

description: ""
mode: single
triggers:
  - trigger: time
    at: "04:30:00"
    id: Turn on
  - trigger: time
    at: "05:30:00"
    id: Turn off
conditions:
  - condition: template
    value_template: >-
      {{ (now().strftime("%A") == "Tuesday") or (now().strftime("%A") ==
      "Thursday") }}
actions:
  - choose:
      - conditions:
          - condition: trigger
            id:
              - Turn on
        sequence:
          - action: siren.turn_on
            metadata: {}
            data: {}
      - conditions:
          - condition: trigger
            id:
              - Turn off
        sequence:
          - action: siren.turn_on
            metadata: {}
            data: {}
1 Like

Or slightly simpler but also more complex…

description: ""
mode: single
triggers:
  - trigger: time
    at: "04:30:00"
    id: "on"
  - trigger: time
    at: "05:30:00"
    id: "off"
conditions:
  - condition: time
    weekday:
      - tue
      - thu
actions:
  - action: "switch.turn_{{ trigger.id }}"
    metadata: {}
    data: {}
    target:
      entity_id: switch.boiler

If it’s critical it turns off then you will need to account for HA to be rebooting while the time hits 5:30 and you will need a Home Assistant start event as trigger also.

1 Like