cancel
Showing results for 
Search instead for 
Did you mean: 

Script Editor: Share your ideas and vote on others' ideas!

Prafulla
Googler
Googler

We built the Google Home script editor to give you more control over your home automations (announcement post). We are still in the early days of the script editor, and we highly value feedback and ideas from our community to shape its future.

You can use this post to:

  • Share ideas that will help you build your next scripted automation
  • Vote on other people's ideas by clicking the "Kudos" button next to the idea

 

How do I submit an idea? Can I submit more than one idea?

To submit an idea, simply click the "Reply" button below this post and add your idea in the following format:

  • Idea: Weather as a starter 
  • Example automation: If it's about to rain today, remind me to carry my umbrella.

We encourage you to submit as many ideas as you like, but please use one comment per idea so that it's easy for others to vote on your ideas.

 

How do I vote for an idea? Can I vote on more than one idea?

To vote for an idea, simply click the "Kudos" button next to the idea that helps you with your use case. Please use your votes thoughtfully so that we can clearly understand what matters to you the most.

 

Will my idea be implemented? Will the top-voted idea be implemented?

We will do our best to prioritize what is important across our entire community and look at feedback across many channels throughout the product cycle. We will very actively use your feedback in our prioritization exercise, but cannot make any guarantees or promises that you'll see your idea/feedback implemented into the product. That said, we will do our best to address the pain points and problems our community is trying to solve.

 

We look forward to hearing your ideas!

Prafulla Rawal, Senior Product Manager, Google Home

 

1 Recommended Answer

Prafulla
Googler
Googler

Hi everyone,

First of all, a huge thank you for your feedback and ideas!  The engagement here has truly exceeded our expectations, and we couldn't be more grateful for your participation.

 

As mentioned above, we cannot make any guarantees or promises that we will implement every idea, but we are actively considering all of this feedback as we prioritize future development.

 

In the meantime, we encourage you to keep sharing your ideas and upvoting the ideas of others.

 

Thank you again for your time and input.

Prafulla Rawal, Senior Product Manager, Google Home

 

View Recommended Answer in original post

379 REPLIES 379

A solution for this is to create virtual switches, in Smartthings and link them in Google home, and put these switches in the conditions.. For example, only activate such routines if the switch is activated, otherwise it will not activate.

I created this routine here using virtual switches from smartthings.

 

metadata:
name: O quarto está gelado
description: Se depois do "Pôr do Sol", o Dispositivo "Frio" for acionado, é porquê a "Temperatura do Quarto" está entre 17°c a 22°c, e o "Ventilador de Teto" está ligado na "Velocidade Forte" com isso a "Velocidade Baixa" será ligada após 5segundos, para manter o quarto com uma temperatura agradável
automations:
- starters:
- type: device.state.OnOff
state: on
is: true
device: Frio - Clima Do Ambiente # O dispositivo "Frio" para essa rotina só irá funcionar 1h depois do "Pôr do Sol" até 1h depois do "Nascer do Sol".
condition: # Se todas as Condições abaixo forem executadas, aí sim a rotina, poderá acontecer.
type: and
conditions:
- type: device.state.OnOff
state: on
is: true
device: Ventilador de Teto - Quarto do Casal
- type: and
conditions:
- type: device.state.OnOff
state: on
is: false
device: Velocidade Baixa - Quarto do Casal
- type: device.state.OnOff
state: on
is: false
device: Velocidade Media - Quarto do Casal
- type: device.state.OnOff
state: on
is: true
device: Velocidade Forte - Quarto do Casal
actions:
- type: time.delay
for: 5sec
- type: device.command.OnOff
on: true
devices: Velocidade Baixa - Quarto do Casal
# O quarto está muito gelado de madrugada
- starters:
- type: device.state.OnOff
state: on
is: true
device: Gelado - Clima Do Ambiente # O dispositivo "Gelado" para essa rotina só irá funcionar durante a "madrugada" até o ventilador ser desligado pela manhã.
condition: # Se todas as Condições abaixo forem executadas, aí sim a rotina, poderá acontecer.
type: and
conditions:
- type: device.state.OnOff
state: on
is: true
device: Exaustor Do Quarto - Quarto do Casal
- type: and
conditions:
- type: device.state.OnOff
state: on
is: true
device: Velocidade Baixa - Quarto do Casal
- type: device.state.OnOff
state: on
is: true
device: Ventilador de Teto - Quarto do Casal
actions:
- type: time.delay
for: 5sec
- type: device.command.OnOff
on: true
devices: Exaustor Do Quarto - Quarto do Casal

dwploc
Community Member

How can we tell when a new build of the scripting system has dropped?

lasantosr
Community Member
  • Idea: Global variables from config
  • Explanation: It would be great to have a dedicated section on the config (or elsewhere) with global variables that we could use on any script, like a device, a time or even a boolean toggle for conditions. We could even have widgets on the home screen to edit those (or just the toggles)
  • Example automations
    • I might work at different times each month, so my shceduled routines must start at different times. I could declare a global config variable $time that can be easily changed from config, and use $time or $time+30min on each automation.
    • Disable some automations when there are guests at home, just by checking a toggle. (I know routines can be deactivated, but a routine script might contain several automations, some of which doesn't have to be deactivated)

A solution that I found for certain routines do not work when I have guests at home, was to create a virtual switch through the smartthings and I linked to Google Home, so whenever I'm invited, active the switch on google home, and I put that switch as Conditions in the routines that I do not want to be activated when someone strange is at home.

That's a nice idea, I'll give it a try!

 

Thanks

Koolybop
Community Member

Allow us to delete or edit the ready-made personal routines to include changing the triggers (starters) so that we can use this powerful scripting tool to create more detailed automations:

  • Good morning
  • Leaving home
  • Commuting to work
  • Workday
  • Commuting home
  • I'm home
  • Bedtime

Koolybop
Community Member

Add a "Play" button the the script editor so we can run the script from inside the editor and make changes instead of having to return to the automations screen and search for the automation.

I'm surprised this doesn't have more support. 

run.png

Koolybop
Community Member

Add holidays to conditions so that repeat automations do/do not run when it is a holiday.

I wrote a suggestion for an improved scheduler, since this one doesn't go past a week, but gosh, it needs holidays too.

dwploc
Community Member

Idea: create Personal Routines via script editor

rocord01
Community Member

Idea: Webhooks as starters and actions

Example automation: 

As starters: Calls to a Google Home webhook could be used to start an automation

As actions: Google Home would call out to an external webhook and optionally send some data with it

An example routine would be that from my Fitbit, I could use the hooks app to send a webhook request and then in turn, it turns off my light before bed.

 

Ben071
Community Member
  • Idea: Energy management
  • Explanation: It would be great to get access to current power consumption values from smart plugs, solar installations and have an ability to do math expressions on them.
  • Example automations
    • The currently generated power by solar panels subtracted by the current power consumption could be used to control the input flow of the battery to only load the battery with the excess power. Another example would be controlling air conditioning in a way to only use excess energy for it.
    • A smart plug connected to a non-smart washing machine: Once the power consumption falls below a given threshold, we know the washing machine finished and we could send a voice broadcast to all Nest speakers.

jai_sbr
Community Member

Idea: Google nest camera person detected as a starter

Example automation: Turn the lights on if a person is detected by the cameras at night. This would be much safer than just a phone notification.

jaywhyzed
Community Member

I want to set my Nest Thermostat to away mode when my Simplisafe is in Away mode, and likewise for when I'm home.

I would like a starter that is triggered by SimpliSafe state changes.

I just discovered that this exists!
`device.state.ArmDisarm` is just what I need

to set the Google Home state to Away/Home I need to use an OkGoogle command, which is a bit odd but works.

metadata:
name: Set Away on SimpliSafe Armed
description: When the SimpliSafe is set to Away, set Google Home to away as well.

automations:
starters:
- type: device.state.ArmDisarm # This function supports arming and disarming as used in, for example, security systems.
state: currentArmLevel
is: AWAY
device: SimpliSafe - Room

actions:
- type: assistant.command.OkGoogle
okGoogle: "Everyone's away"
devices: <a random device>

what about disarming the security system? 

Ben071
Community Member
  • Idea: A way to loop through and and execute a command on multiple devices, e.g. all lights of a given room.
  • Explanation: It would be great to easily use multiple devices without listing them all individually: Something like all lights in living room. Or all lights except x.
  • Example automations
    • Dim all lights in living room except the light named "TV background light" and set their brightness to 50%.

William1701
Community Member

Idea:  Provide the ability to send text strings with variables that can include math, including measured states of equipment

Reason: Considering documentation on measured states is limited, the ability to get the data is paramount. If the routine can, as part of the action, include a text to a phone that includes results, that will help trouble shoot scripts. 

Example: - action: .....type:...  message "The person at the door has been waiting for  ", motiondetectionStateDurationSec/60, " min."

 

Building on other requests to open up the data to pass more data to the script, (e.g., light levels measured by a motion sensor, identified person by camera, vehicle by camera, etc) the notifications can be more intelligent if they can be a variable included in a text string especially if the data can be processed with functions. 

William1701
Community Member

Idea: Provide the ability to include the duration of an event or the time of the event as a variable that can be used in calculations for conditions and actions

Reason: While the "for" command works in starters, it does not appear to work for conditions. Allowing the time since the event and/or duration of an event with calculations would allow for variable conditions based on other actions as well as variable responses based on varying conditions.

Example: Motion sensor at the front door detects motion, and is used to initiate a notification that someone is at the door, but only if the driveway camera detected motion for long enough to validate that someone arrived. The front door would initiate the script, but the duration of the driveway camera detected motion is needed to as a condition to avoid announcements for people leaving through the front door. 

 

If durations and time of events could be variables that can be used in functions, then that would also open up possibilities for having durations of events vary with time of day without duplicate scripts for time slots.

manishkumr
Community Member

Idea: action based on time elapsed since last state change
Example automation: I would like to broadcast a message when my garage door is open for more than X minutes

that would be useful for sure!

I have a temporary workaround if you want to do it right now though. Just use smartthings and link it with google home. Create 2 virtual dimmable bulbs in smartthings. Label the first one garage open/closed. Label the second one broadcast garage message. 

in google home create 3 automations. they can just be the standard, don't need to use script editor if you don't want to

1) if your garage sensor is open turn on garage open/closed virt bulb

2) if your garage sensor is closed, turn off garage open/closed virt bulb

3) if broadcast garage message virt bulb is on, choose custom assistant action, the type "broadcast garage door is open", or whatever you want that message to be, then turn off broadcast garage message (that way it can run again)

 

then in smartthings you just create an automation, if the garage open/closed virt bulb is on (check the box that says stays this state for how long?) set that to 15 minutes or whatever you want, if the above is met, turn on the broadcast garage message  virt bulb

Newi
Community Member

How do you add virtual switches exactly?  Is this available in the IOS app?  is it available outside the USA?  I was using the same idea with real bulbs.

They don't seems to be listed as a new user.  I guess it would be useful for google to implement these global variables asap.

jstutz
Community Member

You have to do it from a computer, just google how to create a smartthings virtual switch,

same concept, just create a virtual dimmable bulb instead of a switch (bulbs work better with google home than switches)

Newi
Community Member

Thanks but I believe you need a smarthings hub If I'm not wrong, so this defeats the point of just having a single matter controller (even though I have apple and google) I defintely don't want any more hubs or controllers - so if this is the case then definitely need google to solve this issue. 

Seems like today there is an advanced UI option which allows me to add a virtual switch - so either it takes a day to sync or it's a co-incidence the UI was updated and allows me to use it now! 

jstutz
Community Member

you actually don't need the hub! lives entirely in the cloud... 

and yes, since they've released the new ui making virt switches is much easier now

ABraswell28
Community Member
  • Idea: Nest cam motion detection as a starter
  • Example automation: start water sprinkler if animal is detected by camera

Newi
Community Member

Implement the devices.state.ObjectDetection 

So that familiar faces, unfamiliar faces, named people can be used to trigger actions.

jstutz
Community Member

I know Nest cam features such as package detection are in the pipeline... but yes, please totally open it up. Familiar faces would be a game changer

simonerancati
Community Member

Idea: be able to use the state of a Google Home / Nest to start an automation

Example: I would like to create an automation that after 30 minutes of not using a Google Home for listening music sets the volume to 50%. Ideally if someone starts using it in less than 30 minutes the automation should cancel (so it doesn’t lower the volume while listening)

jstutz
Community Member

I suggested allowing media.state to work with nest/google home speakers, you could use that pretty easily to accomplish this. Go give mine a thumbs up 🙂

Newi
Community Member
  • Idea: Turn off Presence sensing or motion controls when a robot vacuum is vacuuming a specific zone/room
  • Example automation: If the robot vacuum is in room x, then temporarily disable the motion sensors and furthermore, ensure google home doesn't think it detect you at home.

Newi
Community Member
  • Idea: Use speakers in a home as a security system by being able to broadcast specific sounds e.g. siren noise
  • Example automation:  if door is open and you are away sound an alarm x on all speakers for x mins or until home owner disables remotely.

William1701
Community Member

Idea Part 1: As an additional feature, allow the use of a speaker's noise detection as a starter. 

Example: When no one is home, if noise is detected by a speaker, notification is sent to a phone and a message is played that notifies the intruder that "they are watching you."

 

Idea Part 2: As an additional feature, allow the microphone from a home speaker to transmit the sounds to one's phone

Example: When no one is home, if noise is detected by a speaker, notification is sent to a phone and the home owner can listen to see if action is needed.

chrispatrik
Community Member

You can already broadcast a voice message in such a situation, but I don't think you can have it repeat. I already have this setup to go off when motion is detected and I am away.

As an alternative, or in addition, you could buy a cheap siren (just a few dollars on Amazon) with an adapter and plug the adapter into a smart outlet, so your action would just turn on the outlet (or multiple outlets and sirens) and the siren will sound. You can turn it off remotely by turning off the outlet. 

The one thing missing is the notification, which is desperately needed, although you might get a notification if one of your cameras reports a sound due to the siren.

DanishChida
Community Member
  • Idea: smart plug energy usage as a starter
  • Example automation: My (non-smart) washing machine can be plugged in through the smart plug and when it is done doing it's cycle it's energy usage will lower and my nest speaker can broadcast "washing machine cycle done" 

Lee139
Community Member

I'm interested in a script that can speak aloud (on a Nest speaker) notifications from any given security camera that sends notification for "Person Detected" in the video feed.

andrew12
Community Member
  • Idea: being able to create input values in a single script and then refer to them from other scripts files.
  • Example automation: my speaker group defines all the speakers, or my front door sensor, or group of sensors.   So that if you swap them in future, or change the name of them or move them from one location to another or you expand the footprint (e.g. more sensors which should have the same conditions/actions) then you just have to update one script and not lots of scripts which may refer to them. 

kessleynogueira
Community Member
Idea: to have a "Suppress routine" function.

Example automation: I want the entrance lights to come on and google wish me good morning/night when I get home from work and open the door (using the door and window sensor). However, it would be bad if I opened the door and he did it every time, since I don't have a set time to get home. With this function I could suppress the routine to be activated only once a day.