HABPanel widget: Virtual Thermostat/OnOff Appliance scheduling

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.

got it! thank you!

Thank you so much @nepotu for sharing this amazing job. Even if Iā€™m not a programmer, going deep inside your code Iā€™ve learned a lot and Iā€™ve been able to arrange the GUI to my 7" panel (https://guiott.com/) accordingly to the other HABpanels look & feel.

Here a little preview: https://youtu.be/f0Lx5cu9ozs

Please keep in mind that if you localize the operating modes with your language you have to modify the rule too, otherwise it doesnā€™t trigger:

if (HVAC_Mode.state == ā€˜AUTOā€™ || HVAC_Mode.state == ā€˜FREDDOā€™ || HVAC_Mode.state == ā€˜CALDOā€™) {

I apologize @nepotu, but Iā€™m not able to understand how the scheduling JSON stored in HVAC_Schedule item can survive to a reboot. Iā€™ve designed a complex scheduling for a multi-room environment, after rebooting the board the scheduler is empty. Browsing your code it looks alike itā€™s just a RAM variable.

@guiott I am glad it wasnā€™t to hard to implement this widget. Indeed it is not 100% polished and it will stay like this until I find some spare time or someone else picks this up.

If you want to translate some states you will have to adapt the rules as well, however this is a trivial task.

Regarding the persistence of the values on reboot: this was never the purpose of this widget. For such tasks (preserving the item value on reboot) you should install a persistence binding (e.g. rrd4j, jdbc/mysql, etc.).

Thank you @nepotu. Iā€™ve understood this is not a ā€œproductā€ but a VERY GOOD starting point to develop our own GUI. You already solved a lot a problems with many lines of code that saved us a big headache. Furthermore, you applied so many software techniques that using your ā€œframeworkā€ is a good training to me. Iā€™ll continue to adapt it to my needs, reporting here some tips and (who knows?) maybe some contribution.