cancel
Showing results for 
Search instead for 
Did you mean: 

Activate camera when Home at night

Batwam
Community Member

Hi Community! 

I’ve looked all over and seen multiple people with similar complaints, but can’t seem to find a solution to my problem. 

We’re using the Home/Away function for our cameras inside/outside the house, and this works fine. The only issue is, that I would really like for the cameras to be turned back ON when Home but at night, when we sleep. -But as far as I can tell, there isn’t an option to setup a timer/schedule, that turns on the cameras back ON at a given time of day DESPITE you being at ‘Home’…

 

At the moment, you either have to have the cameras fully on always - OR - have the cameras on while Away and Off while Home but this means that they are also off at night when I’m home -One drains battery, adds unneascesary footage to you library AND kinda disturbs your own privacy, while the other disables the cameras at night, making the system somewhat useless.   

 

Is there a smart way of going about this? I’m happy to script it if necessary.

Look forward hearing about a viable solution!

1 Recommended Answer

Thanks @Cathal_S - A quick correction that the URL to directly go the automation tab is: https://home.google.com/automations

 

Also @Batwam - if you have never created a scripted automation, here is a step-by-step guide

 

View Recommended Answer in original post

6 REPLIES 6

Cathal_S
Gold Product Expert
Gold Product Expert

Hi Batwam,

The recently released automation script editor will allow you to do this. 

Script editor:

https://home.google.com/automations

I've included below the code I tested on my kitchen camera while my home/away presence was set to home.

 

 

 

 

metadata:
  name: Kitchen Cam, Night On
  description: Turn Kitchen camera on when home but during nighttime

automations:
  starters:
    - type: time.schedule
      at: 21:10

      weekdays:
        - MON
        - TUE
        - WED
        - THU
        - FRI
        - SAT
        - SUN

  condition:
    type: home.state.HomePresence
    state: homePresenceMode
    is: HOME

  actions:
    - type: device.command.OnOff
      on: true
      devices: Kitchen Camera - Kitchen

 

 

 

 

Let us know if you have any further questions.

Edit: You can find more information and examples from the blog post linked below....

 

https://www.googlenestcommunity.com/t5/Blog/Create-powerful-automations-with-our-new-script-editor-n... 

Edit 2: Change the incorrect URL to the script editor as @Prafulla noticed, thanks 👍

 

Regards,
Cathal

Cathal_S
Gold Product Expert
Gold Product Expert

Sunset On:

 

metadata:
  name: Kitchen Cam, Night On
  description: Turn Kitchen camera on when home but during nighttime

automations:
  starters:
    - type: time.schedule
      at: sunset

      weekdays:
        - MON
        - TUE
        - WED
        - THU
        - FRI
        - SAT
        - SUN

  condition:
    type: home.state.HomePresence
    state: homePresenceMode
    is: HOME

  actions:
    - type: device.command.OnOff
      on: true
      devices: Kitchen Camera - Kitchen

 

Sunrise Off:

 

metadata:
  name: Kitchen Cam, Night Off
  description: Turn Kitchen camera on when home but during nighttime

automations:
  starters:
    - type: time.schedule
      at: sunrise

      weekdays:
        - MON
        - TUE
        - WED
        - THU
        - FRI
        - SAT
        - SUN

  condition:
    type: home.state.HomePresence
    state: homePresenceMode
    is: HOME

  actions:
    - type: device.command.OnOff
      on: false
      devices: Kitchen Camera - Kitchen

 

 

Regards,
Cathal

Batwam
Community Member

thanks for that, this is excellent!

I've implement and it appear to work. However, my understanding is that the sunset activation will only work if I'm home at sunset. If I come home after dark, the Home routine will continue to turn everything off and the Sunset routine won't kick in.

 

Is there a way to set this routine so that it:

- runs every hour so it can check if it's night time and enable the cameras then

- check if time it between sunset and sunrise

 

Alternatively, I would need to set 3 custom routines:

- Home during day: turn camera off

- Home after Sunset: turn (leave) cameras on

- Away: turn cameras on

Batwam
Community Member

also, is there a way to apply the action to all devices of a given type (ie. cameras) rather than having to list them one by one?

for the time between sunset and sunrise., I have fond the following:

```

condition:

type: time.between
after: sunrise
before: sunset

```

Thanks @Cathal_S - A quick correction that the URL to directly go the automation tab is: https://home.google.com/automations

 

Also @Batwam - if you have never created a scripted automation, here is a step-by-step guide

 

Newchinaeat
Community Member

It sounds like you're facing a dilemma with your home security cameras. To achieve the functionality you want, you might need to use custom scripting or automation. One common approach is to use a smart home platform like SmartThings, Home Assistant, or IFTTT to create a custom automation rule. You can set up a rule that turns the cameras back on at a specific time of day when you're "Home." Here's a simplified outline of what you could do:

  • Choose a smart home platform that supports your camera system.
  • Create an automation or script within that platform that triggers the cameras to turn back on at a specific time when you're "Home." You can set the time to match when you typically go to sleep.
  • Ensure that this automation only activates when the system status is "Home."
  • Test the automation to make sure it works as expected.

This way, you can have your cameras off when you're "Home" during the day and turn back on at night while you're still "Home." Keep in mind that the specifics may vary depending on your camera system and the smart home platform you choose. You may need some technical skills to set this up, but it can provide the flexibility you're looking for