Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- # ------------------------------------------------------------------------------------------ #
- # Lines starting with “#” are comments and will be ignored by the automation.
- # Indentation determines hierarchy within the script.
- # Visit g.co/home/script-editor-docs for full documentation.
- # ------------------------------------------------------------------------------------------ #
- metadata:
- name: Alarm # Choose a short name that summarizes important starters and actions, like “Sunset lights”.
- description: Scripted automation # Write a detailed description that includes everything the automation does, like “At sunset, on weekdays, close blinds, turn on lights to 50%, and play the sunset playlist on certain speakers.”
- automations:
- # “starters” and “actions” are required; “conditions” are optional.
- # Use Ctrl + Space to see autocomplete suggestions.
- # ---- STARTERS ---- #
- # Starters describe events that will start the automation.
- # To add more than one starter, duplicate the "- type" section under "starters".
- # If you add multiple starter events, any one of them happening will start the automation.
- starters:
- - type: device.state.OpenClose # For devices that support opening and closing, and in some cases opening and closing partially or potentially in more than one direction.
- device: Back Door - Kitchen
- state: openPercent
- # [available operators: is, isNot]
- is: 100
- - type: device.state.OpenClose # For devices that support opening and closing, and in some cases opening and closing partially or potentially in more than one direction.
- device: Front Door - Front Door
- state: openPercent
- # [available operators: is, isNot]
- is: 100
- # ---- CONDITIONS ---- #
- # Conditions are optional. Delete this section if it’s empty.
- # Conditions will prevent an automation from starting if the conditions aren’t met.
- # See g.co/home/script-editor-docs for documentation about how to use logical operators like “and”, “or”, and “not”.
- condition:
- type: home.state.HomePresence # For devices that support opening and closing, and in some cases opening and closing partially or potentially in more than one direction.
- state: homePresenceMode
- # Indicates the percentage that a device is opened, where 0 is closed and 100 is fully open. [available operators: is, isNot, lessThan, lessThanOrEqualTo, greaterThan, greaterThanOrEqualTo]
- is: AWAY
- # ---- ACTIONS ---- #
- # Actions will start when a starter event takes place and all conditions are met.
- # Actions will start in the order they appear in the script and with any delay specified.
- # To add more than one action, duplicate the "- type" section under "actions".
- actions:
- - type: home.command.Notification
- title: Alarm Triggered
- body: A door has been opened while you were away
- members:
- - type: device.command.SetVolume # Set the volume of a given device.
- # The target volume level.
- volumeLevel: 100
- devices: Living Room speaker - Living Room
- - type: device.command.SetVolume # Set the volume of a given device.
- # The target volume level.
- volumeLevel: 100
- devices: Master bedroom speaker - Master bedroom
- - type: device.command.SetVolume # Set the volume of a given device.
- # The target volume level.
- volumeLevel: 100
- devices: Utility Room - Utility
- - type: device.command.SetVolume # Set the volume of a given device.
- # The target volume level.
- volumeLevel: 100
- devices: Kitchen display - Kitchen
- - type: assistant.command.Broadcast
- message: Intruder Alert! Intruder Alert! Intruder Alert! Intruder Alert! Police have been dispatched to your location
- devices: Living Room speaker - Living Room
- - type: assistant.command.Broadcast
- message: Intruder Alert! Intruder Alert! Intruder Alert! Intruder Alert! Police have been dispatched to your location
- devices: Master bedroom speaker - Master bedroom
- - type: assistant.command.Broadcast
- message: Intruder Alert! Intruder Alert! Intruder Alert! Intruder Alert! Police have been dispatched to your location
- devices: Utility Room - Utility
- - type: assistant.command.Broadcast
- message: Intruder Alert! Intruder Alert! Intruder Alert! Intruder Alert! Police have been dispatched to your location
- devices: Kitchen display - Kitchen
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement