Hi, I use an automation for my pool pump so that it runs when my solar is producing over 2000w of power. The start up and shut down based on solar output work fine, but I have an automation to shut everything down (incl automations) once the pump has been running for 4.1 hours since midnight. It doesn’t consistently operate when it hits 4.1 hours and sometimes just runs for the entire day because the 4.1 hour trigger didn’t activate.
Configuration.yaml as below:
sensor:
- platform: history_stats
name: Pool pump ON today
entity_id: switch.pool_pump
state: "on"
type: time
start: "{{ now().replace(hour=0, minute=0, second=0) }}"
end: "{{ now().replace(hour=23, minute=59, second=0) }}"
Automation as follows:
alias: Pump Off 4 Hours
description: ''
trigger:
- platform: state
entity_id:
- sensor.pool_pump_on_today
from: '4.1'
condition: []
action:
- type: turn_off
device_id: (removed for post)
entity_id: switch.pool_pump
domain: switch
- service: automation.turn_off
target:
entity_id:
- automation.pool_pump_on
- automation.pump_off_4_hours
- automation.pool_pump_no_solar
- automation.pool_pump_off
- automation.pool_pump_no_solar_off
data:
stop_actions: false
- service: notify.mobile_app_phone
data:
message: 'Pump off after 4 hrs '
mode: single
Is anyone able to see anything that might be causing the inconsistent operation of this automation? It worked for the past two days flawlessly, but today the pump operated for 4.2 hours before I caught it out and manually turned it off. This kind of inconsistency has been happening for the 3-4 months that I’ve had it all in place.
Appreciate any help
Thanks