How about a variable in the rules creator for weekends or holidays?

Nicklas Simberg shared this idea 8 years ago
Under Consideration

Today have a vertical blinds that opens when someone moves around in the house and there sufficient amount of light outside and within a time window in the morning.


This works fine, but i would like the time window to be different on weekends. Since the trigger to start the rule is not the time (its movement detect) i don't think i can use the scheduler.


Would it not be great to have a variable like the "date" and "time" for holidays or weekends.

Well it might be a bit messy building something that adopts to each country holidays but well a weekend (sat, Sunday) variable should not be that hard. If its even customize so each person could add its holiday it would be even better.

Or even import it all from some 3ed party service


Anyway my point is that i think its a good to have a variable for weekend that the rules could use in its determination.


//nic

Replies (5)

photo
1

I'm using google Calendar and Google drive (ifttt.com) to push a value to a virtual meter that i have in the Zipabox.


In this calendar i imported the standard holidays and i got it connect to my work agenda.


To only run it in the weekend you can you the puzzle:

part of the day of week

1=saterday and 7 sunday

photo
1

thanks for sharing Heros, you are a big asset for zipato and the community


I just wanted to suggest a feature for zipato to have in the rules that is not that uncommon in software that handling events and scheduling.


Will most likely do something similar when zipato fix the state and values remains after reboot of the box. Right now aim not adding any more virtual devices at all since the ones i already have had so much trouble with the unstable servers and box (i know i know its been much better lately). Just tired of house not waking up in the morning due to my virutal alarm clock device been reset. That the curtains opens up in the middle of the night due to the varible keeping track if its closed or opend have been reset. and so on....

photo
1

An other way to solve it easy: Create a virtual switch "weekend". Use the scheduler and set the virtual switch "weekend" to "on" at Saturday and Sunday and to "off" at other days. In the scheduler use the repeat function where you can select saturday and sunday. I use this for "daylight". The switch can be easily used in any rule and you can control it in the UI. This solution also works with a variable, but this you cannot see in the UI.

photo
1

@Andreas Could you please show a working example of this.

photo
2

@David: here's what I've done for weekdays and holidays.

As Andreas said, I use a virtual switch for weekdays/weekends. First add a device, choose virtual device, and then virtual switch. Call it "Weekday switch" or "Weekend switch", depending on which way around you want to do it. It's just a boolean on/off variable, basically.


Then set up a rule that runs, say, at midnight every day (I put 1 minute past midnight just in case the box takes a while to update some of its values). It tests the day of the week and sets the weekend/weekday switch accordingly. What I also do is set a "working day" switch which defaults to true on weekdays. I then have the rule check all the public holiday dates and set a "public holiday" switch. At the end, if "public holiday" is true, I set "working day" to false.


I tried HeroS's approach with IFTTT and Google Calendar, but Google Calendar, astonishingly, lacks any notion of categories. So even if you import public holiday dates from a shared calendar, there's nothing to distinguish a public holiday from a dentist's appointment (unless I'm missing something). One way to solve it is to add a keyword like "publicholiday" to the description and use that as the trigger, but since I don't use Google Calendar it sounds like more trouble than it's worth. Sort of negates the benefits of having someone else configure the dates for you. The other big problem with IFTTT/Google Calendar is that you can't trigger something when an event ends.


Instead I've just set the dates manually in one big monster rule. Most dates don't change from year to year and you know they're going to be non-working days even if they fall on a weekend. The few dates that differ from year to year I'll program in by hand once a year. I'll use the same rule to program my vacation dates.


I've attached a snapshot of part of my rule.

Replies have been locked on this page!