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

Index
Community Member

Idea: Add the ability to have some kind of virtual switch or global variable to store some kind of state. You should be able to use this state as a condition or even as a starter (value changed)

Example automation: Some devices don't have a On/Off state but only a way to toggle the current state, whatever the current state is. This notably affects IR devices like simple fans or similar. These can be controlled by IR blaster devices like the SwitchBot Mini Hub. However, since you don't know the current state of the device, you can't really use it within automations. Example:  I would like to turn off my fan when I start my bedtime routine. Since the automation doesn't know the current state of the fan, it would turn it on if the wasn't on to begin with. With the virtual switch I could synchronize/store the current state and build a routine around it. In general this would enable many more complex automations.

HatemAbidi
Community Member

+1,  I think this is the most interesting feature in this thread, having global variables that can be used in starters and conditions or to restore the state for devices will enable us to do a lot of advanced automations and it will cover a lot of use cases that we find in this thread.

Neol
Community Member

Yeah, I'm new. I really don't know anything.

Any scripting language should be able to have variables that can set and read values.

This page describes how to define inputValue with a value assigned during creation.

I did some test and these values can be accessed using $d1 for the example given.

However I'm wondering how we can change the value assign to this variable based on the state of a device? is there an action for that?

uKER
Community Member

Agreed. This is a must to be able to have some semblance of smart control of non-smart devices over IR/RF.

jstutz
Community Member

This is already kind of an option... 

Just use samsung smartthings to create a virtual light bulb... link smartthings with google home, and move that device into the home and your golden!

Smartthings also has more powerful logic for certain things, giving your automations more flexibility.

A good majority of my automations use a combination of smartthings and google home. 

Just to give you a super simple idea: I have a virtual smart bulb labeled back opened in last 20.. When my backdoor contact center is opened the virtual light turns on... if the contact center has been closed for 20 minutes, it turns off. 

then your able to have that light being off be a condition on whether to run a routine or not (i.e. don't make an announcement that there is motion detected on the back porch if the backdoor has been opened recently)

 

hope that makes sense and helps you out!

 

Batwam
Community Member

this is too convoluted. We should be looking for implementations which don't require the use of third party like SmartThings, IFTTT or Home Assistant. Likewise, I can trigger lights to turn on on Nest Cam Motion Detection by using Home Assistant but that's not the point. We should have a built-in starter based on Nest Cam Motion detection.

jstutz
Community Member

I agree, 

ideally there would be variables like this in google home, just was saying this was an easy stop gap in the meantime.. plus creating a smartthings virt switch is incredibly easy, not nearly as time or resource intensive as setting up your whole home on home assistant

Nice idea using virtual devices to store state 🙂  The feature request to have virtual devices/variables to store state is noted. 

In the meantime, another alternative to using smarthings virtual devices is to use this developer preview product to add virtual devices to your Google Home: https://developers.home.google.com/tools/home-playground  | https://www.youtube.com/watch?v=Fb7kHVLcZcM 








Tinkerer, Google Home Automations Team

Esca
Community Member

How long has this been a thing?? Geez! Why in my many many hundreds hours of searching was I able to figure out the smart things virtual switch, node red stuff, but had absolutely no inkling that this was possible "natively"??? I have been a google developer member forever, I literally scan Reddit every week for new tips like this, I don't know how many permutations of "virtual switch google home" I have googled. I literally cheered and ran around like  loon when the GH script editor came online. Yet NOW is the first I hear about this??!!

15624980
Community Member

Best thing right, being able to have the virtual switches native to Google Home, you can create many possibilities in scripted routines now. I was also like crazy looking and never found either

Index
Community Member

😲The playground is a game changer

domwhewell
Community Member

+1 This feature could boost script automation 100% variables in any scripting language is a must. This has got to be on the roadmap somewhere @Prafulla 

Moslem
Community Member

.mosigi mobe 

pkugaoqin
Community Member

This can already be done through adding virtual devices from Google Home Playground, basically using the device states to store values, and you can use conditions to trigger other routines.

 

However other than booleans I do not see any relative command that can be used as counter for loop, so unfortunately it is impossible to do any meaningful complex logic. We are only missing a counter...

I have already determined how to get it to loop. Using the virtual devices makes this a little bit easier but I still having the issue with how to stop the routine that is cycling the light colors. I can have it loop by turning off the virtual device and turning it back on with the starter being that the virtual device is turned on but I'm not sure how to get it to stop reliably. Do you have any thoughts on how I might be able to leverage conditions to do this. At the moment I have one routine that triggers a second routine to cycle the colors of the lights.Then the third routine that stops the music and turns off the devices that are cycling the colors. While this somewhat works, it doesn't seem to be ideal to consistently stop the routine to cycle the lights. Eventually this seems to time out and stop on its own but I want it to stop right away.

I agree that this option exists in other products as well. But it would be fantastic if you could build a virtual switch on Google Home. This would eliminate the need for third-party hub.

Idalar
Community Member

Great idea, I need a virtual switch, now  in some automation I use a use some devices like smartplug to run the automation and only use the smartplug for that, I would be great to use native virtual switch from Google home

IO
Community Member

Sharing my momentary solution. I would love to have it, but... since we don't know when variable would be allowed by Google. I'm (unnecesarily) using a physical device to store a Boolean in an ON/OFF Switch and a unsigned integer in a Dimmable light. I GET/SET the value when neccesary so... I can "Read" the state stored. Hopefully someone find it useful. With this idea, at least... I was able to store my variables to control the state of my air conditioner during last couple of months.

Cyberfred
Community Member

Hi

I am looking for a solution to read a temperature from a thermostat and store it into a variable to be able to synchronize it by giving this value to another thermostat. Can this case can be covered by your virtual device idea?

Best regards

Sergisoft
Community Member

You can create as many virtual devices as you want with playground:

Google Home Playground (home-playground.withgoogle.com)

Hogan
Community Member

Amen brother! Right now I have for smart bulbs tied together to create "ceiling fan lights" what the tract state is incorrect, so I have to tell it to turn on my ceiling fan lights when I want them to go off and vice versa. It would be great if the system could tell what the current tracked state is automatically. I would even settle for letting me choose the tracked State manually. I have even unpaired and repaired as well as unlinked the app and relinked it and am still having the same issue.

mikeysoft
Community Member

Is there any update from Google on if/when variables and global variables will be implemented? They are vital. Thanks.

Nanuk007
Community Member

Are you the one that can fix the Dish routine that everybody is talking about in the community? We that own Dish, for TV, cannot connect to Google Home. They said it was working up to August of this year (2023) and they quit. If you are not the one to address this can you let us know who is? Thanks

Index
Community Member

Idea: Please add the ability to have a starter based on a webhook.

Example automation: Probably many of us using the Script Editors are familar with programming and using APIs. Since there are many devices out there which don't support an integration with Google Home or similar, but provide a webhook, we could use a webhook starter as a step to integrate these devices into our automations.

Also, this wouldn't be limited to actual devices. With a webhook starter you could come up with your own complex logic somewhere which would never fit into the Script Editor's abilities.

Please please this. I desperately want to be able to start an automation from my elgato Stream Deck. 

Great idea, i've been looking for a way to get NFC to work natively or using a webhook to trigger things like a bedtime routine. It would be great if we could also just get native NFC support and that the webhooks would be done in the background.

Index
Community Member

Idea: Similar to the suggestion of having a webhook to start an automation, it would be great to be able to trigger a webhook as an action.

Example automation: With that you could call your custom logic/app/API based on something happening in your home.

Andy27
Community Member

With that you could call your custom logic/app/API based on something happening in your home.

Alphabet
Community Member

Idea: Google Assistant Query as a condition

Example automation: Turn on the sprinklers at a set time, but confirm with the user first.

Context:

The idea is to have the Google Assistant ask for confirmation. The supported devices can be phone (notification), speaker/display (asks through voice), etc. It would be similar to the `OkGoogleEvent` and `BroadcastCommand`. It would broadcast a question ("Do you want to turn on the sprinklers now?"), and expect a response which can be compared to the `is` field. For example if `is: Yes` and the user says `Yes` then the condition is true and the actions run. You could also have something like a `default` field if the user fails to respond.

I could also see this being paired with occupancy detection and home presence. Such as only ask if no one is inside but people are still home (likely outside). However, that would require conditional conditionals which I'm not sure if the current syntax supports.

Esca
Community Member

This is personally my BIGGEST pain point. I am too scared to use presence sensing for anything because the test cases I set up literally go off completely randomly. I have set up convoluted "if this nearby (light connected to a) motion sensor has not gone off for three hours, but my workbench lamp is on then I've probably forgotten it and am not nearby." But I don't want to leave myself in the dark with a live power tool or waiting motionless for something to glue if I am indeed working there still, the very reason I don't just rely on a motion detector which requires me to wave my arms about every few minutes. At the moment I flash the light 20 secs before it turns off so I can put down whatever I'm doing and get ready to turn the light back on. This is not smart enough for a smart home! Honestly being able to get a human heads up would enable us to smooth over SO MANY other smart home tech gaps, especially where my long suffering spouse is involved!

Looking for this solution for long time as well. Google should ask us a question at specific time of the day and we should be able to answer it and based on that answer it should be able to take an action.

+1 my use case is turning on a variety of devices to play xbox and I want a follow up question to see if I want a lamp turning on as well. 

mizuhaunomori
Community Member

Support for starters type: time.between
Currently, if you want to change the color temperature of lighting at a specific time of day
It seems to be necessary to create two scripts with almost the same content, one with the ON switch already turned on, and another with the ON switch turned on within a certain time period.

starters: type: time.schedule condition: type: device.state.OnOff
starters: type: device.state.OnOff condition: type: time.between

If these two are prepared, the light will not turn on when Off and will change to the specified color temperature when it turns on regardless of the state.

But this is too long.
starters type: time.between condition: type: device.state.OnOff
It would be half the work if it could be written as

If you have any other great ideas, please let me know!
Also, apologies for the difficult to read text!

Eurik123
Community Member

Idea:Use google home hub's motion sensor as trigger

Example automation: When someone comes to front of Google home, when it's dark outside, it turns on the lights

Sorry for bad English 

+1, having to buy dedicated motion sensors for my rooms is really disappointing when I already have a smart device in there that has a motion sensor.

jstutz
Community Member

PLEASE make this happen google

ha11sy
Community Member

add to this the Nest Protects, they sense motion to enable their courtesy light, this as a trigger to turn on other smart lighting would be great. I do not want to buy 25 Hue Motion Sensors