06-17-2023 05:22 AM
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!
Answered! Go to the Recommended Answer.
06-17-2023 02:23 PM - edited 06-17-2023 02:24 PM
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.
06-17-2023 01:28 PM - edited 06-17-2023 02:43 PM
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....
Edit 2: Change the incorrect URL to the script editor as @Prafulla noticed, thanks 👍
06-17-2023 02:20 PM
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
06-20-2023 04:17 AM
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
06-20-2023 04:52 AM
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
```
06-17-2023 02:23 PM - edited 06-17-2023 02:24 PM
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.
10-25-2023 04:31 PM
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:
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