Below freezing automation for a pump and heater

I’m having trouble getting this automation to work right and I keep scratching my head on what to change.

The purpose of the automation is to turn on the patio outlet when the temperature drops below 34F. It’s then set up with a portable water heater and diaphragm pump. The outlet turns on the pump which keeps everything from freezing but running warm water through it every 1 hour.

The problem I’m having is it either doesn’t turn on when the temperature drops below 34F or it keeps turning on every hour after the temperature is above 34 degress Fahrenheit.

Here is the configuration:


alias: Below freezing
description: ""
trigger:
  - platform: numeric_state
    entity_id: weather.openweathermap
    for:
      hours: 0
      minutes: 0
      seconds: 0
    attribute: temperature
    below: 34
  - platform: state
    entity_id:
      - switch.patio_outlet
    from: "on"
    to: "off"
    for:
      hours: 1
      minutes: 0
      seconds: 0
condition: []
action:
  - service: notify.mobile_app_pixel_5a
    data:
      message: It's below 34 outside
  - type: turn_on
    device_id: b4609255d54c473a2ee6ce231e603129
    entity_id: switch.patio_outlet
    domain: switch
mode: single

For me it looks like you have two triggers here:

    • temp below 34F
    • patio outlet turned off for an hour.

Both triggers are independent, so if the pump is off for an hour it wit be turned on, regardless of the temperature.

I would add a condition that temp must be below 34F so then the first trigger will still act as it was before (the condition is same as the trigger) and the second one will not turn on the outlet if the temperature is above 34F, as in this case the condition won’t be met.

I assume that the patio outlet turns istelf off according to some other logic, not being the part of the presented configuration?

Apologies for such a late reply. I didn’t get any email notification of a response and remembered that I had not checked up on this post.

There’s a separate automation that turns off the pump after running for 15mins.

Lately I’ve been having trouble with openweathermap temperature and using it in automations for a numeric state trigger. If for example it’s already above or below the threshold set it never wants to trigger for stuff like this or it only wants to run once.
I’m guessing I need to run it in Restart or Queue mode.