Automation should run every 3 hours

Hi guys,

I have an issue with an automation I try to get up and running.

I have a fan which should run from 8 a.m. till 23 p.m. every 3 hours for 1.5 hours.
I can start it manually but it just run for 1.5 hours and that’s it. Maybe you can give me a tip:

alias: //Climate// Lüftung HWR
  - hours: /3
    minutes: ''
    platform: time_pattern
    seconds: ''
  - after: 08:00:00
    before: '23:00:00'
    condition: time
  - data:
      entity_id: switch.lufter_hwr
    service: switch.turn_on
  - delay: 01:30:00
  - data:
      entity_id: switch.lufter_hwr
    service: switch.turn_off

After time should be in quotes
So should delay
and I think your condition block is jumbled up

Ah thanks! I used the automation configurator in Lovelace. Let’s see if this works :slight_smile:

Very low chance of that then :crazy_face:

Do you have samba set up and running ?

Do you have a favoured text editor ? Notepad++ ? Atom ?
That’s your best bet

Here’s another approach. The first automation turns on the fan every 3 hours starting at 08:00. The second automation turns off the fan after it’s been on for 1.5 hours.

- alias: 'Climate On Lüftung HWR'
  - platform: time
    at: '08:00:00'
  - platform: time
    at: '11:00:00'
  - platform: time
    at: '14:00:00'
  - platform: time
    at: '17:00:00'
  - platform: time
    at: '20:00:00'
  - service: switch.turn_on
    entity_id: switch.lufter_hwr

- alias: 'Climate Off Lüftung HWR'
  - platform: state
    entity_id: switch.lufter_hwr
    from: 'off'
    to: 'on'
    for: '01:30:00'
  - service: switch.turn_off
    entity_id: switch.lufter_hwr

So the fan will run from 08:00 to 09:30, 11:00 to 12:30, 14:00 to 15:30, etc.
If you turn on the fan manually, the second automation will turn it off after 1.5 hours of operation.

Hey Taras,

I think I will go with your solution as mine is not working for some reason :confused:

Will keep you posted.