Event Scheduler

The idea of a timeline looks very usefull since you can easily realice which event are schedule to happen at the same time! Great work on this. Are you planning to implement it?
Regards!

I would love to implement this but since i am new to openhab, would need guidance from the leads and community.

Currently i am just going through the code to see what is happening.

Kai, Thomas and team, any pointers how i should go about it?

In terms of pointer, i was wondering if anything remotely is implemented, i should start looking into that for reference.

I was wondering if GCal is a good starting point.

@ridus, as mentioned in Event Scheduler, I think such a feature only makes sense to start on top of the new rule engine that is currently under development and be introduced in openHAB 2 within the next months. My suggestion would be to wait for its availability and then start discussing on how such a scheduler should best be implemented.

I only noticed now that you have created Bugzilla entries for that - what I meant was actually to directly enter them at Issues Ā· marinmitev/smarthome Ā· GitHub, since this is the place where the current contribution is prepared - so if there is anything important missing, better address this now instead of waiting for the initial contribution to be done.

Ooops - sorry - I thought when you said -:

You meant to open a bug (thinking GitHub ā€˜issuesā€™) :smile:

Yeah, I know that wasnā€™t clear enough. So will you enter the issues at Github then? Just copy what you had entered in Bugzilla.

Hi Chris - Iā€™ve been using Openhab for about 6 months after moving across mostly from Openremote.

I definitely agree that although it would be nice to have an intelligent home that knows when to do things - there is a real need for a calendar/scheduler front end. A simple example for me is morning wake up alarms - we have 4 children whose weekly schedules often change. Making changes to rules is too complicated and the current alarm front end is too simple. Iā€™ve tried linking to google calendar and also used IFTTT but who wants 2 apps.

Did you make any further progress with this project it looks interesting?

Cheers
Jules

@kgoderis did a lot of work in this respect meanwhile - a PR with some core infrastructure to support calendar events is currently waiting for approval: https://github.com/eclipse/smarthome/pull/1239.
He also worked on CalDAV stuff that builds on top of that, I think he will show this once the above PR is merged.
Besides this, the new rule engine will soon be added to openHAB 2, so all relevant building blocks should then be there to build nice scheduler support :slight_smile:

@Julian_Divett @chris I have code that is ready that exposes openHAB as a full fledged CalDAV server. You will be able to use any calendaring client to schedule rules, scripts and so forth, as you would do with the CalDAV binding or GCal bindings for that matter. But without the dependency of the external CalDAV server. Also, events that happen in your house/environment, can be logged in that calendar. This piece of code not only depends on the PR 1239, but also the new rule engine.

1 Like

I was keeping an eye on your work @kgoderis (nice :slight_smile:) but havenā€™t looked at doing anything myself yet. I have the calendar integrated in HABmin so might take a look at seeing if I can link this in at some stageā€¦

Great I look forward to trying this out.

Sounds awesome

Good for Event schedule and a log / house diary :slight_smile:

I can see the pull request for this was merged - is there any hints on how to do scheduling? Or any idea what development is still required to make this work?

Thanks,
Neil

Dear group,

Iā€™m following this discussion now for a while and already did some research on how such a scheduler can be done in openHAB (1.x). What Iā€™m missing in the discussion is user experience. From my experience a (more ore less) technical DSL is not suitable for the every day user.

When I think of schedulers I have in mind things like:

Heating scheduler
Jahreszeitschaltuhr

They feel and act like devices and their graphical interface hides the technical aspects of scheduling.

Also they cover the non obvious use cases for schedulers:

1.) Today is my birthday and Iā€™ve invited some guests. While normally the heating in the living room is lowered at 21:00, only today I want it to hold the comfort temperature as long as the party lasts. I want my scheduler to have a very easy way to do that. A party button, maybe?

2.) Between 30th of January 2016 and 15th of January 2016 I will be on holiday. I want the heating of my whole flat to be turned off for this duration.

3.) When the window in my bedroom is opened the heating should be turned off. When the window is closed the scheduler should remain with the scheduled heating mode.

4.) I have to leave town for two days and want my heating to be shut down for this duration. I want my scheduler to have a very easy way to do that.

5.) Iā€™m at work from Monday till Friday between 09:00 and 17:00. Between my away hours I want the heating of my flat to be reduced. On holidays this reduction should not take place because I do not have to work.

6.) Iā€™ve got ill and have to stay at home. I want a very easy way to cancel the temperature reduction for workdays.

Any thoughts to this?

Here are some examples of shedulers:

http://www.switchking.se/images/stories/switchking/screenshots/client/v3.0/SKMainDevicesBig.PNG
And:

I agree with your scheduling requirements:

  • Different modes like Home, and Away .
  • Weekday based scheduling: Mo-Fri, weekends eg. ā€œDo this on Mo, Tu and Friā€
  • Relate to sunset/rise ā€œI want my lamps to turn on 20 min before sunsetā€ or " Lamps should be turned on at 06:00 and be on until at least 08:00. if it is dark and 08:00 they should stay on, but no longer than to 09:00"

One of these examples above have javabeans code that execute, Before, On , After the sheduled event: Return code of ā€œBeforeā€ determines if event occurs. ā€œOnā€ is executed (iirc) instead of the event. ā€œAfterā€ always runs. In my view, triggered code is a nice way of being able to extend the scheduled for more complicated scenarios.

In one you create sceduled for a device, in the other you create scedules, and attach devices to that schedule. (again IIRC)

The examples Iā€™ve given maneuver devices using Tellstick, but I think that in OH it should trigger events.(?)

First and foremost the discussion should be about functional requirements and end user experience.

Hi all.
For the last ten years Iā€™ve been using a solution built by myself and a friend in PHP/MySQL (and used by a few hundred people over the world). Iā€™m starting to think about move over to openHAB instead (as both user and contributor). Iā€™m a bit confused though to see that scheduling doesnā€™t seem to be available, I thought that was one of the cornerstones of most home automation.

So Iā€™d just like to put in my five cents about features that would be useful:

First natural thing would be to do something on specific times and weekdays. For example the following schedule in our interface that for every mon-fri turns on some lamps at 05:50, off again 08:10, on again when itā€™s getting dark (below 100 lux) and then off again at 23:00:

I think our notion of a ā€œscheduleā€ containing ā€œactivationsā€ is kinda natural.

Another thing that weā€™ve got that I wouldnā€™t want to be without is a function that allows me to schedule that my engine should be warm at 07:00 every morning. The system then turns the engine heater on at the right time before departure (weā€™re using the formula (-temp/10 * 60) + 60 for this, with a roof of 120 minutes).

So is there any ongoing work on this? Anywhere I could kick in and start helping?

1 Like

Nice to see swedish :slight_smile: !

I havenā€™t seen any work, and I agree with basically everything you say.
Yes, weekdays is a reasonable way of scheduling.
( day of month, and 1st weekend of ā€¦ etc may be handy at a later stage)

Your tool seems tp be structured as:
ScheduleID
Events connected to the schedule
Timings for the schedule.

Which makes sense to me.

1 Like

Yep, I had to change the browser language to english to take the screenshot, but of course the device names is still in swedish :wink:

I think maybe it would be enough with a scheduler handling week days and let the gcal integration (no idea what the status of that is though) handle stuff happening more seldom or more irregular than that, not to overcomplicate things. But thatā€™s just another five cents :slight_smile:

1 Like

I think we should ping @Kai to give us the current state about implementation of a scheduler ā€¦ and give him the chance to meet a possible new contributor :slight_smile:

There has been some work on the core infrastructure to support this (Event Triggers) but the UI is probably a long way off. Perhaps this would be a good place you can contribute.

Right now scheduling is handled in Rules. If you want to schedule based on solar events (e.g. sunset, sunrise, etc) there is a binding that will create an event that can trigger a rule at those events or an offset from those events. For things that should happen at certain set times there are cron triggers that allow one to trigger a rule based on a cron expression.

Finally, there are some examples showing how to schedule things to occur based on editible times. This is the best we have for a UI right now and it is not satisfying.

So OH has full support for scheduling, just not through a UIā€¦ yet.

Also, be aware that OH is currently in a transition from text based to UI based configuration and administration. Before now managing scheduling in Rules handled 75-90% of all use cases.

There has been much discussion on this forum about this topic.

Any contributions would likely involve the core Eclipse SmartHome so that is where I would start.

Finally, one popular way to managing scheduling, particularly recurring schedules (i.e. daily) is through a state machine as documented here which coule easily be expanded to support day types as well.

Oh, and I completely forgot about bindings that support calendar integration.