Advertisement
penright

Untitled

Apr 15th, 2022
175
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
YAML 2.12 KB | None | 0 0
  1.  - alias: 'Shop Opening'
  2.     id: 'Shop Opening'
  3.     trigger:
  4.       - platform: state
  5.         entity_id: input_select.shop_status
  6.         to: 'Opening'
  7.     condition:
  8.       - condition: state
  9.         entity_id: "input_boolean.shop_stop_automation"
  10.         state: "off"      
  11.       - condition: template
  12.         value_template: "{{ (states('input_select.shop_status')) == 'Opening' }}"
  13.     action:
  14.       - wait_for_trigger:
  15.         - platform: state
  16.           entity_id: input_boolean.shop_lock
  17.           to: 'off'
  18.         timeout:
  19.           seconds: 30
  20.         continue_on_timeout: true
  21.       - choose:
  22.           - alias: "Is shop still lock?"
  23.             conditions:
  24.               - condition: state
  25.                 entity_id: input_boolean.shop_lock
  26.                 state: "on"
  27.             sequence:
  28.               - service: input_select.select_option
  29.                 data:
  30.                   option: Unauthorize
  31.                 target:
  32.                    entity_id: input_select.shop_status
  33.         default:
  34.           - service: light.turn_on
  35.             entity_id: light.shop_main_bench
  36.           - service: light.turn_on
  37.             entity_id: light.shop_bays
  38.           - service: media_player.turn_off
  39.             data: {}
  40.             target:
  41.               entity_id: media_player.shop
  42.           - service: media_player.volume_set
  43.             data:
  44.               volume_level: 1
  45.             target:
  46.               entity_id: media_player.shop
  47.           - service: tts.cloud_say
  48.             entity_id: media_player.shop
  49.             data:
  50.               message: The shop is now open.
  51.           - service: media_player.play_media
  52.             entity_id: media_player.shop
  53.             data:
  54.               media_content_id: http://maestro.emfcdn.com/stream_for/k-love/web
  55.               media_content_type: music
  56.               extra:
  57.                 title: KLove
  58.                 thumb: https://cdn-profiles.tunein.com/s22561/images/bannerx.jpg?t=637102372250000000
  59.                 stream_type: live
  60.           - service: input_select.select_option
  61.             data:
  62.               option: Open
  63.             target:
  64.                entity_id: input_select.shop_status
  65.        
  66.  
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement