WebCoRE piston help Setting Variable


How do I capture volume level then restore that level?

(Robin) #2

Click on the x2 button at the top of the scrip edditor page. You will then see the ‘define’ section appear at the top of the script.

Within the define section you can define a variable. Make it an integer variable, give it a name and leave the value blank.

Then within the main part of the piston, create the action ‘set variable’ and choose the variable you just created. For the value, choose ‘expression’ and type [device name : volume]. When this part of the piston runs the volume value will be stored in the variable.

To restore the value, create an action to set the volume, and choose ‘expression’ for the value section. Then type the variable name.


Thanks for the response. I have been poking around to try and figure a few things out. I changed the variable to an integer and made it local. as you suggested I’m setting the variable to {volume} = speakers Level;
Setting level gets me nothing but I found that the Samsung R1’s prefer tileset[] which works to set levels. I seem to have it working but it’s resetting the volume to 15. I don’t have an initial value set. Any idea where it is pulling that level from?