Is there an OpenHAB rules schedule editor?

1,754 views
Skip to first unread message

Blue Transistor

unread,
Sep 23, 2014, 2:30:20 AM9/23/14
to ope...@googlegroups.com
I'm just getting started with OpenHAB. I can't find any way to create a central heating time schedule from the web interface. How are people managing this? How can a user change the times that heating comes on?

Many thanks.

Ben Jones

unread,
Sep 23, 2014, 6:30:42 AM9/23/14
to ope...@googlegroups.com
Unfortunately one of the missing pieces currently. There is no date or time widget so no way of entering this sort of data via the standard UIs. You can fudge it with two number items and build the time from the hour and minute portions but it is not ideal.

Blue Transistor

unread,
Sep 23, 2014, 8:40:02 AM9/23/14
to


On Tuesday, September 23, 2014 11:30:42 AM UTC+1, Ben Jones wrote:
. You can fudge it with two number items and build the time from the hour and minute portions but it is not ideal.

Thanks, Ben.
Could someone give me some pointers to get me started?
  • Itemtype - I suppose it has to be a number for hours and a separate control for minutes. DateTime no good?
  • Where does the variable get stored?
  • How do I access it from the rule?

What I want to do is set the times and temperatures by day for a couple of heating zones.

Alternative possibiliy?: Create  separate .rule files - maybe one file for each zone & time period - and create / edit these from a php script running on the webserver. (Not accessible from internet so security isn't a big issue.) Would this work? Do all .rule files get loaded automatically and when they change?

Many thanks.

Romain Bourdy

unread,
Sep 23, 2014, 10:05:27 AM9/23/14
to ope...@googlegroups.com
Hi,

 You can possibly use Habmin to manage your rules :



I hope it has most of the feature you need.

HTH,
-RB

Le mardi 23 septembre 2014 14:40:02 UTC+2, Blue Transistor a écrit :


On Tuesday, September 23, 2014 11:30:42 AM UTC+1, Ben Jones wrote:
. You can fudge it with two number items and build the time from the hour and minute portions but it is not ideal.

Lehane Kellett

unread,
Sep 23, 2014, 12:01:12 PM9/23/14
to ope...@googlegroups.com


I have to say it was probably one of the missing items I was amazed about in OH - there's a few others too :-)

For the specific use case you mention, I use Google Calendar and the plugin. Setup recurring on/off as needed for Spring/Autum and Summer and Winter and then go and edit them for holidays etc. But a time picker and a datetimepicker would be nice in either 1.x or 2.0 as perhaps part of a more general scheduler. Whilst you can code things like 'turn on the lights 10 minutes before sunset' it would be better to be able to do it through GUI's. Example for my old 'controller' below:




Lehane

Ben Jones

unread,
Sep 23, 2014, 6:19:47 PM9/23/14
to ope...@googlegroups.com
Yep - two numbers, one for hour one for minute. Then in a rule somewhere you need to take those two numbers and build a datetime and use that to set a timer.

Here is an example of my irrigation timer. For this I have a string item which I set a list of times via MQTT (in the format HH:MM;HH:MM etc). But you should get the general idea;

var ArrayList<Timer> fullProgramTimers = new ArrayList<Timer>()

rule "Irrigation full program timer"
when
    Time cron "0 5 0 * * ?" or
    Item Irrigation_ProgramFullTime changed
then
    // cancel any existing timers
    for (Timer timer : fullProgramTimers) { timer.cancel() }
    fullProgramTimers.clear()
    
    if (Irrigation_ProgramFullTime.state.toString.length > 0) {
        for (String programTime : Irrigation_ProgramFullTime.state.toString.split(";")) {
            // work out when the program is to start
            var DateTime programStart = parse(now.getYear() + "-" + now.getMonthOfYear() + "-" + now.getDayOfMonth() + "T" + programTime + ":00")

            // if we have already past the start time then set it for the following day
            if (programStart.beforeNow)
                programStart = programStart.plusDays(1)

            // create a timer to start the program at the specified time
            logDebug("irrigation", "Setting timer to run full program at " + programStart.toString())
       fullProgramTimers.add(createTimer(programStart) [| if (IrrigationMaster.state == ON) Irrigation_ProgramFull.sendCommand(ON) ])
        }
    }
end

dgjl...@gmail.com

unread,
Oct 21, 2014, 2:43:42 PM10/21/14
to ope...@googlegroups.com
Hi, I'm just trying out OpenHAB at the moment to see if it is for me. I have to say that I am massively disappointed and surprised that there doesn't seem to be a way to create and edit schedules in the GUI. Is this something that is at least roadmapped?

Shawn Mix

unread,
Oct 21, 2014, 9:16:23 PM10/21/14
to ope...@googlegroups.com
I'll echo Lehane's comment. I use the GCal binding to do any scheduling that is time based. It's easy enough to simply create the calendar event, description = the commands, and then it can easily be modified from a nice calendar interface. Override for things like holidays is somewhat easy by simply searching holidays and deleting the events you don't want taking place, or modifying for different settings. Based on the popularity of OpenHAB in the EU market, I'm assuming that holidays generally refers to extended periods of what the US calls vacation time (not working). I could understand the usefulness in those situations to modify the schedule accordingly in an easy way. GCal is the best suggestion I have.
Reply all
Reply to author
Forward
0 new messages