I’m setting up a reminder system so that if we forget to feed the dog in the morning or evening, we’ll be alerted. Home Assistant 2021.12.9 on Raspberry Pi 4.
I’ve added a helper input boolean input_boolean.dog_needs_food
which turns on at 9am and 4pm using an automation. It should detect if we’ve fed the dog in the past 3 hours by looking for movement on a multi-sensor mounted to the dogfood container (binary_sensor.dogfood_container_accelerometer
).
However, at 9am the trace shows that it fails on the condition that the dog food container sensor hasn’t moved in the past 3 hrs…even though I confirmed in LogBook for this sensor it hasn’t moved for 17 hours (last entry shows “Dogfood Container accelerometer turned off (17hrs ago)”).
I must be using the wrong method in my automation to detect that we’ve already fed the dog, or my syntax is incorrect (though I used the GUI for this one). Screenshot of failing trace is included below.
(Not shown here, but I have an alert to look/notify for an “on” dog_needs_food
input boolean for more than 30 min. I haven’t gotten to that testing yet since the automation doesn’t yet work.)
Thanks for the help!
- id: '1644452151182'
alias: DogFed - Alert
description: ''
trigger:
- platform: time
at: '09:00:00'
- platform: time
at: '16:00:00'
condition:
- type: is_not_moving
condition: device
device_id: f7262518deddf2ad9596a5013af505ec
entity_id: binary_sensor.dogfood_container_accelerometer
domain: binary_sensor
for:
hours: 3
minutes: 0
seconds: 0
action:
- service: input_boolean.turn_on
target:
entity_id: input_boolean.dog_needs_food
mode: single
Trace shows: