04-12-2025 04:10 AM - edited 04-12-2025 04:11 AM
Hi all,
Between sunset en sunrise I want my lights to turn on when my doorbell detects motion. I have made an automation via de app and via the script editor, both dont seem to work. I get a message on my phone that it has detected motion, but it still wont turn my lights on. If i press the play button via the dashboard it will turn the lights on. Does anyone know how to fix this?
04-13-2025 11:52 AM
What do you mean the play button on the dashboard?
Can you please post your YAML code from Script Editor in here? Also do the run time logs show as triggering in SE?
It's not hard to do what you want, with this being sample code from the code library.
https://developers.home.google.com/automations/example-scripts#motion_triggered_lights
04-13-2025 12:56 PM
Hi, thanks for your reply.
Please see my screenshot to know what i meant with the play button.
Underneath you can find the YAML code, please note that i am new to this.
The code you sent me, unfortunately does not work with the nest doorbell.
metadata:
name: Test Lights hallway # 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.event.MotionDetection # Motion has been detected by the device.
device: Deurbel in Gang - Gang
# ---- 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: device.command.ActivateScene # Activate or deactivate a scene.
# <code>false</code> to cancel a scene if it is reversible, <code>true</code> to activate a scene.
activate: true
devices: Gedimd - Gang