08-28-2023 07:02 PM
I picked up the new Aqara door sensor's and connected it to my v2 Nest Hub.
Trying to figure out how to create an Automation when the door opens, so that I get an alert.
I know there was a release today but it is unclear if it will work with the new Aqara sensors.
Can anyone help me out here?
08-29-2023 06:12 AM
Just did the same about 5 days ago.
automations:
- starters:
- type: device.state.OpenClose
state: openPercent
is: 100
device: Contact Sensor - Living Room
condition:
type: time.between
before: 1:00 AM # HH:MM XM (12 hours format). Adjust time as needed
after: sunset-60min # Adjust offset as needed. Supported units: sec, min, hour
weekdays:
- MON
- TUE
- WED
- THU
- FRI
- SAT
- SUN
actions:
- type: device.command.BrightnessAbsolute # Adjust device absolute brightness.
brightness: 80
devices: FX Light - Living Room
- type: device.command.SetVolume # Set the volume of a given device.
volumeLevel: 50
devices: Living room speaker - Living Room
- type: assistant.command.Broadcast
message: Welcome Home
devices: Living room speaker - Living Room
- type: time.delay
# Adjust duration as needed. Supported units: sec, min, hour
for: 10sec
- type: device.command.BrightnessAbsolute # Adjust device absolute brightness.
brightness: 60
devices:
- CW 1 - Living Room
- Hue lightstrip plus 2 - Kitchen
- type: device.command.ColorAbsolute
color:
name: orange
devices:
- Hue lightstrip plus 2 - Kitchen
- CW 1 - Living Room
- starters:
- type: device.state.OpenClose
state: openPercent
# [available operators: is, isNot, lessThan, lessThanOrEqualTo, greaterThan, greaterThanOrEqualTo]
is: 100
device: Contact Sensor - Living Room
condition:
type: time.between
before: 4:30 PM # Adjust offset as needed. Supported units: sec, min, hour
after: 2:30 PM # HH:MM XM (12 hours format). Adjust time as needed
weekdays: // Days/times my SO comes home from work.
- MON
- TUE
- WED
- FRI
actions:
- type: device.command.SetVolume # Set the volume of a given device.
volumeLevel: 60
devices: Living room speaker - Living Room
- type: assistant.command.Broadcast
message: Welcome Home, PERSONALIZED MESSAGE FOR SO
devices: Living room speaker - Living Room
Here's the script I used. Working fine lately. Going to implement suppression and presence sensing next.
08-29-2023 06:24 AM
First, the script well welcome us home when turn on the lights for our stairway and then (delayed) living room.
Second, the script triggers a personalized message for the times my SO gets home from work.
# - type: assistant.command.OkGoogle
# okGoogle: Play "Enjoy Ya Self" by "Beatchild" on Spotify App
# devices: Living room speaker - Living Room
# - type: time.delay
# # Adjust duration as needed. Supported units: sec, min, hour
# for: 30sec
# - type: device.command.MediaStop # Stop media playback.
# devices: Living room speaker - Living Room
At one point in time, it also triggered a song she has been digging lately with a slight delay to allow the personalized message to play.
08-29-2023 08:12 AM
Thanks very much
I am a bit new to this; do you have any idea if the Aqara device would be available under the automation tab in the home app?
If not; I guess I will be looking into the script editor.
08-30-2023 02:08 AM - edited 08-30-2023 02:20 AM
It would be fine if a TIMER function becomes available. I'm using it to send me a BROADCAST if the garage door is open for more than 15 minutes. But for the moment the only working routine I could create is the following and that looks very poor. So I'm looking for the option that if door opens, timer is starting. If door is closing, the closing routine will kill the timer and nothing will be broadcasted. The routine below will now also send the message if the door is just opened.
# ------------------------------------------------------------------------------------------ #
# 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: Garage door check # 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: time.schedule
at: 00:00:00 # HH:MM (24 hours format). Adjust time as needed
- type: time.schedule
at: 00:15:00 # HH:MM (24 hours format). Adjust time as needed
- type: time.schedule
at: 00:30:00 # HH:MM (24 hours format). Adjust time as needed
- type: time.schedule
at: 00:45:00 # HH:MM (24 hours format). Adjust time as needed
- type: time.schedule
at: 01:00:00 # HH:MM (24 hours format). Adjust time as needed
- type: time.schedule
at: 01:15:00 # HH:MM (24 hours format). Adjust time as needed
- type: time.schedule
at: 01:30:00 # HH:MM (24 hours format). Adjust time as needed
- type: time.schedule
at: 01:45:00 # HH:MM (24 hours format). Adjust time as needed
- type: time.schedule
at: 02:00:00 # HH:MM (24 hours format). Adjust time as needed
- type: time.schedule
at: 02:15:00 # HH:MM (24 hours format). Adjust time as needed
- type: time.schedule
at: 02:30:00 # HH:MM (24 hours format). Adjust time as needed
- type: time.schedule
at: 02:45:00 # HH:MM (24 hours format). Adjust time as needed
- type: time.schedule
at: 03:00:00 # HH:MM (24 hours format). Adjust time as needed
- type: time.schedule
at: 03:15:00 # HH:MM (24 hours format). Adjust time as needed
- type: time.schedule
at: 03:30:00 # HH:MM (24 hours format). Adjust time as needed
- type: time.schedule
at: 03:45:00 # HH:MM (24 hours format). Adjust time as needed
- type: time.schedule
at: 04:00:00 # HH:MM (24 hours format). Adjust time as needed
- type: time.schedule
at: 04:15:00 # HH:MM (24 hours format). Adjust time as needed
- type: time.schedule
at: 04:30:00 # HH:MM (24 hours format). Adjust time as needed
- type: time.schedule
at: 04:45:00 # HH:MM (24 hours format). Adjust time as needed
- type: time.schedule
at: 05:00:00 # HH:MM (24 hours format). Adjust time as needed
- type: time.schedule
at: 05:15:00 # HH:MM (24 hours format). Adjust time as needed
- type: time.schedule
at: 05:30:00 # HH:MM (24 hours format). Adjust time as needed
- type: time.schedule
at: 05:45:00 # HH:MM (24 hours format). Adjust time as needed
- type: time.schedule
at: 06:00:00 # HH:MM (24 hours format). Adjust time as needed
- type: time.schedule
at: 06:15:00 # HH:MM (24 hours format). Adjust time as needed
- type: time.schedule
at: 06:30:00 # HH:MM (24 hours format). Adjust time as needed
- type: time.schedule
at: 06:45:00 # HH:MM (24 hours format). Adjust time as needed
- type: time.schedule
at: 07:00:00 # HH:MM (24 hours format). Adjust time as needed
- type: time.schedule
at: 07:15:00 # HH:MM (24 hours format). Adjust time as needed
- type: time.schedule
at: 07:30:00 # HH:MM (24 hours format). Adjust time as needed
- type: time.schedule
at: 07:45:00 # HH:MM (24 hours format). Adjust time as needed
- type: time.schedule
at: 08:00:00 # HH:MM (24 hours format). Adjust time as needed
- type: time.schedule
at: 08:15:00 # HH:MM (24 hours format). Adjust time as needed
- type: time.schedule
at: 08:30:00 # HH:MM (24 hours format). Adjust time as needed
- type: time.schedule
at: 08:45:00 # HH:MM (24 hours format). Adjust time as needed
- type: time.schedule
at: 09:00:00 # HH:MM (24 hours format). Adjust time as needed
- type: time.schedule
at: 09:15:00 # HH:MM (24 hours format). Adjust time as needed
- type: time.schedule
at: 09:30:00 # HH:MM (24 hours format). Adjust time as needed
- type: time.schedule
at: 09:45:00 # HH:MM (24 hours format). Adjust time as needed
- type: time.schedule
at: 10:00:00 # HH:MM (24 hours format). Adjust time as needed
- type: time.schedule
at: 10:15:00 # HH:MM (24 hours format). Adjust time as needed
- type: time.schedule
at: 10:30:00 # HH:MM (24 hours format). Adjust time as needed
- type: time.schedule
at: 10:45:00 # HH:MM (24 hours format). Adjust time as needed
- type: time.schedule
at: 11:00:00 # HH:MM (24 hours format). Adjust time as needed
- type: time.schedule
at: 11:15:00 # HH:MM (24 hours format). Adjust time as needed
- type: time.schedule
at: 11:30:00 # HH:MM (24 hours format). Adjust time as needed
- type: time.schedule
at: 11:45:00 # HH:MM (24 hours format). Adjust time as needed
- type: time.schedule
at: 12:00:00 # HH:MM (24 hours format). Adjust time as needed
- type: time.schedule
at: 12:15:00 # HH:MM (24 hours format). Adjust time as needed
- type: time.schedule
at: 12:30:00 # HH:MM (24 hours format). Adjust time as needed
- type: time.schedule
at: 12:45:00 # HH:MM (24 hours format). Adjust time as needed
- type: time.schedule
at: 13:00:00 # HH:MM (24 hours format). Adjust time as needed
- type: time.schedule
at: 13:15:00 # HH:MM (24 hours format). Adjust time as needed
- type: time.schedule
at: 13:30:00 # HH:MM (24 hours format). Adjust time as needed
- type: time.schedule
at: 13:45:00 # HH:MM (24 hours format). Adjust time as needed
- type: time.schedule
at: 14:00:00 # HH:MM (24 hours format). Adjust time as needed
- type: time.schedule
at: 14:15:00 # HH:MM (24 hours format). Adjust time as needed
- type: time.schedule
at: 14:30:00 # HH:MM (24 hours format). Adjust time as needed
- type: time.schedule
at: 14:45:00 # HH:MM (24 hours format). Adjust time as needed
- type: time.schedule
at: 15:00:00 # HH:MM (24 hours format). Adjust time as needed
- type: time.schedule
at: 15:15:00 # HH:MM (24 hours format). Adjust time as needed
- type: time.schedule
at: 15:30:00 # HH:MM (24 hours format). Adjust time as needed
- type: time.schedule
at: 15:45:00 # HH:MM (24 hours format). Adjust time as needed
- type: time.schedule
at: 16:00:00 # HH:MM (24 hours format). Adjust time as needed
- type: time.schedule
at: 16:15:00 # HH:MM (24 hours format). Adjust time as needed
- type: time.schedule
at: 16:30:00 # HH:MM (24 hours format). Adjust time as needed
- type: time.schedule
at: 16:45:00 # HH:MM (24 hours format). Adjust time as needed
- type: time.schedule
at: 17:00:00 # HH:MM (24 hours format). Adjust time as needed
- type: time.schedule
at: 17:15:00 # HH:MM (24 hours format). Adjust time as needed
- type: time.schedule
at: 17:30:00 # HH:MM (24 hours format). Adjust time as needed
- type: time.schedule
at: 17:45:00 # HH:MM (24 hours format). Adjust time as needed
- type: time.schedule
at: 18:00:00 # HH:MM (24 hours format). Adjust time as needed
- type: time.schedule
at: 18:15:00 # HH:MM (24 hours format). Adjust time as needed
- type: time.schedule
at: 18:30:00 # HH:MM (24 hours format). Adjust time as needed
- type: time.schedule
at: 18:45:00 # HH:MM (24 hours format). Adjust time as needed
- type: time.schedule
at: 19:00:00 # HH:MM (24 hours format). Adjust time as needed
- type: time.schedule
at: 19:15:00 # HH:MM (24 hours format). Adjust time as needed
- type: time.schedule
at: 19:30:00 # HH:MM (24 hours format). Adjust time as needed
- type: time.schedule
at: 19:45:00 # HH:MM (24 hours format). Adjust time as needed
- type: time.schedule
at: 20:00:00 # HH:MM (24 hours format). Adjust time as needed
- type: time.schedule
at: 20:15:00 # HH:MM (24 hours format). Adjust time as needed
- type: time.schedule
at: 20:30:00 # HH:MM (24 hours format). Adjust time as needed
- type: time.schedule
at: 20:45:00 # HH:MM (24 hours format). Adjust time as needed
- type: time.schedule
at: 21:00:00 # HH:MM (24 hours format). Adjust time as needed
- type: time.schedule
at: 21:15:00 # HH:MM (24 hours format). Adjust time as needed
- type: time.schedule
at: 21:30:00 # HH:MM (24 hours format). Adjust time as needed
- type: time.schedule
at: 21:45:00 # HH:MM (24 hours format). Adjust time as needed
- type: time.schedule
at: 22:00:00 # HH:MM (24 hours format). Adjust time as needed
- type: time.schedule
at: 22:15:00 # HH:MM (24 hours format). Adjust time as needed
- type: time.schedule
at: 22:30:00 # HH:MM (24 hours format). Adjust time as needed
- type: time.schedule
at: 22:45:00 # HH:MM (24 hours format). Adjust time as needed
- type: time.schedule
at: 23:00:00 # HH:MM (24 hours format). Adjust time as needed
- type: time.schedule
at: 23:15:00 # HH:MM (24 hours format). Adjust time as needed
- type: time.schedule
at: 23:30:00 # HH:MM (24 hours format). Adjust time as needed
- type: time.schedule
at: 23:45:00 # HH:MM (24 hours format). Adjust time as needed
# ---- 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: device.state.OpenClose
state: openPercent
is: 100
device: Garage device - Garage
# ---- 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: assistant.command.Broadcast
message: The garage door is still open
01-22-2024 12:55 AM
Aqara Door and Window Sensor is now returning an error with the Script error where:
[device.state.OpenClose] is not supported by device [Garage device - Garage].
The device is now only supporting "device.state.OccupancySensing" 😕