Custom Widget - ThermoKnob

Hello Hans-Jörg,

i’ll do my best to explain what i’ve done.

1st: it’s working now
I had to copy the whole content of the zip-file to /etc/openhab2/html. In this folder i have now the folders /img and /thermoKnob and the file thermo-knob.widget.json.

I imported the .json file also via HABPanel: add Widget -> Gear -> import Widget -> import from file.

The Widget-Galery shows me this:

(Nothing to import)
(No widgets found (*.widget.json Files)! Blease report this.)

@blobule Thank you for this cool widget.

:+1:

I found the problem…
The repository for my widget is on gitlab, not github, and the auto-detection of habpanel requires github.
I added an alternate repository on github, and it seems to work now.
Thanks for mentioning this problem. May I suggest to the habpanel devs to possibly add gitlab as a possible source for repositories? In the mean time, i’ll use github.

I did not use any IDE. I just edit the files directly.

The basic question is: is your widget based on svg drawing? or it is based on non-svg components?
For non-svg, I suggest to find the closest existing widget from the widget gallery, and modify it.
For svg drawing, I relied on the knob provided in habpanel, but also on the excellent [Custom widget: Gauge].
I make sure the main js file (ng-knob-thermo,js) is independent of OpenHab, so it can be tested by itself (index.html). Then, all OpenHab related stuff is placed into a control file (control-oh.js).
If you have a svg based widget you want to do, maybe this widget can be used as a template. I’ll be happy to make suggestions if you have a specific design you want to do from there…

1 Like

hello gentlemen and ladies,

I was wondering what the process is to install the widget on RPI with OH3
bit of a newb so any guidance would by lovely. I read instrcutions but they mention oh2 so i thought i would ask first

Alex

Hi!
I updated the installation instruction for OH3. The only difference is that on openrasbian you copy files to /etc/openhab for OH3 instead of /etc/openhab2 for OH2.

I hope this help, and that your install works!

1 Like

Hi @blobule apologies for the dumb questions.

  1. I went to openhab and habpanel and installed the custom widget.
  2. I didnt understand what the CP command part because I dont know what source it is trying to copy (and from where) I tried running the command but there was no source folder to copy from as i underrstand it
  3. so i used WinSCP to create the folder in the location you mentioned
  4. downloaded the files from github and copied all 3 into the folder.
  5. set the correct elements for the custom widget via habpanel
  6. nothing happened

so assuming i did what i should have in a roundabout way - what do i need to do? (sorry for the probably obvious)

Let’s see…
Are you using OpenHabian on a raspberry pi? Is it version 3?
If so, then using winscp you should be able to “visit” the files in the openhabian installation or your raspberry pi… If you go to /etc/openhab, you should see a few file directories… ( html, icons, items, things, rules, … ). Visit the html directory, and drop in there the directory thermoKob (and the files it contains), which is part of the widget files.
After this, the directory /etc/openhab/html should contain a “thermoKob” directory with 3 files inside (control-oh.js, index.html, and ng-knob-thermo.js).

To check that this is correct, you should check using a URL in your browser:
If your OpenHab is accessed using the url
http://openhabian.local:8080
then try the url
http://openhabian.local:8080/static/thermoKnob/index.html
You should see a test of the thermoKob widget that will indicate that everything is at the correct place.

See if this works!

2 Likes

that got me in the right direction. i had done some kind of manual copy paste that didnt work for some reason. did it again (the whole folder manually via winscp) refreshed the habpanel and yep all good!

thanks for speaking as if to a child :slight_smile:

This is a very nice widget and it works. What I miss only is to have possibility to change the mode.
We have the item for that defined. In the index.html example it is also possible to set the mode but on the widget itself not. Or do I miss hidden functionality?

And can you update it for openHAB. 4.
Thank you

Hi!

Yes, absolutely. It was in my list of “to do for OH4”… a fews days and it will be updated.

Thanks

Sebastien