HABPanel widget: Virtual Thermostat/OnOff Appliance scheduling

@ 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?

thanks

@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.

Thanks
Branko

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,
Geo

1 Like

Hi Geo

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

Branko

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

Unfortunately it is not possible in plain old html. The knobs are made using java-script voodoo they are not part of the template nor do they appear to even use a template they somehow just happen.
It looks great and it works great but it is a complicated piece of work.

Hello Roy,

Let me see if I understood correctly. You want to display the status of one relay on each knob? If this is the case, then you could put this into the knob “subText” option. This part is controlled on OHSKnobs function (starting with line 459 in ohscheduler.js) which should be extended to support this.

Of course there are some other changes like:

  • extend the itemsList to map your relay to each thermostat/sensor, plus some changes in the items function (OHSItems)
  • get the relay status query (call vm._itemState)

Or, without JS, you could place it in a new line under each knob (below the div class=“knob-container” block lines 12-14 on ohscheduler.tpl.html). This requires only few ng-ifs and should be easier to achieve. It is not elegant, but should be a start.

<div class="relay-status">
    <span class="relay-label" ng-if="(ohsKnobKey == 'readItem1')">{{itemValue(relayItem1Name)}}</span>
    <span class="relay-label" ng-if="(ohsKnobKey == 'readItem2')">{{itemValue(relayItem2Name)}}</span>
    ...
</div>

Unfortunately this requires lots of changes to be supported from GUI/out of the box and for the time being I don’t see myself working on a widget update (no spare time).

Yes I will have a state item per knob as I have a knob per room. There are actually several relays involved that control valves and fans or possibly an AC. hence I want to abstract it to the intention of the actions which would be to heat, cool or be idle. The heating rule would then update this state rather then the UI trying to figure it out.

I have been more or less working on what you said but instead creating a second item based of subtext. Though so far the item has not appeared, not even with a hard-coded test text in there.
I will need to go over your post in more detail and check that against what I have been doing.

I also been thinking of adding this state to the knob title but that title is not made to be updated in that way.

Hello Roy,

Seems that my snipped had a small gremlin. The ng-if should compare the value from ohsKnobKey variable with the name of the current temperature item name (“readItem” from the items list defined in the widget settings) and not the relay item.

Pretty damn impressive. And quite a challenge for me too!

I am trying to setup the scheduler with a number of Daikin heating/cooling units. I have these all working in habpanel, as they are fully autodiscovered.
For the scheduler I so far only managed to get the status and set the temp, and read and set the running mode, (not sure if they work correctly though) and I am not sure how to proceed. I am new in openhab and have not edited any files yet as so far habpanel click’n go has been able to get the job done. Now i am stuck.

In the scheduler config screen I can’t select a schedule store item. Frankly I have no idea what that is, and the daikin controllers only allow to read and send temperature, fanspeed and vane movement, and running mode. I think I need an item to store a schedule in, and a way to check if what I do is working. The latter I will find out, but I’d appreciate a bit of help with the other so that I can start to make a schedule and see if it works.

Thanks for your great work.

Hello Hombibi,

This widget and the items it uses should be manually created. In order to control the Daiking heating/cooling you might have to build additional rules/triggers. I suggest to read a bit about openHAB and openHAB items.

PS: the purpose of this widget was to provide a scheduling interface and to change the values for some “items” at a given moment, based on a defined schedule. It doesn’t control the “things”.

Thanks Geo Magadan, that gives me direction I need. I’ll start with the links you provided, and it is good to learn that the widget’s function is scheduling, while I have to provide the things that need to be scheduled.
Leaves open the question how that concept relates tot the automatically discovered things, but I guess I only have to create the items that are not auto discovered.
Thanks a lot, reading up through the links next.
Hombibi

Love the add-on, have you thought about for start/stopping items having an option to finish at X time.
So you could effectively schedule something to end at 18:00 and it works out the start time for you using the given duration (the use case I’m thinking of is a washing machine). I know it could be worked out in your head but that’s not why we have all these toys. (WAF wouldn’t go amiss too).