Hi,
This widget was mainly developed to showcase how additional code can be packaged and injected dynamically using the new the new bundle-oriented approach. Therefore, it’s not the usual JSON file but a fully-fledged openHAB addon. You need a recent HABPanel snapshot to use this feature.
Some technical details for those interested: the actual template is actually very short since it simply uses a gauge directive defined in the gauge.directive.js file, which is registered to the HttpService as a static resource (in GaugeWidgetProvider.java) and dynamically loaded by the oc-lazy-load directive:
Let me know if it works for you, and I hope it get you inspired to develop more complex widgets and package them this way so in the future, those kind of widgets could be installed as extensions.
I have been able to define config.min and config.max as a number, put in the values and it words great. But I failed with trying all the types “String,Number,Item” in value=itemState(config.item). then I changed the code a bit to value=“config.item” and then it started taking numeric entries.
But still i am not able to set values dynamically in it using an mqtt item. My item is as below kindly help:
Number dummySensor “Dummy Sensor [%s]” {mqtt="<[mqtt-gt:home/dummySensor/status:state:default]"}
Not sure how to help you. Numerical values should work without modifying the template. Just add the widget to a dashboard and configure it with your item. Also try using a dummy widget to see if your item is updated properly.
This looks really good… However, I can’t seem to get anything to work… I’ve dropped the jar file into the addons directory but I don’t see anything different in the HABpanel UI no extra widget to add to a panel or anything…
In the openHAB console, type bundle:list, you should see a line like this:
189 | Active | 80 | 2.1.0.201704261153 | Gauge widget for HABPanel
In Paper UI, go to Configuration > Services > UI (tab) > Configure HABPanel > Expert mode - post a screenshot of that screen. Maybe you simply have no HABPanel configuration yet, in this case the bundle would not install the widget.
@UglyKidJoe I assumed you were running openHAB on Windows since you posted a Windows Explorer screenshot…?
Anyways, on openHABian the addons folder should be /usr/share/openhab2/addons (documentation) - that’s where you should copy the bundle’s .jar file.
But your second screenshot also tells your HABPanel configuration is empty. So before you copy the .jar into the addons folder (or remove it if it’s already there), go to your HABPanel’s advanced settings and click the “Save the current configuration to a new panel configuration” link and give it a name. This will create the config. Then copy the .jar file.
Thanks Yannick. God spot on the windows installation! I only use that to test things when I’m away from home, so the schoolboy error was that I put the .jar in the windows installation and not my Pi.
I seem to have solved the problem. If anyone else is having the same issue my problem was that I still had an older habpanel .jar file in my addon folder. I removed this and then reinstalled habpanel in the paper UI and now all is working properly
Hi guys,
independently of the fact that this topic is quite old I try to get this addon working.
It seems that I have the same issue like others: The add-on is loaded and active (I see it in the OH console) but the widget is not available in HABpanel.
Would be great if someone who got it working provide some addional hints for me.