HABPanel widget: Virtual Thermostat/OnOff Appliance scheduling

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

Can you put the code on GitHub or GitLab?
I might help with JS cleanup and optimisation.

@rsemmens Sorry, but for the time being there will be no change on this.

@Wespen (Igor) The initial plan was to fix all the small bugs and publish the code on GitHub. But, the priorities shifted for me a while back and had no spare time to work on this. I will try to see in the near future if I manage to do this, otherwise I will publish the code on git as it is.

@nepotu Great,
that way we can contribute and still have you as the author.

@Wespen I have uploaded the v1.0RC to GitHub (please check the OP). Looking forward to your contributions.

could you share the link to git ?

Hello Lars, please check the first post.