06-15-2023 10:46 AM - edited 06-15-2023 11:07 AM
Hey everyone!
This week, we released the script editor, a tool for creating advanced home automations, on Google Home for web and the Google Home app. Learn more about it in our community blog: New to Public Preview: create powerful automations with our script editor.
You can unlock the full potential of home automation by building advanced, personalized automations. Here are some examples that can be done only in the script editor:
We'd love to hear about how you are using the script editor. Share your favorite use cases for the script editor, and your automation scripts in the comments below!
Here are some helpful guidelines for sharing your automations in the Community discussion forum:
06-16-2023 04:23 AM
The section about variables is documented very briefly.
I would like to see a larger example using variables.
It would also be great to have the possiblity to create variables that are used inside multiple Script Automations.
Is it possible to start audio inside an action? For example my favorite podcast in the morning.
And if so, is it possible to start the podcast on multiple devices?
I only found the setInput action but i guess that means VideoInput for TVs right?
I am deeply in love with the new possibilities this offers. I am very thankful for all the work that has been poured inside this new feature.
06-16-2023 05:23 PM
Hi @Diazed - Variable support is in early stages but I would love to capture your ideas here so that other can vote on it too. https://www.googlenestcommunity.com/t5/Home-Automation/Script-Editor-Share-your-ideas-and-vote-on-ot...
Please add one comment per idea in the format suggested in the post. Thanks.
Re: your audio question, we do support OkGoogleCommand custom action that allows you to run any Assistant command as an action. See if that helps?
06-16-2023 04:28 AM
It would also be great to have the possibility to ask for a confrimation.
Have the assistant ask a question i provided as string.
If i reply with yes the condition is met.
Just an idea.
06-16-2023 05:18 PM
Hi @Diazed - May I request you to submit the Assistant confirmation idea here? https://www.googlenestcommunity.com/t5/Home-Automation/Script-Editor-Share-your-ideas-and-vote-on-ot...
06-16-2023 08:16 AM
Hi Kelan,
Are there any chances of triggering automations based on weather conditions?
Regards,
Vitor Videira.
06-16-2023 05:18 PM
Hi @Vitor_Videira May I request you to submit the weather condition idea here? https://www.googlenestcommunity.com/t5/Home-Automation/Script-Editor-Share-your-ideas-and-vote-on-ot...
08-12-2023 01:34 PM
Pls hel0 me my money from gcash account get one app unauthorized
06-16-2023 10:55 AM
Adding a fun automation that I've started building out. I have one light at home with a touch control base to turn it on/off which is handy but unfortunately also makes it easy for my cats to turn it on and off. For now, I'm starting with that light to turn it off in case my cats turn it on while I'm away from home.
I plan to expand it to some other devices in my house that my cats may be able to trigger - my kitten loves to swipe at my Nest Hub with the weather frog background. Looking forward to the camera event starters as well!
metadata:
name: Cat proofing
description: While I'm away, prevent my cats from turning on the lights
automations:
starters:
- type: device.state.OnOff
state: on
is: true
device: Office light - Office
condition:
type: home.state.HomePresence
state: homePresenceMode
is: AWAY
actions:
- type: device.command.OnOff
on: false
devices:
- Office light - Office
06-17-2023 05:15 PM
Google Photos can recognize my cat from others so I propose higher definition Nest cameras and facial recognition automations for animals 🐱
LoL
06-18-2023 09:59 AM
@Cathal_S if you haven't already, please do submit this cool idea in ideas thread.
06-16-2023 11:40 AM
Would really open a lot of options if we can use Google Calendar as a starter. Would love to create a specific calendar in Google Calendar called Smart Home Calendar. I would then create an automation if the Calendar has an event "ABC" then perform "XYZ" automation when event "ABC" starts and then perform "DEF" automation when event "ABC" ends etc. I can then create calendar events on the fly that will automate my home with ease and on a schedule.
06-16-2023 12:12 PM
Yes please
Could enter my free days and pause my morning alarm for those days.
No more waking up early on days off work
06-16-2023 05:12 PM
Hi @Diazed - Could I request you submit the alarm action idea here? https://www.googlenestcommunity.com/t5/Home-Automation/Script-Editor-Share-your-ideas-and-vote-on-ot...
06-16-2023 05:15 PM
Hi @AbeF - May I request you to submit the calendar integration idea here? https://www.googlenestcommunity.com/t5/Home-Automation/Script-Editor-Share-your-ideas-and-vote-on-ot...
06-16-2023 12:24 PM
It would be great if I could use google home hub's motion sensor and it's secret temperature sensor in code.
06-16-2023 05:11 PM
Hi @Eurik123 - Could I request you submit each of these ideas here? https://www.googlenestcommunity.com/t5/Home-Automation/Script-Editor-Share-your-ideas-and-vote-on-ot...
06-17-2023 12:40 PM
It would be great if Google offered a stand alone motion sensor.
06-16-2023 02:59 PM
Custom automations built using the script don't appear on my Google Home app, according to the documentation, it should appear in the app: https://developers.home.google.com/codelabs/create-a-scripted-automation
Any suggestions?
Thanks!
06-16-2023 05:10 PM
Hi @ThierryGuy - Google Home app features are slowly rolling out this week and next. Please ping this thread if you cannot see them by the end of the next week.
08-20-2023 06:39 PM
Hi @Prafulla, my Google Home app intermittently stops showing my scripted routines and when it stops showing them it doesn't let me create new ones within the app. I can't find a consistent pattern to when they show or not in my Home App.
08-21-2023 06:50 AM
Hmm... that should not happen. We have not seen other users reporting this. Android or iOS? Tried clearing cache? Can you try filing in-app feedback next time you don't see them? Thanks.
06-17-2023 12:37 PM
I have this same issue.
06-20-2023 06:04 AM
Same to my Home App
06-16-2023 11:17 PM
Is it possible to get a notification on my smartphone when an action has taken place?For example, I want to get a notification when the window is open for more than 10 minutes.
"home.command.Notification" doesn't seem to work no matter what I select.
06-16-2023 11:30 PM
@il_Capitano_25 custom in-app notifications are coming soon as we shared in our announcement post. Feel free to submit this idea in our idea post so that other members can vote on it as well.
08-28-2023 04:38 AM
When can we expect an update for custom in-app notifications?
The Aqara Mini Switch (connected via Matter of the Aqara M2 Hub) has recently been displayed in the Google Home App. Unfortunately, this has no function or the "on and off" buttons do not trigger. There is also no function via the script editor. Is there any way to trigger automations by pushing a button?
08-30-2023 09:19 AM
Same here. I tried different scenarios but "home.command.Notification" never send the notifications.
06-17-2023 12:39 PM
Is it possible to view automation runtime history to be able to see what automations ran when, and what the trigger for the starter was if conditional or multiple starters exist?
06-18-2023 09:51 AM
@krroller - Currently we post an event in Google Home > Activity tab whenever a scripted Automations starts. We are actively exploring ways to support better debugging and will share an update in this community whenever advanced logging / debugging capabilities are available.
06-17-2023 03:31 PM - edited 06-17-2023 03:33 PM
Unable to use "device.state.TemperatureControl" as a starter. Getting an error that it is an unknown type name. Any idea how to fix that?
#Adjust temperature based of reading from pantry sensor
- starters:
- type: device.state.TemperatureControl
device: Pantry Sensor - Living Area
state: temperatureAmbient
is: 78F
condition:
type: and
conditions:
- type: device.state.OnOff
state: on
device: Ceiling Fan - Living Area
is: false
- type: time.between
after: 12:00 PM
before: 9:00 PM
actions:
- type: device.command.ThermostatTemperatureSetpoint
devices: Thermostat One - Entryway
thermostatTemperatureSetpoint: 76F
06-18-2023 09:57 AM
Hi @JP3006 - Currently, you can use a state in an starter (e.g. device.state.TemperatureControl) only when you have at least one device in your home that reports that state to Google Home. For your scenario, can you confirm if (1) you can see "Pantry Sensor - Living Area" in the Google Home app? (2) You can see temperature value from that sensor in the Google Home app?
Also, can you share the model type of your sensor and can you check if your sensor is listed in the supported devices?
the most likely reason for this is that the devices you l
06-18-2023 12:42 PM
Yes, I can the see the sensor in the GH app under devices and climate tab, but no temperature value, which is probably the reason for the error. If I ask via voice for the temp value, I get a response back of the reported temperature. It's an Aeotec/smartthings Multipurpose Sensor.
06-18-2023 12:46 PM
Hi,
Adding on to the response above, when you go to the supported devices page linked below and check ✅ the 'sensors' box this device doesn't seem to be listed as supported yet.
https://developers.home.google.com/automations/supported-devices
06-20-2023 05:55 AM - edited 06-20-2023 05:57 AM
I am having same error message. my sensor is Tuya Temperature Humidity sensor, able to show temperature in Google Home properly.
08-15-2023 02:31 AM
Hello, I have a similar issue with getting the temperature from my Aqara temperature sensor which is in the list of supported devices, BTW.
I'm trying to set up automation via the script editor, a new Google feature. My goal is for the script to turn off the AC when the temperature, as detected by a sensor on my balcony, exceeds a certain value and the balcony door is open.
Here's the condition I wrote for the temperature sensor:
condition: type: device.state.TemperatureControl state: temperatureAmbientCelsius greaterThan: 24 device: WiFi Temperature & Humidity Sensor - Balcony
However, when I validate, I get the following error:
[device.state.TemperatureControl] is an unknown type name. Expected types: [and, or, not, time.between, device.state... (truncated for brevity)].
Interestingly, a similar condition works for humidity using HumiditySetting:
condition: type: device.state.HumiditySetting state: humidityAmbientPercent greaterThan: 55 device: WiFi Temperature & Humidity Sensor - Balcony
It seems TemperatureSetting is reserved exclusively for thermostats. However, there's a note in the documentation:
Sensors that report data covered by another trait should use that trait with the queryOnly* attribute for that trait set to true. For example, temperature sensors should use the TemperatureControl trait with the queryOnlyTemperatureControl attribute set to true.
I'm unsure how to set this attribute in the script editor. Any guidance would be appreciated.
06-17-2023 06:20 PM
Criei essa rotina através do script, porém por causa da condição de TEMPO ENTRE: 22h até o nascer do Sol, a rotina não funciona de jeito algum, quando eu retiro a condição de tempo, a rotina funciona perfeitamente, porém em qualquer horário.
A rotina seria essa; A "Led da Cama", só ligara a noite dás "22h até o nascer do Sol", se a "Luz do Quarto" estiver desligada e o "Ventilador de Teto" estiver ligado.
"<# ------------------------------------------------------------------------------------------ #
# 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: Led da Cama # Choose a short name that summarizes important starters and actions, like “Sunset lights”.
description: A "Led da Cama", só ligara a noite dás "22h até o nascer do Sol", se a "Luz do Quarto" estiver desligada e o "Ventilador de Teto" estiver ligado # 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; “condition” is 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.OnOff
state: on
# [available operators: is, isNot]
is: true
device: Sensor do Quarto - Quarto do Casal
# ---- 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”, “not”.
condition:
type: and
conditions:
- type: device.state.OnOff
state: on
# [available operators: is, isNot]
is: true
device: Ventilador de Teto - Quarto do Casal
- type: device.state.OnOff
state: on
# [available operators: is, isNot]
is: false
device: Luz do Quarto - Quarto do Casal
- type: time.between
# Optional. Accepts either clock time (10:00:00 AM, with seconds optional, or in a 24 hour format), or 'sunrise' or 'sunset', with an optional offset ('sunrise+10m', for instance)
before: sunrise
# Optional. Accepts either clock time (10:00:00 AM, with seconds optional, or in a 24 hour format), or 'sunrise' or 'sunset', with an optional offset ('sunrise+10m', for instance)
after: 22:00 # HH:MM (24 hours format). Adjust time as needed
# Optional. Days of the week to apply condition on.
weekdays:
- MON
- TUE
- WED
- THU
- FRI
- SAT
- SUN
#of the week to apply condition on.
# ---- 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.OnOff # Turn the device on or off.
on: true
devices: Led Branco - Cama do Casal
- type: time.delay
# Adjust duration as needed. Supported units: sec, min, hour
for: 1sec
- type: device.command.OnOff # Turn the device on or off.
on: false
devices: Led Branco - Cama do Casal
- type: time.delay
# Adjust duration as needed. Supported units: sec, min, hour
for: 5sec
- type: device.command.OnOff # Turn the device on or off.
on: true
devices: Led da Cama - Cama do Casal
- type: time.delay
# Adjust duration as needed. Supported units: sec, min, hour
for: 2sec
- type: device.command.OnOff # Turn the de
vice on or off.
on: false
devices: Led da Cama - Cama do Casal />"
Obs: deveria funcionar, porém não funciona por causa da condição "tempo entre" e isso está acontecendo em todas as rotinas que estou testando com essa mesma condição de tempo.
06-18-2023 10:14 AM
Olá, obrigado pela sua pergunta. Eu não falo português, então desculpe qualquer erro de tradução.
Posso solicitar que simplifique o script para identificar a parte que não está funcionando? Você pode usar um dos exemplos de nossa documentação que usa a condição time.between e ver se isso funciona? Em caso afirmativo, você pode adicionar gradualmente outras partes do seu script?
Além disso, ao compartilhar seu exemplo, você pode usar o formato de inserção de código </> para que ele seja renderizado corretamente.
06-18-2023 01:35 PM
Obrigado pela atenção ✌🏼
Mesmo usando um exemplo de script bem simples, não funcionou...
Uma observação, essa função de condição com horário e dias da semana, nunca funcionou pra mim, nem no app do Google Home 😕 e olha que eu sempre tento utilar essa função, que é fantástica, mas nunca deu certo nas minhas rotinas, estava esperançoso que com as rotinas por script, essa função iria funcionar pra mim.
06-18-2023 02:53 PM
Esse script parece certo para mim.
1) Você pode confirmar se o script está marcado como ativo?
2) Funciona se você remover todas as condições?
06-18-2023 02:55 PM
A rotina está "Ativa" e se eu removo as condições, a rotina funciona perfeitamente.
O problema é com essa condição de intervalo de hora. 😕