Volume adjuster doesn't work


#1

1) Give a description of the problem
This piston should maintain the volume of my two Speakers

2) What is the expected behavior?
If volume drops below 50% it brings the volume back up to 50%

3) What is happening/not happening?
The volume drops but doesn’t go back to 50%

4) Post a Green Snapshot of the pistonimage

The line below is the JASON line, not sure if that is the problem.
http://192.168.1.xx:55001/UIC?cmd=SetVolume<p%20type=“dec”%20name=“Volume”%20val=“15”/>

5) Attach any logs (From ST IDE and by turning logging level to Full)
(PASTE YOUR LOGS HERE BETWEEN THE MARKS THEN HIGHLIGHT ALL OF THE LOGS SND CLICK ON THE </> ICON TO FORMAT THEM)

REMOVE BELOW AFTER READING
If a solution is found for your question then please mark the post as the solution.


#2

This is a bit of a stab in the dark but I did a Google and found this GitHub which I think is related: https://github.com/bacl/WAM_API_DOC

Anyway I think your HTTP GET needs to point to: http://ip_speaker:55001/UIC?cmd=%3Cname%3ESetVolume%3C/name%3E%3Cp%20type=%22dec%22%20name=%22volume%22%20val=%2215%22/%3E

I am guessing you need the full URL encoding for it to work, also your URL is missing some tags around the SetVolume.


#3

If you look at the line I posted under the screenshot that is what I did. Is that what you are referring to?


#4

Yes, if you replace that with the line I gave it should work. Your request URL is missing some parts and also not fully encoded which could be causing the problem.


#5

Your code is for what volume, it makes it 15%? I need 50%, what do I change?. Here is the line as copied. XX was end of IP

here is the part after the iP 55001/UIC?cmd=%3Cname%3ESetVolume%3C/name%3E%3Cp%20type=%22dec%22%20name=%22volume%22%20val=%2215%22/%3E


#6

Change the bit after val= from %2215%22/%3E to %2250%22/%3E. I assumed as you had 15 in yours that was the value you were seeking.


#7

Thanks, changed that and will test it. I appreciate the help.


#8

First test show the volume jumping to 90% even with the line saying 2250 trying now at 2230 hoping I can get it correct.


#9

Rather than guessing, you could set the volume to 50% manually then issue a GetVolume request to see what level it returns. The API seems to use low values like 2, 3 and 4 with SetVolume making me think it’s not a simple correlation.


#10

Even the change I made doesn’t correct the problem. It shows 90% after a request. I think I might have the correct number now, will wait and see. If it is correct I will post the number.


#11

Set the volume to 50% on the music player, then on a PC goto: http://192.168.x.x:55001/UIC?cmd=%3Cname%3EGetVolume%3C/name%3E

You should get a return, let me know what it says.


#12

VolumeLevel1.0192.168.1.36public15 but it actually is 45% using the 2215 setting. I am confused.




#13

It has now dropped from 45 to 42, more baffling to me. If it drops too much I will try a different number.


#14

The section that is concerning me is this:

This basically stops BOTH speakers from being anything EXCEPT 50%…
Basically, off limits to volumes 0-49%, and 51-100%…

Is that intended?


#15

Yes as they are very loud at 50% above that in my home it becomes like an echo chamber. If you have a better idea on how to do this I am open.


#16

So, just to clarify… You never want the volume low or high…
Simply 50% volume 24 hours a day, no matter what… Correct?


#17

At this time yes 50% is what I need.


#18

I would be very tempted to split up each speaker into it’s own piston…

One piston monitoring/adjusting Speaker 4… and another monitoring/adjusting speaker 5.

This will keep needless commands from being sent.
(both pistons will look the same except they will each be focusing on different speakers, with slightly different URLs)


#19

Also, worth mentioning… Speakers do not always use 0-100% when referring to volume. The last speaker I worked on went from 0-60, with 60 being 100% volume, and 30 being 50% volume. You might have to compare notes to see what your max volume is (as seen by ST) so you can calibrate accordingly.


#20

The GetVolume command makes it look as if the speaker is at level 1.

You need to do some testing to discover which volume level value equates to 50%. So disable the piston, set the speak to 50% and then run the GetVolume command. When that reports back the level take that and place it into the SetVolume command, change the speaker volume to 30% and then run the SetVolume command. As these are GET requests they can all be done from a standard web browsers URL bar.