HABPanel widget: Virtual Thermostat/OnOff Appliance scheduling

Tags: #<Tag:0x00007f0148015248>

(Roy Warps) #43

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.

(Geo Magadan) #44

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>

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

(Roy Warps) #45

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.

(Geo Magadan) #46

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.

(Hombibi @ yahoo.com) #47

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.

(Geo Magadan) #48

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

(Hombibi @ yahoo.com) #49

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.

(rsemmens) #50

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

(Igor) #51

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

(Geo Magadan) #52

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

(Igor) #53

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

(Geo Magadan) #55

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

(Lars Bretschneider) #56

could you share the link to git ?

(Geo Magadan) #57

Hello Lars, please check the first post.

(Lars Bretschneider) #58

got it! thank you!

(Guido Ottaviani) #59

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

(Guido Ottaviani) #60

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’) {

(Guido Ottaviani) #61

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.

(Geo Magadan) #62

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

(Guido Ottaviani) #63

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.