Speaker Volume Piston


#1

1) Give a description of the problem
(Trying to create a piston to maintain volume of my Samsung Radius R! speakers, but it doesn’t seem to change the volume in the IOS app. I have included two pistons which is better.)

2) What is the expected behavior?
(Volume changes to 50% Value in a range of 0>100)

3) What is happening/not happening?
(Volume value remains the same in IOS App)

4) Post a Green Snapshot of the pistonimage
(

)

5) Attach any logs (From ST IDE and by turning logging level to Full)
`

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

Will this Piston work better and cover all bases, up or down?


#2

Can Anyone help getting this to trigger?


#3

Looks like it’s being triggered (based on the first piston have the green bar next to the condition)…

You need to test the action command is working so create a blank piston with a single action in it, no IF.

execute
with music player 5
set level to 50
end with

Then save and hit the test button, see if the volume changes.


#4

I created the Piston:

![50 PM|690x66]

#5

And? What happens when you click test?


#6

Is this thread the same as what you was trying to achieve yesterday?
I put a trigger in to make it work.
image


#7

Yes Bob but it seems to be triggering late, so it adjusts the speaker after the sound is sent.


#8

OK. That’s how it was built.
The one I wrote needs a trigger first, Music player status change, to know that it is on and therefore change the volume level.
The only other way I suppose is have the one above AND another one that runs, say every 15 minutes to set the level.
That might suit your needs.


#9

Yes I am using yours, the one above was a test. How do I add a trigger to run every few minutes during certain hours? Should I use a virtual device in Time Mode?


#10

You could use a Timer to run every few minutes between certain times.
image


#11

Not to sound stupid, I looked in the If for a timer function and couldn’t find it. How about a hint where it is?


#12

First you need to ensure advanced statements is ticked.
image
Click on add a new statement.
image
The TIMER option should now be available.
Now choose what you want to do.
image


#13

I hope I have this correct. Is this in the correct place?


#14

The every 15 minutes part is correct but you haven’t put anything in the DO part.
Put in there
WITH
Music Player
DO
Set level to 45%


#15

Thank you Bob, you have helped and taught me a huge amount. No to implement what I have been taught will be a task for me.


#16

As the speaker is not actually on, i don’t know if it will actually change/set the level or not.
Not something I need to use.


#17

I wish ST would fix their DTH as it is becoming a pain in the butt. Maybe it will act like a refresh, not sure.


#18

The volume control with timer works better, but getting this in logs, is there a way to fix this?


#19

That’s not an error, it’s normal.

Though webCoRE can be synchronous, ST is inherently asynchronous. Two processes cannot happen at exactly the same moment so one inevitably has to wait, in this case for 268ms (0.2 seconds).


#20

OK, as long as it won’t cause problems.