Hello, and welcome!
First off, using the standard slider widget should work. Just to make sure that is set up correctly, make sure you have done the following:
- There should be a ‘Thing’ shown in PaperUI for your SONOS device you are trying to control.
- On the page for the SONOS Thing, there are a list of “channels” like Volume, Control, etc. Make sure that the item you created is linked to Volume.
- On the control page in PaperUI, make sure you can control the volume. If you have an item linked to the volume channel of your SONOS thing, it should show up on the control page, and it should work.
(Sorry if that is a bit redundant, but I remember when I started with OH missing one or more of those steps, and being confused as to why stuff wasn’t working.)
Now, on to HABpanel. If the above steps are done, you should be able to create a standard slider widget, link it to your item, and it should work. If that doesn’t work, you are probably going to have a bad time using the template widget. Once it is working, you can add a slider to a template widget using the following:
<div class="slider-div" ng-init='volumeModel={"name": "volume", "item": "ITEM_NAME",
"floor" : 0, "ceil": 100, "step": 1, "hidelabel" : "true", "hidelimits": "true" }'>
<widget-slider ng-model="volumeModel"/>
</div>
The basic idea is you are defining a variable, in this case called volumeModel, with whatever settings you would normally set in the settings page of the slider widget itself. You can then create a slider widget, and pass in your variable to config it. Change ITEM_NAME to the name of your item, and you should be set.
Note: You can create an angular-js slider the same way. You can replace “widget-slider” with “rzslider” in the above example. However, doing that will have issues. You will not get updates, so if you change the volume outside of HABpanel, it will still show the old values. I fought that when I was doing a couple custom widgets, and finally just realized it is far better/easier to just use the widget-slider.
If that is the only code in your template, though, it is really easier to just use the standard slider widget. The template widget, as well as custom widgets, allow you to add other html around the widgets, to give you more custom look and feel.
Hope that helps.