Hello!
I have created several automations in my home assistant already without any problems. A few weeks ago, I was creating an outdoor automation:
Lawn Mowing Robot shall return to base when it rains and shall continue when it has not rained for 2h
Issue:
This was working well for a few weeks. But today I noticed, how home assistant sends it to the base even though there was no rain, see report from Influx where the knx sensor value is also saved:
→ See, no actual rain happened today.
I might have an idea why the “unexpected behavior” happened in home assistant: Around 1pm I had to restart the fritz box / router. Naturally, this interrups home assistant connections. It might be the cause here: See this interruption in the history:
This “interruption” was shortly after 1pm. So when the automation was running at 3pm, you could argue, that the sensor value “was not thoroughly OFF for 2h” because it was interruped (router restart). On the other hand you could also argue, the rain was never ON in the last few days … so therefore the behaviour is somewhat questionable!?
My question therefore is: If it hasn’t rained in a few days, should the automation not work as intended even though I do router restarts? Should the implementation of the “for” argument be improved? (Luckily this does not happens often for me)
My home assistant:
Core 2023.8.3
Further infos below:
The Automation is not very simple, but simple enough:
If the lawn mower (vacuum.mackel) is not deactivated with a global boolean, then
IF
- condition: state
entity_id: binary_sensor.aussen_sensor_regen
state: “off”
for:
hours: 2
minutes: 0
seconds: 0
THEN send to base, otherwise start the robot.
See full Yaml attached below.
Full YAML:
alias: GARDEN_Automower Rain Automation
description: ""
trigger:
- platform: time_pattern
minutes: /15
- platform: state
entity_id:
- binary_sensor.aussen_sensor_regen
to: "on"
for:
hours: 0
minutes: 1
seconds: 0
condition: []
action:
- if:
- condition: state
entity_id: input_boolean.automower_enabled
state: "on"
alias: Check Automower is ENABLED (This is my MANUAL OVERRIDE HELPER)
then:
- if:
- condition: state
entity_id: binary_sensor.aussen_sensor_regen
state: "off"
for:
hours: 2
minutes: 0
seconds: 0
then:
- service: vacuum.start
data: {}
target:
entity_id: vacuum.mackel
else:
- service: vacuum.return_to_base
data: {}
target:
entity_id: vacuum.mackel
else:
- service: vacuum.return_to_base
data: {}
target:
entity_id: vacuum.mackel
mode: single