HABPanel widget: Virtual Thermostat/OnOff Appliance scheduling

Tags: #<Tag:0x00007f1e5f372a38>
(Guido Ottaviani) #64

Because I already have InfluxDB installed to graph some variables (https://guiott.com/?page_id=2828) it was enough to add this line in the influxdb.persist:

HVAC_Mode, HVAC_Schedule : strategy = everyChange, restoreOnStartup


(Guido Ottaviani) #66

Hoping to help someone else, I’m keeping to share my small steps here. Please let me know if it could be useful. That’s still very raw but it works.
After the layout changes, I’ve added a check on the Thermostat version of the rule to perform an action when the temperature is outside a desired range, considering an hysteresis to define the comfort range where the heater/cooler is off. It avoids too frequent switches of the system.

The status of the system is reflected by the color of the knobs bars:
RED (HOT) = actual temperature is over the setpoint plus hysteresis
GREEN (COMFORT) = actual temperature is within comfort range
BLUE (COLD) = actual temperature is below the setpoint minus hysteresis

to do that something changed on ohscheduler.tpl.html and on ohscheduler.css.
The actions are on the rule “Thermostat Action” in the OHSchedulerHVAC.rules file.
It needs a further item for each gauge requiring a slight change in the widget configuration.
The knobs bars color is managed by the setKnobColor() function in
ohscheduler.js file.

The whole package can be retrieved here:
this is just a little add-on to the great original job from Geo.

Any comment is welcome.


(Paul Broughton) #67

Hi, firstly can I say I think this widget is brilliant, exactly what I was looking for. I have a small issue that I was hoping somebody may have seen before… Its the dials, for some reason my dials are displaying “in reverse”. So the colours are showing to the left for some reason and then when I try adjust a target temperature it then tries to jump to the right and it gets messy… I also can’t seem to very get to a target of zero… mine seems to stop at 18… really odd, as far as i can tell everything is working fine aside from that. I am getting events come through and the schedule changes register just fine.

… I did a bit of playing about with values… seems the problem manifests when you set the temp min to anything less than 1… not had time to work out why thats the case but thats at least how to reproduce it.



(Lorenzo Giordano) #68

Hi, very nice job !! This is much better than mine :slight_smile:
I am testing the use in these day and making some css changes to fit to my habpanel.

I am using the HVAC Scheduler as follow:
with HVAC Mode = Auto the HVAC_Target_Temp change following the next scheduling
with HVAC Mode = Manual the HVAC_Target_Temp is set according to the Knob widget manually

Now, moving from Manual to Auto mode the HVAC_target_temp remain as it is until the next schedule.
I would like that on HVAC Mode changed to “AUTO” the HVAC_Target_Temp is immediatelly set to the last scheduled temperature.

I will try to write a sample:

Suppose my schedule are Sun at 12:00 T=21°C and Sun at 22:00 T=18°C
It is Sun at 19:00, I was out and I set Manual mode with T=17°C, I came back home and I set Auto Mode:
Until 22:00 the Temp set remain 17°C, while I want it immediatelly set to 21°C.

My problem is how to calculate the “last scheduled temperature” … Do you have any idea where I can start calculating the last scheduled temperature?



(Alon Levy) #69

this this out as well on OH2.4
however i have implemented only OnOff commands,
i was able to show and control manually light, however the schedule doesnt seems to work.
the onOff mode, and onoff schedule items set sucessfully,
i have implemented a schedule for certain amount of time, however nothing is fired.

logs shows when setting schedule/Manual or adding new schedule - the relevant strings mare updates:
i added logInfo to the Strings - and they are updated fine:
10:03:00.001 [INFO ] [cript.update fired for scheduled rule] - update fired for scheduled rule 10:03:00.002 [INFO ] [.smarthome.model.script.onoffmode is:] - SCHEDULE 10:03:00.003 [INFO ] [thome.model.script.onOff Schedule is:] - {"CorridorDimmer_CorridorLight":{"D1":{"T1005":5}}} 10:03:00.003 [INFO ] [smarthome.model.script.OnOff Next is:] - NULL 10:03:00.004 [INFO ] [marthome.model.script.OnOff queue is:] - NULL

on 10:05 - the switch didnt turned on for 5 minutes…

cron seems to run fine.

any idea?

EDIT: Found the problem - forgot to add grpOnOff to the switch i control…
now everything seems to work fine


(Stuart Hanlon) #70

Hello @nepotu

Thank you for taking the time to create this amazing timeline widget.

It took me a little while to get my heat around the basics, but it’s certainly working for me now.

One tiny thought occured to me, Is it possible to add different states to the OnOff scheduler?

For example, if I wanted to use a colour picker or dimmer, it would be great if I could choose the colour or % for the ON command.

I did add different Mode options, but I don’t really understand if that field refers to the mode of the scheduler, or the operational Mode of the Item.

for example, I tried


My use case is for a colour picker and dimmer in a living room.

So that I can set different dim levels or colours in the room with your scheduler.

Thanks again,



A couple of hours after posting this, I’ve thought of another use case…

It would be great to be able to schedule a radio channel change…

ANYTHING to automatically avoid a certain DJ at 2pm…

Or 9am on a Sunday


(Michael) #71

Great work!

I would like to use the “modified” widget from guiott, but somehow I didn’t get it to work as I want:

Topic 1

I tried to switch to german by modifing ohscheduler.js but this doesn’t change the language ?

Is there another way which I missed ?

Topic 2
There is only the button AGGIUNGI and not two, corresponding to ADD/DELETE


(Michael) #72

One Problem solved! I’ve to clear the browser cache :slight_smile:

now it looks fine:

Still missing the “button” for update/delete

any ideas, where to look ?


(Geo Magadan) #73

Hello everyone! For the past couple of months I had no spare time to continue the work on this widget or to assist those in need. Things will not change anytime soon, therefore you will have to rely on self study/trial and error.

@ All sorry for the delayed reply. I assume that most of you have already figured everything out until now.

@pmbsa The values appear in reverse because they are below the minimum value (18 if IIRC).

@Foxejoe The target temperature value will not change when the mode changes. The rule file initiates the target temperature (looks at the previous scheduled value) in the case it is not yet set. You have to change the rule in order to achieve what you desire. Look for “// [fail-safe] Init target temperature if not set” and change the condition in the if statement or add the below block after it (haven’t tested this, but it should work, unless there is something wrong in the syntax).

if (prevVal !== null && HVAC_Mode.state == 'AUTO') {
    logInfo('temperature-control.rules', 'Target temperature for item ' + targetItem.name + ' set to : ' + prevVal)

@MDAR The Modes switch allows you how to run the automation (e.g. use a schedule to control the temperature or when to start some appliance for a defined amount of time). What you want to achieve implies lots of changes in all the files (widget and rules) because you need a 3rd mode (currently this widget supports OnOff appliances and Thermostat schedules) that will allow you to set additional “variables” in your schedule item (e.g. something similar to OnOff mode, but with another option to set the intensity/color).

@tarabas the Update/Delete option appears when you edit items from your schedule (double click on the values from Zeitplan tab). For this you will need to first add something in the schedule.

PS1: haven’t tested this with OH 2.4, hence I cannot guarantee it will work without some code changes.

PS2: I have posted the code to GitHub, hoping there will be someone more experienced to continue the work on this widget.

1 Like

(Dmitry) #74

Hi -maybe somebody can help wih that:
Schedule is not working and there is erroe in log:
2019-03-17 21:40:00.353 [INFO ] [ome.model.script.onoff-control.rules] - OnOff Appliances control error: java.lang.ArrayIndexOutOfBoundsException: 1

Any Idea with this issue?