cancel
Showing results for 
Search instead for 
Did you mean: 

check if home

111111111111112
Community Member

Am i missing something? The app can only see if I leave or enter a certain location? Is it not simply possible to have an automation that checks whether I am in a location before determining if it should proceed or not? I want my lights to turn on at sunset but only if I am actually home. This seems like the most logical thing ever to do, but it can't be done?

16 REPLIES 16

15624980
Community Member

Hello! You can create a virtual Google playground switch, and to create this routine, I created a virtual switch, with this same purpose and it worked. 

111111111111112
Community Member

How do I make a 'virtual google playground'? 

ToemPoes
Community Member

Will this help?

metadata:
  name: Turn on light in garage at sunset
  description: Turn on light in garage at sunset when I am at home
automations:
  - starters:
      - type: time.schedule
        at: SUNSET
    condition:
      type: home.state.HomePresence
      state: HomePresenceMode
      is: HOME
    actions:
      - type: device.command.OnOff
        devices:
          - light2 - Playground
        on: true
ToemPoes

111111111111112
Community Member

Is it some kind of script? Where do I put this? 

Hi,

In the web version of Google Home; 

home.google.com

ToemPoes

111111111111112
Community Member

Okay, I didn't know there was a web version. Thank you. 

You have to go to Google Home Web:  https://home.google.com

Use the script editor and paste the code. Validate Save and Aktivate the Script.

ToemPoes

111111111111112
Community Member

I am trying to test this but the devices that are under 'linked to you' in the app don't show up on the web version.

Can you see the lights in the Google Home App and can you turn them on/off there??

 

 

ToemPoes

111111111111112
Community Member

I managed to find a smartplug, I had to add it to a 'home'. Now the page tells me I need to activate presence sensing and it should be under 'home features' section but it isn't there.

111111111111112
Community Member

Okay, so I found it. It's nowhere near where it's supposed to be, but in fact hidden behind some icon in the upper left corner of the first screen of the app.

Anyway test is not working.

 

[code]metadata:
name: Turn on schildpadlamp test
description: Turn on schildpadlamp test
automations:
- starters:
- type: time.schedule
at: 23:55
condition:
type: home.state.HomePresence
state: HomePresenceMode
is: HOME
actions:
- type: device.command.OnOff
devices:
- Schildpadlamp - Den
on: true[/code]

 

The device did not turn on at 23:55

Hi,

Did you enable your phone location for presence sensing?

If not, check this:

https://support.google.com/googlenest/answer/10071810?hl=en

ToemPoes

I did and it was on, but the 'home' I was using as once that I had created like two smartphones ago, so I decided to make a new home and try again and now it does work. 

Thank you for your help so far. 

Quick question: if I wanted my device turned on @ x minutes before sunset would that be possible?

Hi, i think it is possible. 

time. shedule

at: sunset+/-your time

regards

111111111111112
Community Member

I tried this but it gives an error: 

at: SUNSET-00:05:00

 

111111111111112
Community Member

Nevermind got it to work with:

at: sunset-5min