eclipse-archived / smarthome

Eclipse SmartHome™ project
https://www.eclipse.org/smarthome/
Eclipse Public License 2.0
862 stars 783 forks source link

[FS Internet Radio] volume issues #4928

Open emme-g opened 6 years ago

emme-g commented 6 years ago

Hello, I recently started to use this good binding with my Auna Connect 150. I could easily set the binding of Openhab2 without any big problem. So, now everything works fine with just one exception: the volume items don't work in the same way described in the documentation. I start with the volume-absolute channel: the range of the volume in my device is 0-20 (not 0-32 as written in the binding documentation) so I think it could be good to explain in the binding page that the absolute volume range is not always 0-32. Then I have another issue with the volume-percent channel: when I use the sitemap element (Slider or Setpoint) to change the Dimmer item linked to the volume-percent channel I can't set exactly the value I want but it always change to a littler value after some seconds, e.g. when I set it to 30% it changes to 28%. Another thing I can't do is to set a percent volume higher than 62%. Probably this behavior is related to the fact that my absolute volume range is not 0-32, I can see that 20/32 is equal to 62,5% (the maximum volume percent value I can reach). I hope my post can help to improve the binding and its documentation. Bye.

sjsf commented 6 years ago

Thanks for posting this! Your experience actually raises the question why there are two distinct channels for the same functionality at all... To my knowledge bindings are encouraged to use percentage values in such cases in order to abstract such device internals. Therefore IMHO the volume-absolute channel should be dropped completely...

Nevertheless, the handler indeed must learn to cope with 20 being the maximum absolute value for the "Auna Connect 150" internally - especially as it is listed as a supported device. The FrontierSiliconRadio class indeed uses 32 hard-coded currently. I have to idea if the API gives any clues for this - I'll leave this to the developers of this binding to figure out the best way of doing it.

emme-g commented 6 years ago

Hello, I write here the way I acted to bypass this volume problem in my FS Internet Radio device (with absolute volume range 0-20) and to use it in a easy way in my automation system, with a sitemap showing a percent volume info, until the issue will be hopefully be solved. In the item file I have just set the volume-absolute channel. Number Radio_Volume2 "radio volume (absolute): [%s]" <soundvolume> {channel="fsinternetradio:radio:km-radio:volume-absolute"} In the sitemaps file I have used a setpoint element and I decided to use a trasformation. Setpoint item=Radio_Volume2 label="radio volume: [MAP(fsinternetradio.map):%s]" minValue=0 maxValue=20 step=1 And in the map file I inserted the relation between the steps I have in the volume-absolute channel and the percent values. 0=0 % 1=5 % 2=10 % 3=15 % 4=20 % 5=25 % 6=30 % 7=35 % 8=40 % 9=45 % 10=50 % 11=55 % 12=60 % 13=65 % 14=70 % 15=75 % 16=80 % 17=85 % 18=90 % 19=95 % 20=100 % I would like to underline that this is just a way to temporary bypass the problem and I hope that this issue would be soon be solved and the documentation amended. I agree with Syka, to have two different volume channels could be confusing and it is absolutely confusing to have a documentation with the information that every FS Internet Radio device has an absolute volume range (0-32) where it's not generally true. Bye.