I have an automation which turns on a pump when moisture value is below 40. However reading through threads I’ve come to the loose understanding an automation doesn’t fire if the value is already below the stated amount ( I think)? How would I go about relieving such an issue when the time conditions are met but the moisture value is already below 40 when the automation is supposed to trigger.
Any help would be appreciated, thank you.
alias: ON
description: ''
trigger:
- platform: numeric_state
entity_id: sensor.average_moisture
below: '40'
- platform: time
at: '21:00:01'
condition:
- condition: time
after: '21:00:00'
before: '12:00:00'
- condition: numeric_state
entity_id: sensor.average_moisture
below: '40'
action:
- service: switch.turn_on
data: {}
target:
entity_id: switch.sonoff_pump
- device_id: 7dc7b4792c37609d4b68e7bb68201d56
domain: mobile_app
type: notify
message: System On
title: 'System On '
- delay:
hours: 0
minutes: 2
seconds: 0
milliseconds: 0
- service: switch.turn_off
data: {}
target:
entity_id: switch.sonoff_pump
- device_id: 7dc7b4792c37609d4b68e7bb68201d56
domain: mobile_app
type: notify
message: System Off
title: System Off
- delay:
hours: 0
minutes: 15
seconds: 0
milliseconds: 0
mode: single
If you only want it to turn on between 9pm and midday the next day when the moisture is below 40, then what you have is nearly correct. Just change the trigger to this: