Different time of divice activated depending on temperature

Hi all,

I’m trying to automate my pool pump. Here is the challenge:
During the winter saison I want thepool pump to run only if necessary. Means:

  • In case water temperature is > 15°C the pool pump should start at 9:00am and should run 8 hours
  • In case water temperature is < 15°C the pool pump should start at 3:00am (energy is cheaper at that time) and needs to run only 4 hours
  • BUT in case air temperature is below 2°C pool pump should start automatically indenpendent what time, till air temp >= 2°C again.
    anybody an idea how to do this?

thanks
Oliver

Your time ranges don’t interfere with one another so here’s a simple way with separate automations.

alias: pump_on_at_3
trigger:
  - platform: time
    at: "03:00:00"
condition:
  - condition: numeric_state
    entity_id: sensor.water_temperature
    below: 15
action:
  - service: switch.turn_on
    target:
      entity_id: switch.pool_pump
alias: pump_on_at_9
trigger:
  - platform: time
    at: "09:00:00"
condition:
  - condition: numeric_state
    entity_id: sensor.water_temperature
    above: 15
action:
  - service: switch.turn_on
    target:
      entity_id: switch.pool_pump
alias: pump_on_air_temp_below_2
trigger:
  - platform: numeric_state
    entity_id: sensor.air_temperature
    below: 2
action:
  - service: switch.turn_on
    target:
      entity_id: switch.pool_pump
alias: pump_off
trigger:
  - platform: time
    at: "07:00:00"
  - platform: time
    at: "17:00:00"
  - platform: numeric_state
    entity_id: sensor.air_temperature
    above: 1.99
condition:
  - condition: numeric_state
    entity_id: sensor.air_temperature
    above: 1.99
action:
  - service: switch.turn_off
    target:
      entity_id: switch.pool_pump

You could combine all these automations into one with trigger ids and choose actions but the complexity is hardly worth it.

1 Like

wow, that was fast! Thanks, I will try it!