Home-AssistantConfig/config/packages/triggers/sleepy_dog.yaml

51 lines
1.6 KiB
YAML
Executable File

#-------------------------------------------
# @CCOSTAN
# Original Repo : https://github.com/CCOSTAN/Home-AssistantConfig
#-------------------------------------------
homeassistant:
customize:
input_boolean.sleepy_dog:
friendly_name: 'Sleepy Dog'
icon: mdi:bell-sleep
#-------------------------------------------
input_boolean:
sleepy_dog:
name: Sleep Dog
initial: off
#-------------------------------------------
##############################################################################
### Automations - Detect when things are not right. Like any Good Watchdog.
##############################################################################
automation:
- alias: 'Snooze the Dog for 30 minutes'
id: 0dc9033b-58e4-4b36-9a1a-d65f5a561311
trigger:
- platform: state
entity_id: input_boolean.sleepy_dog
to: 'on'
action:
# Disable automation for 30 minutes
- service: automation.turn_off
entity_id: automation.guard_dog
- service: input_boolean.turn_off
entity_id: input_boolean.sleepy_dog
- service: script.speech_engine
data:
call_no_announcement: 1
value1: >
{{ [
"The dogs have been put away for the next 30 minutes.",
"I will let sleeping dogs lie for the next 30 minutes.",
"You will not be bothered by the sound of dogs barking for at least 30 minutes.",
"Sleepy Dog activated. Molly is our only watch cat for the next 30 minutes."
] |random }}
- delay:
minutes: 30
- service: automation.turn_on
entity_id: automation.guard_dog