Hi
I try to create an automation for following use-case:
Alarm-state should be enabled, if front-door is locked by leaving the house
I have to sensors, to controll this automation:
- magnetic-sensor which push lock of front-door to an input boolean: housedoor_lockstatus
(this works fine) - pir-sensor inside the house near front-door
My intention is with following logic to controll the automation:
If input boolean.housedoor_lockstatus change from off to on when there is no movement after this trigger for 15 seconds from pir-sensor, then arm the house.
i don’t get a solution for the condition part…
here is my code:
- id: '1604878166027'
alias: Arm house when locking
description: Alarm einschalten wenn mit SchlĂĽssel geschlossen wird
trigger:
- platform: state
entity_id: input_boolean.housedoor_lockstatus
from: 'off'
to: 'on'
condition: []
action:
- service: input_boolean.turn_on
data: {}
entity_id: input_boolean.alarm
mode: single
the pir sensor send a movment by mqtt via sonoff-bridge.
(text from file included binary sensor:)
- platform: mqtt
unique_id: sonoff_pir_keller_tuere
name: Sonoff PIR Keller TĂĽre
state_topic: "tele/tasmota_EF53BF/RESULT"
value_template: '{{value_json.RfReceived.Data}}'
payload_on: 'FBFF1E'
payload_off: 'FBFF1Eoff'
device_class: motion
qos: 1
perhaps anyone have a hint