Automation to run if then depending on time

trying to figure this out… it works if i click on it everytime but i want it to run automatically. any help is appreciated

alias: Stage3
description: ''
trigger: []
condition: []
action:
  - if:
      - condition: time
        before: '17:00:00'
        after: '05:00:00'
        weekday:
          - mon
          - tue
          - wed
          - thu
          - fri
          - sat
          - sun
    then:
      - service: input_number.set_value
        data:
          value: 53
        target:
          entity_id: input_number.rh_low
      - service: input_number.set_value
        data:
          value: 58
        target:
          entity_id: input_number.rh_high
      - service: input_number.set_value
        data:
          value: 78
        target:
          entity_id: input_number.air_low
      - service: input_number.set_value
        data:
          value: 79
        target:
          entity_id: input_number.air_high
    else:
      - service: input_number.set_value
        data:
          value: 63
        target:
          entity_id: input_number.air_low
      - service: input_number.set_value
        data:
          value: 65
        target:
          entity_id: input_number.air_high
      - service: input_number.set_value
        data:
          value: 35
        target:
          entity_id: input_number.rh_low
      - service: input_number.set_value
        data:
          value: 40
        target:
          entity_id: input_number.rh_high
mode: single

1 Like

so basically just adding in triggers to tell it to run the automation will make it do what its supposed to?

almost too easy but thank you… gave to much credit to that if / then statement handling the job

alias: Stage3
description: ''
trigger:
  - platform: time
    at: '05:00:02'
  - platform: time
    at: '17:00:02'
condition: []
action:
  - if:
      - condition: time
        before: '17:00:00'
        after: '05:00:00'
        weekday:
          - mon
          - tue
          - wed
          - thu
          - fri
          - sat
          - sun
    then:
      - service: input_number.set_value
        data:
          value: 53
        target:
          entity_id: input_number.rh_low
      - service: input_number.set_value
        data:
          value: 58
        target:
          entity_id: input_number.rh_high
      - service: input_number.set_value
        data:
          value: 78
        target:
          entity_id: input_number.air_low
      - service: input_number.set_value
        data:
          value: 79
        target:
          entity_id: input_number.air_high
    else:
      - service: input_number.set_value
        data:
          value: 63
        target:
          entity_id: input_number.air_low
      - service: input_number.set_value
        data:
          value: 65
        target:
          entity_id: input_number.air_high
      - service: input_number.set_value
        data:
          value: 35
        target:
          entity_id: input_number.rh_low
      - service: input_number.set_value
        data:
          value: 40
        target:
          entity_id: input_number.rh_high
mode: single

An automation only starts when one of the triggers becomes true. It then checks the conditions and if they return true too, only then are the actions run.

1 Like

makes sense, i was going with the click solution with everything else i never figured out the triggers actually had that much control…appreciate everyones input and @VDRainer for linking me in the right direction.