I’m trying to configure automation to raise push notification when motion is detected and it seems that it’s not being triggered when binary sensor change its state. Could you please advise me where I am making mistake?
My automation:
- id: 'some id'
alias: Notify me if motion detected and I am not at home
description: Motion in empty flat?!
trigger:
- platform: template
value_template: '{{ is_state(''binary_sensor.living_room_living_room_5'', ''on'')
}}'
- entity_id: binary_sensor.living_room_living_room_5
for: 00:00:01
from: 'off'
platform: state
to: 'on'
condition:
- condition: device
device_id: some_id
domain: device_tracker
entity_id: device_tracker.vog_l29
type: is_not_home
action:
- data:
message: Motion detected!
service: notify.mobile_app_vog_l29
Condition is fine. I set up automation via web interface, I was not writing the scrip by hand
Removing the condition doesn’t change a thing as automation is not triggered. When I trigger manually I receive popup. Problem is with the trigger
When you trigger an automation manually the conditions are skipped.
Please try the following code to see if the trigger is the problem:
- id: 'some id'
alias: Trigger test just to make sure
description: Test Trigger
trigger:
platform: state
entity_id: binary_sensor.living_room_living_room_5
to: 'on'
action:
service: persistent_notification.create
data:
message: "Trigger is working!"
I was testing it by changing the values of the motion sensors manually. And that didn’t triggered the automation. When I steped into my house I got popup.