hello,
i have a automation that has a condition that the motion of a binary_sensor is ON for 5 minutes.
it should be 5 minutes of movement before he performs the next one.
here is the piece code
- condition: and
conditions:
- type: is_motion
condition: device
device_id: 53b255e469a65751ad0ada6661b76198
entity_id: binary_sensor.presence_42
domain: binary_sensor
for:
hours: 0
minutes: 5
seconds: 0
- condition: device
device_id: 06c3a968a177cfaacf95843823bf7f5e
domain: media_player
entity_id: media_player.fire_tv_192_168_0_42
type: is_off
when the 5 mins not reached or the sensor changed in this time, restarts the automation?
or do I have to set the automation to restart? or is sort single enough?
my sonoff motion detector triggers every 3 minutes, but that should not cause a problem here
here is the complete code to understand.
alias: RAUM KÜCHE - Schalte alles wieder an bei Bewegung
description: ''
trigger:
- platform: state
entity_id: group.bewegungsmelder_sonoff_kueche_group
to: 'on'
condition: []
action:
- service: notify.mobile_app_iphone_von_marc
data:
message: BEWEGUNG ERKANNT, PERSON IN DER KÜCHE
- choose:
- conditions:
- condition: sun
before: sunrise
after: sunset
sequence:
- service: switch.turn_on
data: {}
target:
device_id: 788dbd5e56d29b9d3b319344df389458
- service: light.turn_on
data: {}
target:
device_id: c733add90279c54c552b40d5ffbd016d
default: []
- condition: and
conditions:
- type: is_motion
condition: device
device_id: 53b255e469a65751ad0ada6661b76198
entity_id: binary_sensor.presence_42
domain: binary_sensor
for:
hours: 0
minutes: 5
seconds: 0
- condition: device
device_id: 06c3a968a177cfaacf95843823bf7f5e
domain: media_player
entity_id: media_player.fire_tv_192_168_0_42
type: is_off
- service: androidtv.adb_command
data:
command: POWER
target:
device_id: 06c3a968a177cfaacf95843823bf7f5e
- delay:
hours: 0
minutes: 0
seconds: 4
milliseconds: 0
- service: androidtv.adb_command
data:
command: CENTER
target:
device_id: 06c3a968a177cfaacf95843823bf7f5e
- delay:
hours: 0
minutes: 0
seconds: 2
milliseconds: 0
- service: media_player.select_source
data:
source: Plex
target:
device_id:
- 06c3a968a177cfaacf95843823bf7f5e
mode: single
greets