Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- # service: notify.family
- # data:
- # message: "Nancy has arrived at her parents. Time: {{now().strftime('%I:%M:%S %p')}}"
- #Shop Sensors
- # binary_sensor.shop_door
- # binary_sensor.shop_north_east_window
- # binary_sensor.shop_north_window
- # binary_sensor.shop_south_east_window
- # binary_sensor.shop_south_overhead_door
- # binary_sensor.shop_south_window
- # input_boolean.open_shop
- # cover.shop_north_overhead_door
- input_boolean:
- shop_lock:
- name: 'Shop is Lock'
- shop_stop_automation:
- name: 'Shop Stop All Automation'
- shop_test_door_opening:
- name: 'Test_door_open'
- input_select:
- shop_status:
- name: 'Shop Status'
- options:
- - Open
- - Opening
- - Close
- - Closing
- - Unauthorize
- - Unknown
- automation:
- # Entering the shop
- - alias: 'Shop 2 Opening'
- id: 'Shop 2 Opening'
- trigger:
- - platform: state
- entity_id: binary_sensor.shop_door
- to: 'on'
- - platform: state # North East Window
- entity_id: binary_sensor.shop_north_east_window
- to: 'on'
- - platform: state # North Window
- entity_id: binary_sensor.shop_north_window
- to: 'on'
- - platform: state # South East Window
- entity_id: binary_sensor.shop_south_east_window
- to: 'on'
- - platform: state # South Window
- entity_id: binary_sensor.shop_south_window
- to: 'on'
- - platform: state # South Overhead Door
- entity_id: binary_sensor.shop_south_overhead_door
- to: 'on'
- - platform: state
- entity_id: cover.shop_north_overhead_door
- from: close
- - platform: state
- entity_id: input_boolean.shop_test_door_opening
- to: 'on'
- condition:
- - condition: state
- entity_id: "input_boolean.shop_stop_automation"
- state: "off"
- - condition: template
- value_template: "{{ not((states('input_select.shop_status')) == 'Unknown') }}"
- action:
- - service: input_select.select_option
- data:
- option: Opening
- target:
- entity_id: input_select.shop_status
- # Shop Opening waiting for unlock
- - alias: 'Shop Opening'
- id: 'Shop Opening'
- trigger:
- - platform: state
- entity_id: input_select.select_option
- to: 'Opening'
- condition:
- - condition: state
- entity_id: "input_boolean.shop_stop_automation"
- state: "off"
- - condition: template
- value_template: "{{ not((states('input_select.shop_status')) == 'Unknown') }}"
- action:
- - wait_for_trigger:
- - platform: state
- entity_id: input_boolean.shop_lock
- to: 'off'
- timeout:
- seconds: 30
- - choose:
- - alias: "Is shop still lock?"
- conditions:
- - condition: state
- entity_id: input_boolean.shop_lock
- state: "on"
- sequence:
- - service: input_select.select_option
- data:
- option: Unauthorize
- target:
- entity_id: input_select.shop_status
- default:
- - service: light.turn_on
- entity_id: light.shop_main_bench
- - service: light.turn_on
- entity_id: light.shop_bays
- - service: media_player.volume_set
- data:
- volume_level: 1
- target:
- entity_id: media_player.shop
- - service: media_player.play_media
- entity_id: media_player.shop
- data:
- media_content_id: http://maestro.emfcdn.com/stream_for/k-love/web
- media_content_type: music
- extra:
- title: KLove
- thumb: https://cdn-profiles.tunein.com/s22561/images/bannerx.jpg?t=637102372250000000
- stream_type: live
- - service: input_select.select_option
- data:
- option: Open
- target:
- entity_id: input_select.shop_status
- # Leaving the shop
- - alias: 'Shop Close'
- id: 'Shop Close'
- trigger:
- platform: state
- entity_id: input_boolean.shop_lock
- to: 'on'
- condition:
- - condition: state
- entity_id: "input_boolean.shop_stop_automation"
- state: "off"
- - condition: template
- value_template: "{{ not((states('input_select.shop_status')) == 'Unknown') }}"
- action:
- - alias: "Repeat Paul phone if wireless charging"
- repeat:
- while:
- - condition: state
- entity_id: sensor.paul_mobile_charger_type
- state: "wireless"
- # Don't do it too many times
- - condition: template
- value_template: "{{ repeat.index <= 20 }}"
- sequence:
- - service: tts.cloud_say
- entity_id: media_player.shop
- data:
- message: Paul you are forgetting your phone!
- - service: light.turn_off
- entity_id: light.shop_bays
- - delay: 1
- - service: light.turn_on
- entity_id: light.shop_bays
- - delay: 1
- - service: light.turn_off
- entity_id: light.shop_bays
- - delay: 1
- - service: light.turn_on
- entity_id: light.shop_bays
- - delay: 1
- - wait_template: "{{ not is_state('sensor.paul_mobile_charger_type', 'wireless') }}"
- timeout: '00:00:10'
- continue_on_timeout: true
- - service: tts.cloud_say
- entity_id: media_player.shop
- data:
- message: Ok, I will be shutting down for awhile.
- - service: media_player.turn_off
- data: {}
- target:
- entity_id: media_player.shop
- - service: light.turn_on
- entity_id: light.back_porch
- - delay: 120
- - service: light.turn_off
- entity_id: light.shop_bays
- - service: light.turn_off
- entity_id: light.shop_main_bench
- - service: light.turn_off
- entity_id: light.back_porch
- - service: switch.turn_off
- entity_id: switch.shop_heater
- # Unauthorized Entry into Shop
- - alias: 'Shop Unauthorized Entry'
- id: 'Shop Unauthorized Entry'
- trigger:
- - platform: state
- entity_id: input_select.select_option
- to: 'Unauthorize'
- condition:
- - condition: state
- entity_id: "input_boolean.shop_stop_automation"
- state: "off"
- - condition: template
- value_template: "{{ not((states('input_select.shop_status')) == 'Unknown') }}"
- action:
- - service: light.turn_on
- entity_id: light.shop_main_bench
- - service: notify.paul
- data:
- message: "Unauthorized entry into shop. Time: {{now().strftime('%I:%M:%S %p')}}"
- - service: media_player.volume_set
- data:
- volume_level: 1
- target:
- entity_id: media_player.shop
- - alias: "Repeat unauthorized entry into shop"
- repeat:
- while:
- - condition: state
- entity_id: input_boolean.shop_lock
- state: 'off'
- # Don't do it too many times
- - condition: template
- value_template: "{{ repeat.index <= 120 }}"
- sequence:
- - service: tts.cloud_say
- entity_id: media_player.shop
- data:
- message: Unauthorized entry. Police is being dispatch. Cameras are recording.
- - wait_template: "{{ not is_state('input_boolean.shop_lock', 'off') }}"
- timeout: '00:00:10'
- continue_on_timeout: true
- - service: notify.paul
- data:
- message: "Unauthorized entry into shop (done). Time: {{now().strftime('%I:%M:%S %p')}}"
- - service: media_player.turn_off
- data: {}
- target:
- entity_id: media_player.shop
- - service: input_select.select_option
- data:
- option: Unknown
- target:
- entity_id: input_select.shop_status
- # nancy_need_help:
- # - service: tts.cloud_say
- # data:
- # message: Nancy this is a test, can you here me?
- # options:
- # gender: Male
- # language: en-US
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement