PlayStream - setting volume error

i just tried to play a stream via openhab3 (radio). it works but i now tried to send also the volume together with the stream according to the Multimedia doc.

However i receive the following error message:

2021-06-21 23:50:19.418 [ERROR] [internal.handler.ScriptActionHandler] - Script execution of rule with UID 'default-17' failed: An error occurred during the script execution: Could not invoke method: org.openhab.core.model.script.actions.Audio.playStream(java.lang.String,java.lang.String) on instance: null in default

Any idea how this is related to my rule line? without the percentType it works…but without setting the volume specifically…Thanks Norbert

playStream("https://xxxxxxxxxxxxxxxxxx",new PercentType(50))

Are you sure you have the right Action?

playSound accepts a PercentType as a second argument.

  • playSound(String filename, PercentType volume) : plays a sound with the given volume from the sounds folder to the default sink

playStream does not.

  • playStream(String url) : plays an audio stream from an url to the default sink (set url to null if streaming should be stopped)
  • playStream(String sink, String url) : plays an audio stream from an url to the given sink(s) (set url to null if streaming should be stopped)

ah sorry…i’ve not realized this tiny but important difference.
As i’m streaming i guess PlaySound would not work at all with web-links (urls).

I now tried

setMasterVolume(new PercentType(25))

Is that a corect way to do the syntax. As by testing i could not hear any difference.

Kind Regards

I don’t do anything with sound on openHAB so I can’t really say anything more than what is in the docs. But I would not be surprised if you didn’t have to set the volume first before starting the stream.

This topic was automatically closed 41 days after the last reply. New replies are no longer allowed.