techposts

Spooky Automation using Alexa and Home Assistant

Mar 10th, 2025
92
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
YAML 3.60 KB | Writing | 0 0
  1. alias: Spooky Haunted Lights
  2. description: Creepier, more random flickering lights with Alexa whispers & sound effects
  3. triggers:
  4.   - type: value
  5.     device_id: ce08fcfe4f7778ef05e5fdfc59fbdbad
  6.     entity_id: 522d80ee50d838a5eed6b5eef73257a1
  7.     domain: sensor
  8.     trigger: device
  9.     above: 50
  10. conditions: []
  11. actions:
  12.   - data:
  13.       message: >-
  14.         <amazon:effect name="whispered">A shadow just moved... Look behind
  15.         you.</amazon:effect>    <audio
  16.         src="soundbank://soundlibrary/magic/amzn_sfx_ghost_spooky_01"/>  
  17.         <break time="2s"/>    <audio
  18.         src="soundbank://soundlibrary/transportation/amzn_sfx_car_slam_door_1x_01"/>
  19.        <break time="2s"/>    <prosody pitch="-10%" volume="+10dB">It's right
  20.         behind you!</prosody>    <audio
  21.         src="soundbank://soundlibrary/human/amzn_sfx_baby_cry_01"/>    <break
  22.         time="3s"/>    <amazon:effect name="whispered">You're
  23.         next...</amazon:effect>    <audio
  24.         src="soundbank://soundlibrary/monsters/ghosts_demons/ghosts_demons_15"/>
  25.        <break time="1s"/>    <audio
  26.         src="soundbank://soundlibrary/monsters/ghosts_demons/ghosts_demons_02"/>
  27.        <break time="2s"/>    <audio
  28.         src="soundbank://soundlibrary/magic/amzn_sfx_ghost_spooky_04"/>   <audio
  29.         src="soundbank://soundlibrary/magic/amzn_sfx_ghost_spooky_04"/>
  30.       data:
  31.         type: tts
  32.     action: notify.alexa_media_ravi_s_echo_dot
  33.   - delay: "{{ range(2, 6) | random }}"
  34.   - repeat:
  35.       count: "{{ range(12, 20) | random }}"
  36.       sequence:
  37.         - target:
  38.             entity_id:
  39.              - switch.bedroom_lights_bedroom_light_1
  40.               - switch.bedroom_lights_bedroom_light_2
  41.               - switch.bedroom_lights_bedroom_light_3
  42.               - switch.bedroom_lights_bedroom_light_4
  43.           data: {}
  44.           action: switch.toggle
  45.         - target:
  46.             entity_id:
  47.              - light.fan_light_1
  48.               - light.fan_light_2
  49.               - light.fan_light_3
  50.               - light.fan_light_4
  51.           data: {}
  52.           action: light.toggle
  53.         - target:
  54.             entity_id: light.lamp
  55.           data: {}
  56.           action: light.toggle
  57.         - delay: "{{ [0.3, 0.7, 1.2, 1.8] | random }}"
  58.   - delay: "{{ range(1, 4) | random }}"
  59.   - target:
  60.       entity_id:
  61.        - switch.bedroom_lights_bedroom_light_1
  62.         - switch.bedroom_lights_bedroom_light_2
  63.         - switch.bedroom_lights_bedroom_light_3
  64.         - switch.bedroom_lights_bedroom_light_4
  65.     action: switch.turn_off
  66.     data: {}
  67.   - target:
  68.       entity_id:
  69.        - light.fan_light_1
  70.         - light.fan_light_2
  71.         - light.fan_light_3
  72.         - light.fan_light_4
  73.         - light.lamp
  74.     action: light.turn_off
  75.     data: {}
  76.   - delay: "{{ range(2, 5) | random }}"
  77.   - data:
  78.       message: >-
  79.         <amazon:effect name="whispered">Oh my god! <break time="1s"/> RUN,
  80.         NOW!</amazon:effect>    <audio
  81.         src="soundbank://soundlibrary/monsters/ghosts_demons/ghosts_demons_06"/>  
  82.       data:
  83.         type: tts
  84.     action: notify.alexa_media_ravi_s_echo_dot
  85.   - delay: "{{ range(3, 7) | random }}"
  86.   - target:
  87.       entity_id:
  88.        - switch.bedroom_lights_bedroom_light_1
  89.         - switch.bedroom_lights_bedroom_light_2
  90.         - switch.bedroom_lights_bedroom_light_3
  91.         - switch.bedroom_lights_bedroom_light_4
  92.     action: switch.turn_on
  93.     data: {}
  94.   - target:
  95.       entity_id:
  96.        - light.fan_light_1
  97.         - light.fan_light_2
  98.         - light.fan_light_3
  99.         - light.fan_light_4
  100.         - light.lamp
  101.     action: light.turn_on
  102.     data: {}
  103. mode: restart
  104.  
Advertisement
Add Comment
Please, Sign In to add comment