Ephemeris shedule negation or extension for "workdays"

  • Platform information:
    • Hardware: x86/16GB/512GB
    • OS: MacOS10.13
    • Java Runtime Environment: Zulu 11VM
    • openHAB version: 3

Hi,

i am trying to establish rules for my rollershutters with the UI.
I use the astro binding (which works fine) but would like to make exceptions on weekends and bank holidays.

I do not see a possibility to have exceptions (But only if):
weekday AND not a holiday (=> sleeping in and not have the rollershutters open on daylight…)

Am i missing something?
Is there a possibility to extend the ephemeris shedule with workdays (== (weekday && !holiday)).
I think this is something VERY common…

Could also use this for turning on the coffeemachine, change the heatingshedule etc…

Not sure if I got your point.
See Actions | openHAB.
Ephemeris uses a global calendar depending on your country and if defined region.
The actions that are available can be used to identify if today is a holiday.
Togehter with this information you should be able to define an item that contains true/false for your variable workday.
In case the global calendar does not contain a specific day e.g. family birthdays you can add them to your calendar and use the documented functions to also take into account these special days.

Hi Wolfgang,

thank you!

Yes - this a possible workaround.
Yet - i still feel like this is something basic, that should be part of ephemeris by default (or the option to negate).

Why don’t implement a rule, that checks want kind of day ist: Workday, weekend, holiday or something like this.
Maybe this gives you a little more input:

Hi Florian,

that is what i did. Yet - this feels odd, but it works
I feel it is strange that something basic/common like workday (== having to get up early) is missing in ephemeris via UI.

For me this is an important exception to a lot of time based rules (heating the bathroom early, coffeemachine on early, opening the rollershutters on daylight).

I understand your point, but for me exatly that point would not work as i in my house have more variables that define scheduled rules. Not every workday means bathroom at 7 o’clock at 24° degrees. On some workdays it needs to be at 6 and on others at 07:30.
So for me such a function would be useless. I think that is the reeason it is not in the UI

Well, for me (us) it is multiple people, there is always someone who has to get up early.
I’ll see if i can file an extension with the devs…

In Settings / Ephemeris I can see a field for Weekend, Country and Region. All what is not weekend must be a workday.

I had written this information in a file ephemeris.cfg in the folder openhab-conf/services. In my case:

region=nw
city=Fröndenberg/Ruhr
dayset-workday=[MONDAY,TUESDAY,WEDNESDAY,THURSDAY,FRIDAY]
dayset-weekend=[SATURDAY,SUNDAY]

Not sure if this above was completely necessary, but I had also since openHAB 2 in the openhab-conf/services/runtime.cfg these settings:

org.openhab.ephemeris:dayset-weekend=[SATURDAY,SUNDAY]
org.openhab.ephemeris:dayset-school=[MONDAY,TUESDAY,WEDNESDAY,THURSDAY,FRIDAY]

With these information I check in my rules (DSL) for

isBankHoliday == false && isWeekend == false

If one of these is true, then we have a normal workday.

You can create a Script Condition and do anything that can be done in code. Here is what it would lok like in Rules DSL

Select to add a Condition under “but only if” and select “Script Condition”. Then select your langauge and put in the condition under which the rule should run. Using Lars’s example the code would be:

!isBankHoliday && !isWeekend

That’s it. If it’s a bank holiday or a weekend that statement will evaluate to false and the rule’s actions won’t run.

The non-script based options through the UI are very simple and very limited. When that can’t do what you want you must move to using scripts. A lot can be done in Blockly to ease the transition but in this case Ephemeris Actions are not yet available.

Frankly this really has nothing to do with Ephemeris really. It has to do with what is available in the menus in the rules UI. And there is just way too much to put every single combination of everything possible into those menus. Once you extend beyond what the basic point and click stuff can do you have to move on to the more advanced capabilities.

And every user runs up against something that makes them thing “there has to be an easier way.” The problem is every one of them runs up against a different something. We can’t make everything simple or else we lose capabilities.

Wolfgang’s approach isn’t a work around. It’s one of the ways to implement what you are after. I’ve presented another.