Regular schedule vs holiday schedule

Posted on
Tue Oct 01, 2019 7:53 pm
rgspb offline
Posts: 217
Joined: Apr 24, 2009
Location: Florida

Regular schedule vs holiday schedule

I'm not real sure if i'm posting this in the correct forum but we'll see. I have a set of outside lights that come on at "Evening" 100%. At "Bedtime" they dim to 30% and then turn off completely later in the morning. For Halloween I'm putting some flicker flame LEDs in these fixtures. Since these bulbs aren't dimmable I want to skip the dimming at "Bedtime" and just turn them off completely. I'm just not sure what is the best way to set up a temporary schedule for these lights without completely changing my "Evening" and "Bedtime" action groups.

Posted on
Wed Oct 02, 2019 9:01 am
Dual offline
Posts: 255
Joined: Feb 05, 2019

Re: Regular schedule vs holiday schedule

I think you can disable your normal
Schedule on the 31st and enable it on the 1st. There should be a checkbox IIRC.


Sent from my iPhone using Tapatalk

Posted on
Fri Oct 04, 2019 9:59 am
rgspb offline
Posts: 217
Joined: Apr 24, 2009
Location: Florida

Re: Regular schedule vs holiday schedule

I think really what I'm looking to do is have a Condition attached to an item in an action group:

Turn light off if variable = Holiday
Brighten light to 30% if variable = Not Holiday

For now I'm just going to change that item in the list back and forth manually

Posted on
Fri Oct 04, 2019 10:09 am
FlyingDiver offline
User avatar
Posts: 7189
Joined: Jun 07, 2014
Location: Southwest Florida, USA

Re: Regular schedule vs holiday schedule

Have this script running every night at 12:01am:

Code: Select all
# indigo.variables[1980497029] # "isHoliday"
# indigo.variables[1479852422] # "whatHoliday"

from datetime import date
import holidays

indigo.variable.updateValue(1980497029, value="False")
indigo.variable.updateValue(1479852422, value="None")

us_holidays = holidays.UnitedStates()  # or holidays.US()

if date.today() in us_holidays:
   indigo.variable.updateValue(1980497029, value="True")
   indigo.variable.updateValue(1479852422, us_holidays.get(date.today()))


That updates two Indigo variables - isHoliday (boolean) and whatHoliday (string).

Very useful.

I'm not sure if the holidays library is installed by default. You might need to use pip to install it.

joe (aka FlyingDiver)
my plugins: http://forums.indigodomo.com/viewforum.php?f=177

Posted on
Fri Nov 25, 2022 10:58 am
whmoorejr offline
User avatar
Posts: 762
Joined: Jan 15, 2013
Location: Houston, TX

Re: Regular schedule vs holiday schedule

I'm trolling the forum today looking for a better answer.... but this is how I'm doing it....
I have 6 nightly schedules.
(Reset the variables)
11:58 PM - set "SchoolDayToday" to true
11:58 PM - set "SchoolDayTomorrow" to true

(Set the variables)
12:01 S-----S: set "SchoolDayToday" to false
12:01 -----FS: set "SchoolDayTomorrow" to false

(Set the holidays from school calendar)
12:04 PM - if any "conditions list" : set "SchoolDayToday" to false
12:05 PM - if any "conditions list" : set "SchoolDayTomorrow" to false

From this point, any trigger that I want to operate differently on a school day versus a non-school day can use the above variable "SchoolDayToday" or "SchoolDayTomorrow" as a variable. This works well for morning alarm routines and stuff that monitor screen time usage, etc.

Another option for your case is to have a virtual button "Halloween Flicker Bypass Button" that bypasses your 30% dim trigger.
Add the condition to your bedtime trigger -> Bedtime: if Halloween Flicker Bypass Button" is off, then dim light to 30%
Create new trigger -> Bedtime: if Halloween Flicker Bypass Button" is on, then turn off light.

This is what my school calendar "conditions" look like, which I need to update every summer when the new schedule comes out.
Attachments
School Holidays.png
School Holidays.png (107.93 KiB) Viewed 1545 times

Bill
My Plugin: My People

Posted on
Mon Nov 28, 2022 5:55 pm
ryanbuckner offline
Posts: 1074
Joined: Oct 08, 2011
Location: Northern Virginia

Re: Regular schedule vs holiday schedule

I do something similar to what Bill and @FlyingDiver do.

Variable 1939762834 contains a comma separated list of all the school holidays (days that school is closed in my County). A schedule runs at 12:01AM to run the following. Then I use the isSchoolClosed condition everywhere needed. For example, I don't need to turn off the lights and appliances in my kids' rooms at 10AM when school is closed, because they are probably using them (or still sleeping).

Code: Select all
from datetime import date

# contains a list of all the school holidays
holiday_list = indigo.variables[1939762834].value

today = date.today().strftime('%Y-%m-%d')
a = today in holiday_list

indigo.variable.updateValue(27794980, value=str(a)) # "isSchoolClosed"

Posted on
Mon Nov 28, 2022 8:23 pm
GlennNZ offline
User avatar
Posts: 1555
Joined: Dec 07, 2014
Location: Central Coast, Australia

Re: Regular schedule vs holiday schedule

Along similar lines, there is a very simple python library holidays.

https://github.com/dr-prodigy/python-holidays

If you pip3 install, then can run scripts checking whether currently a public holiday in your location.

import holidays
us_holidays = holidays.US()
date(2014, 1, 1) in us_holidays
True

I use this to NOT turn on alarms in this case.

Worked flawlessly! (until python3 change, fixed by re-pip installing!)

Glenn


Sent from my iPad using Tapatalk

Posted on
Tue Nov 29, 2022 8:35 am
jalves offline
Posts: 744
Joined: Jun 16, 2013

Re: Regular schedule vs holiday schedule

So, running that script at 12:01, would you then set a variable to true if it's a holiday? And then use that variable when performing actions, or not performing actions, based on the state of the variable?

Running Indigo 2023.2 on a 24" iMac M1), OS X 14.4
Jeff

Posted on
Tue Nov 29, 2022 10:25 am
FlyingDiver offline
User avatar
Posts: 7189
Joined: Jun 07, 2014
Location: Southwest Florida, USA

Re: Regular schedule vs holiday schedule

jalves wrote:
So, running that script at 12:01, would you then set a variable to true if it's a holiday? And then use that variable when performing actions, or not performing actions, based on the state of the variable?
Post #4 has my complete script for setting the variable.


Sent from my iPhone using Tapatalk

joe (aka FlyingDiver)
my plugins: http://forums.indigodomo.com/viewforum.php?f=177

Page 1 of 1

Who is online

Users browsing this forum: No registered users and 3 guests