Issue: Everytime one of the motion sensors starts to detect motion it calls the TTS service. This then repeats the “motion detected” TTS every few seconds while motion it being triggered over and over. I have an automation that gets triggered via 2 Motion Sensors. These have a super short “cooldown”, so I followed other examples and created a timer that keeps the lights on when additional motion is detected and only when both sensors stop detecting motion the “cooldown timer” starts and turns the light off at 2 minutes. So my only hurdle is keeping the lights controlled via the timer, but only have the TTS fire once on initial motion.
alias: May 5th Motion Test
description: ""
trigger:
- platform: state
entity_id:
- binary_sensor.back_porch_motion
to: "on"
id: BP Motion ON
from: "off"
for:
hours: 0
minutes: 0
seconds: 0
alias: Back Porch Motion DETECTED
- platform: state
entity_id:
- binary_sensor.back_porch_motion
id: BP Motion OFF
for:
hours: 0
minutes: 0
seconds: 0
to: "off"
alias: Back Porch Motion CLEAR
- platform: event
event_type: timer.finished
id: Timer Finished
event_data:
entity_id: timer.motion_cooldown
alias: Timer Finished event fired
condition: []
action:
- choose:
- conditions:
- condition: trigger
id:
- BP Motion ON
- condition: time
after: "04:00:00"
before: "08:00:00"
weekday:
- sun
- mon
- tue
- wed
- thu
- fri
- sat
sequence:
- service: timer.cancel
target:
entity_id: timer.motion_cooldown
data: {}
- service: light.turn_on
metadata: {}
data:
color_name: green
brightness: 100
target:
device_id:
- 1df9c727daaa4726bf7ac5cb058d1625
- delay:
hours: 0
minutes: 0
seconds: 1
milliseconds: 0
- service: tts.speak
target:
entity_id: tts.google_en_com
data:
cache: true
media_player_entity_id: >-
media_player.raspiaudio_muse_luxe_bc7a7c_raspiaudio_muse_luxe_bc7a7c
message: Chloe wants in please
alias: TTS - Chloe
enabled: true
alias: "[0400-0800] Chloe TTS"
- conditions:
- condition: trigger
id:
- BP Motion ON
- condition: time
after: "08:01:00"
before: "03:59:00"
weekday:
- sun
- mon
- tue
- wed
- thu
- fri
- sat
sequence:
- service: tts.speak
target:
entity_id: tts.google_en_com
data:
cache: true
media_player_entity_id: >-
media_player.raspiaudio_muse_luxe_bc7a7c_raspiaudio_muse_luxe_bc7a7c
message: Motion detected on back porch
alias: TTS - Motion Detected
enabled: true
- service: timer.cancel
target:
entity_id: timer.motion_cooldown
data: {}
- service: light.turn_on
metadata: {}
data:
color_name: green
brightness: 100
target:
device_id:
- 1df9c727daaa4726bf7ac5cb058d1625
- delay:
hours: 0
minutes: 0
seconds: 1
milliseconds: 0
alias: "[Dave awake] Motion TTS"
- conditions:
- condition: trigger
id:
- BP Motion OFF
sequence:
- service: timer.start
metadata: {}
data: {}
target:
entity_id: timer.motion_cooldown
- conditions:
- condition: trigger
id:
- Timer Finished
sequence:
- service: light.turn_off
metadata: {}
data: {}
target:
entity_id: light.0x142d41fffe58913e
mode: single