HABPanel widget: Virtual Thermostat/OnOff Appliance scheduling

Tags: #<Tag:0x00007f6173d0f418>

Sometimes it works, sometimes it doesn’t. All the times I made it work was creating the items with the PaperUI but not always.

Is there a difference for the widget having the items in .items file or under PaperUI?


Hello Jose,

Sorry for the delayed reply, but I haven’t had time to reply sooner. It should not matter if the items were created from the PaperUI or via text files (.items).

The problems you are facing might be related to one of the following:

  1. A widget configuration issue (e.g. not all items defined/configured - the running mode item might not be defined)
  2. Some bugs in the code

In any case it would be really useful to have more details (the log from the browser console -F12-)

In the past couple of weeks I had no time to work on this. I have a reworked version that fixes some bugs and introduces some new options (multiple instances on the same screen, possibility to hide the status tab and/or the running mode one), but I have to test it thoroughly before publishing it.

Kind regards,

Hi Alessandro,

After all night, I can see in Chrome the virtual thermostato UI perfectly (it happened the other day the same). In IE does’nt work yet.

I’ve pasted the java console output in IE, but in Chrome I don’t know how to access to it to compare, I’ve tried F12 without sucess.


I am sorry but I haven’t tested this on IE, nor do I plan to do so.I have tested this on Chrome and Firefox and both work. I use IE only if I am forced to do so (like corporate apps that work only on IE).

PS: the new version is now being tested and will be published in the near future.

Hi Geo,

The line that is wrong for IE is $scope.$watch(() => $ohs.ohs_knobs, function(newKnob, oldKnob)

But I cannot understand the syntax of that line because it is not like the the rest of $scope.$watch.


I am not a developer, hence my knowledge is limited. That is an arrow function, which is not supported by IE 11. Could this be fixed with an workaround? Most likely, but as I said I have no intention to spend time to “fix” IE issues, for the time being.

You can try to replace that watch with this piece of code generated by babel:

$scope.$watch(function () {
    return $ohs.ohs_knobs;
}, function (newKnob, oldKnob) {
    if (!ohsTools.knob.readOnly && OHSFactory.getOHSconf().tab_idx == 0 && oldKnob && ohsTools.knob.watchOn) {
        var loopOn = true;
        ohsTools.knob.timeout = $timeout(function () {
            ItemsFactory.getOHSitemslist().forEach(function (item) {
                if (newKnob[item.readItem].value != oldKnob[item.readItem].value && loopOn) {
                    OHService.sendCmd(item.setItem, newKnob[item.readItem].value.toString());
                    loopOn = false;
        }, 1000);
}, true);

This looks like the perfect solution for controlling my Homematic thermostats, but i’m struggling to get it to work. Currently, the items file won’t load:

Configuration model 'OHScheduler.items' has errors, therefore ignoring it: [11,136]: mismatched input '}' expecting RULE_ID

[13,136]: mismatched input '}' expecting RULE_ID

[15,136]: mismatched input '}' expecting RULE_ID

I’m not too sure what to put in for the RULE_ID

Also, the image for the WIdget settings is very low res so I can’t quite see the settings, could you repost it please?

Thank you.

Thank you, Geo.

I haven’t tried yet the part for IE but I captured the errors in Chrome whenever I change variables associated with OHSchedule. It seems that after several hours it works. The error is that Chrome does’t find replace function as you can see in the following screenshot:

Any ideas?

@ Pat Rooney it seems the items files has an error. Please note that the lines 11,13 and 15 end with “{}”. There you should put your binding config for the temperature items. If no such binding available, and you want to set the item value manually (e.g. from rules for testing purposes) then you should remove those curly braces.

@ Jose I think the error appears because the state for your RUNNING MODE item is empty. This was already fixed in the next version.

Hi Geo,

Yes, I removed the curly brackets, I knew about it. I thought too about uninitialized variable. I’ll wait for next version.

Best Regards,

hi guys,

im facing below error in the log:

2018-03-18 16:40:54.414 [ERROR] [ore.transform.actions.Transformation] - Error executing the transformation 'JSONPATH': Invalid path '$.D2' in '{D1:{}, D7:{T1645:60}}'
2018-03-18 16:40:54.417 [INFO ] [ome.model.script.onoff-control.rules] - OnOff Appliances control error: java.lang.ArrayIndexOutOfBoundsException: 1
  • also, i’m using on/off mode only, what widget fields i should fill?.. cause the widget include AC fields also…

  • how can i schedule to turn on or off any items?


@Mohammad_Chaaban there were some changes in the transformation service. Tomorrow I will post a new version of the widget, including the updated rules file which contains a fix for the above issue.

I have uploaded the latest version (1.0 RC). This version should be stable and hopefully bug free (at least on Chrome and Firefox).

For those using the previous releases please keep in mind the following:

  • The widget resources/file names are now in lowercase
  • The config variables are changed to camelCase for unity (instead of underscores), hence you might have to reconfigure the widget. I strongly recommend removing the previous version and starting from scratch as it should take only few minutes (sorry for the inconvenience).

Please check the OP for download link and changelog.

PS: If no bugs will be reported in the next couple days I will publish the code to github.

Great work,

This was one of the thing we missing in openhab, good scheduler. You managed to make it really ease for setup.

I have only one issue to report, and to give one suggeston.
Issue is that when I schedule time to 23:50, on timeline, this schedule is beyond visible area. See it on image:

Suggestion is related to visual style. You have fixed color values for background, and knobs. Is it possible to use variables from HABPanel. That way widget will not have visually different style when on panel together with other widgets:

I can see there is --primary-* variables (or similar), but not good with CSS to change it on my own.


Hello Branko,

I forgot about the timeline issue. I think I have a fix for this, but haven’t tested it yet. This appears because I used option type “point”, instead of “box”, which had its bigger issues.

The style sheet was not in my focus. This will probably be addressed in a future release. For the time being you can edit the CSS file (lines up to 175, everything after is from vis.js style sheet with minor modifications).

The knobs style is hardcoded in ohscheduler.js (function initKnobs lines 480 to 515). In the current widget format it will remain hardcoded as I simply cannot add them to the settings page (there are too many and you have to scroll in order to configure the widget). Maybe in the future, if Yannick decides to allow us to have tabs in the custom widgets settings page.

If you want to easily change the knob format I suggest the following workaround:

  • add a “standard” knob widget and configure it
  • go to settings to see the configuration (click on the “Edit the local panel configuration (experts only)” link)
  • identify the newly added knob and copy it’s configuration
  • now you can remove the know and edit the ohscheduler.js file and replace the knob parameters one by one.

PS: I am not a web developer, hence such fixes, as CSS, will need a bit of research and will take a while until published.

Kind regards,

1 Like

Hi Geo

Got it! I will try to make something. Will be back with results.


Hi There,

I found this in in openhab.log when starting things up:

openhab.log:2018-04-02 21:19:59.494 [WARN ] [el.core.internal.ModelRepositoryImpl] - Configuration model ‘OHScheduler.items’ has errors, therefore ignoring it: [11,136]: mismatched input ‘}’ expecting RULE_ID

And was wondering if this is one cause of my problems.

Marcus, between the curly braces (lines 11,13 and 15) you should put the binding (sensor item: {channel="…"}).

This is a great widget.
I have been tinkering with my heating/cooling rules for a bit, but interface wise this is just about perfect.

What I would like to add is some feedback in the thermostat to show me whether it is actually idle, heating, or cooling. This could be as simple as a single SwitchItem that would show Idle,Heating,Cooling.
I have so far not been successful in figuring out How I could add such an item to the widget.
I am not particularly experienced with angular, so I don’t know how complicated it would be to do this.
I would expect the model would need to expanded to know what additional item to look for and the view would need to know where to put it. (but I am not sure hat bits are model or view)

Hello Roy,

I am glad you managed to easily integrate the widget in your setup!

If you want to show the status of the relay you don’t need angularJS. It can be achieved with plain old HTML. You should edit the “ohscheduler.tpl.html” template and place your item there. You can inspire from the topics created by Yannick, like HABPanel Development & Advanced Features: Start Here! or Custom widgets: feature walkthrough.

1 Like