OH 3 Audio from rule using webaudio

  • OS: Windows 10/10.0 (amd64)
  • Java Runtime Environment: 11.09.1 (Zulu 11.43+55-CA)
  • openHAB version: 3.1.0.M3
    Hi All
    I have been playing with a Custom Widget, and would now like to add some audio to indicate errors etc…
    So I looked at the current Multimedia Docs for ideas etc.

So I have set the default Audio Sync in Settings to We Audio:

openhab> openhab:audio sinks
  System Speaker (enhancedjavasound)
* Web Audio (webaudio)

I then created a rule from the UI to play audio (default files that ship with OH3) when My Testing_Switch turns ON:

  - id: "1"
      itemName: Testing_Switch
      command: ON
    type: core.ItemCommandTrigger
conditions: []
  - inputs: {}
    id: "2"
      volume: 100
      sink: webaudio
      sound: barking.mp3
    type: media.PlayAction

I am certain the audio file exists - it is offered by the UI, and if I add a new file it is updated.
The only log entry is:

19:50:07.731 [INFO ] [openhab.event.PlayURLEvent           ] - Play URL '/audio/e28830d3-f0e3-4dc2-8f73-79e99c6c8673'.

However I get no audio on the device?

Searching the forum etc. did not turn up any advice.

Please help…Again…

What UI are you running on the device which should play the sound?

Did you read this: Currently, this feature is supported by UI and HABPanel. in the Multimedia docs?

1 Like

I am using Main UI.

I did see that. And when I went to look for it again could not find it… So was not 100% sure of the exact wording. Found it again now with your help:

Web Audio

Convenient, if sounds should not be played on the server, but on the client: 
This sink sends the audio stream through HTTP to web clients, which then cause
it to be played back by the browser. Obviously, the browser needs to be opened 
and have a compatible openHAB UI running. 
Currently, this feature is supported by UI and HABPanel.

I guess I was hoping that this was a documentation issue, but I guess not. I was also not 100% about “UI”. I know of Main UI, Basic UI, Paper UI. But don’t recall seeing anything about “UI”.

Also hoping that there is another option?

EDIT - Confirmed to work on HABPanel

Thank you

webaudio is not supported by MainUI.
see here on Github

1 Like

Ups, actually I was searching for that post. Thanks.
I never got an answer on that my post on github.

Hopefully gets some traction…

I’ve created a PR to update the docs so it is clear that currently only HABPanel supports the webaudio sink.

1 Like

If you want a work around put Web Frame card with the address of a habpanel dashboard and it will pass the sound that way.

I created a PR for adding webaudio support to Main UI :slight_smile:


I was also missing webaudio in Basic UI, so I created something similar for that too. :slightly_smiling_face:

1 Like