This page last changed on Feb 09, 2014 by rich.sperrin.

I have a slider control successfully operating the volume on a pair of speakers using HTTM.

The next step is fine control. The slider is a bit coarse and would like to add '+' and '-' buttons at either end of the slider to give some fine control. The +/- buttons will need to adjust the volume ( which has a range of 0-64) by 1 or 2 notches.

My first thought is to add a sensor that grabs the current volume and and adds 1 using simple math. Except none of the syntax I've tried works.

I've tried JSON expression like $.volume+1 & ($.volume)+1. Its worth a shot but clearly will not work.

Another idea is using rules - would this be a viable route to look into?

Else am I over-looking the obvious?!?

The slider is a bit coarse and would like to add '+' and '-' buttons at either end of the slider to give some fine control

The MaxImage and MinImage in the slider widget are just meant for that.

Posted by pz1 at Feb 10, 2014 07:53

Well actually no. There is a discrepancy in the way the different consoles implement this. On iOS, those images are just that, passive images, not buttons. You can't click them.

Posted by ebariaux at Feb 10, 2014 08:07

There is indeed no "expression language" that can be used within the commands, just "dummy" substitution of the {param} value in the string.

Easiest way to achieve what you want would be if your speakers do have a volume up / down command you can directly call from HTTP. That way, simply link that command to a button and you're done. The slider will update later with feedback from the device.

Otherwise, you'll need to use rules.

Step 1: there is no way to trigger a rule directly from a button, so you need a workaround by linking the button to a command that toggles the value of a "In Memory Virtual Command". You can then have a rule react to that.

Step 2: in the rule, use the value from the volume sensor, add or remove one, then execute the set volume command using the computed value as parameter.

Posted by ebariaux at Feb 10, 2014 08:13

I wasn't aware he was working with ios. To be honest it is also very recent that Richard implemented those images as buttons on Android. I think that version has not yet been formally released even. I am very happy with it, because it does allow sliders with +/- only buttons (see this in my private space)

Posted by pz1 at Feb 10, 2014 09:09

By default there are no +/- buttons on the slider for Android. When images are added to MinImage and MaxImage thats all they are and provide no function.

Guessing the development is a while off yet?

Posted by rich.sperrin at Feb 10, 2014 19:01

cheers Eric - I'm certain there is no suitable HTTP command as it is only designed to be used from a slider control in Philips/Twonky Android interface - no sign of a +/- there either! I'll have a look at using rules; I've checked out a few examples but have to admit the way rules work hasn't quite clicked yet.

Posted by rich.sperrin at Feb 10, 2014 19:07

Guessing the development is a while off yet?

Sorry I have no idea. I haven't heard from Richard since a few weeks when I sent back some test results with RRD graphs on Android.

Posted by pz1 at Feb 10, 2014 21:11

Can you confirm whether Drools rule engine works with Java 7 - I read an older entry stating v6 is required. If this is the case do you have a link to v6 as there isnt a lot of help at Java; http://www.java.com/en/download/faq/java_6.xml

cheers

Posted by rich.sperrin at Feb 12, 2014 20:09
Document generated by Confluence on Jun 05, 2016 09:34