Exec command help

things file

 Thing exec:command:playsound [
            command="play /etc/openhab2/sounds/doorbell.mp3",

items file

Switch TestButton1  "Test button"
Switch SwitchPlaySound "Play the text message sound" {channel="exec:command:playsound:run"}
String PlaySound_Args {channel="exec:command:playsound:input"}
String PlaySound_out {channel="exec:command:playsound:output"}

rules file

	Item TestButton1 changed
	logInfo("Sound rule", "rule is running")
	setMasterVolume(new PercentType(80))
	  //while(SwitchPlaySound.state != OFF){
      // Logging of command line result
      logInfo("PlaySound output", "Result:" + PlaySound_out.state )



19:18:10.239 [INFO ] [smarthome.event.ItemCommandEvent     ] - Item 'TestButton1' received command ON
19:18:10.240 [INFO ] [pse.smarthome.model.script.Sound rule] - rule is running
19:18:10.256 [INFO ] [smarthome.event.ItemStateChangedEvent] - TestButton1 changed from OFF to ON
19:18:10.391 [INFO ] [arthome.model.script.PlaySound output] - Result:NULL
19:18:10.391 [INFO ] [smarthome.event.ItemCommandEvent     ] - Item 'SwitchPlaySound' received command ON
19:18:10.392 [INFO ] [arthome.event.ItemStatePredictedEvent] - SwitchPlaySound predicted to become NULL

and obviously no sound plays
the sound plays on the command line
openhab owns file belongs to audio group file is 777 permissions

What’s in you openhab.log? events.log is only useful to see the state changes if you’re items. Errors and the output of the exec commend will be in openhab.log.

Bear in mind that doesn’t do what you probably expect.
A command is issued to SwitchPlaySound, but the rule does not stop and wait for it to be actioned before moving on to logging. You’ll most likely log the state before any exec action happens.