pulseaudio, bluez, domoticz and users... i do not know what to do next
by Jinux75 from LinuxQuestions.org on (#4X7T0)
I have a little machine that has lubuntu on it. It also has domoticz.
I have succesfully paired and connected a bluetooth speaker.
I ssh into lubuntu i play a mp3 that is played from a .sh script and it plays to the bluetooth speaker, yay !
Then I go to domoticz on my laptop and start the .sh script with a on/off button.
In the domoticz log, it says it is executed. But it does not play on the bluetooth speaker. It does play, but to the audio output of the machine instead of the bluetooth.
Then i shut down domoticz, it is loaded with systemctl. i stop it in ssh, i then start it with ./domoticz, not with systemctl and i can see what happens on the cli when the script runs.
It runs and it does play to the bluetooth speaker. Ahh !
So it seems like a user issue? i think. But i am not able to find out how i can make it play the mp3 when domoticz normally runs at boot with systemctl.
i changed the unit file to user and group root, user en group to other users and groups, nothing helps.
the content of the .sh to play the mp3 is this: (xx as my bluetooth device)
#!/bin/sh
mplayer -ao pulse::bluez_sink.xx_xx_xx_xx_xx_xx.a2dp_sink /home/userX/Domotica/domoticz/scripts/BTmusic/music/relax1.mp3 softvol -volume 35 > /dev/null 2>&1 &
My thinking is at has to do something with user permissions, or maybe i need to set the pacmd sink to bluez_sink system wide, but i can not seem to find anything on how to do that, and if that is the correct way to go.
any help on this, i have been busy for days, but i do not see the trees in the forest anymore :-(
much appreciated .


I have succesfully paired and connected a bluetooth speaker.
I ssh into lubuntu i play a mp3 that is played from a .sh script and it plays to the bluetooth speaker, yay !
Then I go to domoticz on my laptop and start the .sh script with a on/off button.
In the domoticz log, it says it is executed. But it does not play on the bluetooth speaker. It does play, but to the audio output of the machine instead of the bluetooth.
Then i shut down domoticz, it is loaded with systemctl. i stop it in ssh, i then start it with ./domoticz, not with systemctl and i can see what happens on the cli when the script runs.
It runs and it does play to the bluetooth speaker. Ahh !
So it seems like a user issue? i think. But i am not able to find out how i can make it play the mp3 when domoticz normally runs at boot with systemctl.
i changed the unit file to user and group root, user en group to other users and groups, nothing helps.
the content of the .sh to play the mp3 is this: (xx as my bluetooth device)
#!/bin/sh
mplayer -ao pulse::bluez_sink.xx_xx_xx_xx_xx_xx.a2dp_sink /home/userX/Domotica/domoticz/scripts/BTmusic/music/relax1.mp3 softvol -volume 35 > /dev/null 2>&1 &
My thinking is at has to do something with user permissions, or maybe i need to set the pacmd sink to bluez_sink system wide, but i can not seem to find anything on how to do that, and if that is the correct way to go.
any help on this, i have been busy for days, but i do not see the trees in the forest anymore :-(
much appreciated .