06-18-2023 03:26 AM - edited 06-18-2023 03:27 AM
I would like to write a script that will turn on my porch lights when I arrive home after dark. I want to use "Presence Sensing" as the starter, and "time. Between" (after Sunset and before Sunrise) as the condition.
I have my phone setup for Presence Sensing but I continually get this error:
I checked my App Permissions to make sure Location was enabled all of the time. What else can it be?
06-18-2023 03:41 AM
Hi there,
Please have a look at the Google Nest help center link below for some troubleshooting help with the home/away assist feature.
https://support.google.com/googlenest/answer/9261396
06-18-2023 04:54 AM
I looked at the link but the trouble shooting is for when Presence Sensing doesn't work. Mine does work straight out of the Home app but I can't use it in the script editor. There I get an error message that it is not setup. That's what I need fixed.
06-18-2023 05:06 AM
Hi again,
Can you please share your full automation using the 'code' forum option.
06-18-2023 07:08 AM
metadata:
name: Turn Outside lights on # Choose a short name that summarizes important starters and actions, like “Sunset lights”.
description: When arriving home after dark # 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:
- type: home.state.HomePresence
state: homePresenceMode
is: HOME
condition:
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: sunset
actions:
- type: device.command.OnOff # Turn the device on or off.
on: true
devices: Front Porch - Outside
- type: device.command.OnOff # Turn the device on or off.
on: true
devices: Carport - Outside
06-18-2023 07:17 AM - edited 06-18-2023 07:26 AM
I stripped the comments to make it more readable. The error shows up on the 'type' statement under 'starters'
Claims that Presence Sensing is not setup in Google Home but I can use the 'Home' and 'Away' Household Routines just fine in Google Home app.
Edit: I can use 'Home' to turn on my outside lights when I arrive home but I can't condition the routine to only work during dark hours. That's why I'm attempting to do this through a script so I can control when the routing will be active or not.
BTW: Condition fields should be available to use in the Google Home app. It would make the routines so much more powerful.
06-18-2023 09:36 AM - edited 06-18-2023 09:39 AM
Hi again,
Can you try something simple like the code below just to test if the home.presence is actually working?
automations:
starters:
- type: time.schedule
at: 15:50
weekdays:
- MON
- TUE
- WED
- THU
- FRI
- SAT
- SUN
condition:
type: home.state.HomePresence
state: homePresenceMode
is: HOME
actions:
- type: device.command.OnOff
devices:
- Front Porch - Outside
- Carport - Outside
on: true
Changing the time to something soon so you can test if it works while you are set as at 'home'.
06-18-2023 12:54 PM
I had to add the Metadata but it still had an error on line 19.
06-18-2023 01:14 PM
Thank you for your testing and feedback.
I will mark this post for the attention of a Google Nest representative.
06-18-2023 01:51 PM
I'm not able to get this working either and have contacted google support about it. They ended up telling me to send this through feedback in the app with the code and title "GHT3 <34412> Presence sensing not available in public preview". i can't remember ever hearing back from anyone after submitting feedback via a google app.
My issue may differ from yours, but the outcome is the same.
In the app, the presence sensing option is not under settings for me (i'm in the public preview). I also don't see any options to use it when creating a routine in the app. The app has full access to my location at all times.
In my home, I have a nest doorbell, multiple next hubs/google tvs, etc.. happy to provide more details.
Phone: Pixel 6 PRO
Home App Version: 3.2.1.7
Android Version 14 Build #: UPB3.230519.008
06-18-2023 02:53 PM
I'm not in public view but I have tried it that way, doesn't work either way. The only Nest devices I have are a display and a thermostat. Although it is a Nest Thermostat I am not using the Nest app. During installation I was instructed to only set it up in Home, so the Nest app is not even installed on my phone.
It's odd that I can use 'Home' on the app but not on the script editor.
I currently have a work around until I can use the script correctly. For now, I setup a Smart Action in my Kasa app that triggers when my carport light comes on. If this happens from Sunrise to Sunset, then my outside lights are turned immediately back off.
Please let me know if you get this resolved, thank you.
Phone: Moto G Power (2021)
Home App Version: 3.2.1.7
Android Version 11 Build # RZBS31.Q2-143-27-11-12
I also would be happy to provide additional details, anything you need.
06-19-2023 02:23 PM
Hi folks,
@JerryInTennesse, @V0idmain, that certainly isn’t the experience we want you to have. For questions about Google Assistant for Developers and Automation Script Editor, click the links below:
We specialize in Google Nest products. If you have Google Nest devices and would like assistance with them, let us know; otherwise, I'll be locking this thread after 24 hours.
We really appreciate your expertise, @Cathal_S!
Best regards,
Dan
06-19-2023 02:39 PM
Hi @Dan_A
This new script editor is part of the Google Home web application that controls Google Home and Google Nest devices and this specific question is about users that don't have the ability to use the home/away assist feature.
Please don't close this forum thread!
09-02-2023 06:36 PM - edited 09-02-2023 06:38 PM
I’m having the same issue. Want to turn outside lights on when I arrive home and it’s after sunset and before sunrise. The home app shows my phone coming and going in the activity feed, but the lights never turn on when I arrive home. Same script as OP.
02-17-2024 12:37 PM
I have the same Issue. Was anyone able to make it work?