07-26-2023 11:55 PM
Dear all,
I am new to the community and would like to raise a question regarding Google-Home's new script editor.
I would like to light some lamps 15 minutes BEFORE sunset. I use a starter like this:
- type: time.schedule
# Required. Time to schedule automation. 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)
at: sunset-15min # Adjust offset as needed. Supported units: sec, min, hour
# Optional. Days of the week to run automation on.
In a first trial, this did NOT work at all (although I have to admit, that I have some more conditions, that might interfere and are responsible for not switching).
Just as a general question to the specialists: Can a NEGATIVE offset work for starters like sunset or sunrise.
Thanks for your support and any feedback!
Regards, Tom
Answered! Go to the Recommended Answer.
07-28-2023 12:42 AM - edited 07-28-2023 06:23 AM
Good point, DWB1973! I will try this and give feedback.
Thanks, so far for your valuable input!
Edit:
A code like this works:
at: sunset-15min
You can even extend this to more than 400 Minutes. For testing reasons, I used
at: sunset-405min
which leads to a switching, as desired.
BTW: I had a condition, that was not working. Need to figure out, why
device.state.online
is not read for my PHL television - but that is not part of this thread, I think...
07-27-2023 12:35 PM
I can see that they have provided two different examples for setting TimeScheduleEvent offsets in minutes - "m" and "min".
Assuming there aren't validation errors with the rest of your script, does sunset-15m also fail?
07-28-2023 12:42 AM - edited 07-28-2023 06:23 AM
Good point, DWB1973! I will try this and give feedback.
Thanks, so far for your valuable input!
Edit:
A code like this works:
at: sunset-15min
You can even extend this to more than 400 Minutes. For testing reasons, I used
at: sunset-405min
which leads to a switching, as desired.
BTW: I had a condition, that was not working. Need to figure out, why
device.state.online
is not read for my PHL television - but that is not part of this thread, I think...
08-07-2023 03:33 PM
Device.state.online does not work as a condition at the moment. https://www.googlenestcommunity.com/t5/Home-Automation/Chromecast-or-TV-state-as-condition-not-worki...