play soundmessage with BT
Posted: Friday 22 January 2016 0:42
Hi guys, hopefully somebody can point me in the right direction.
I've installed an BT dongle with the help off: https://www.domoticz.com/wiki/BTAudio, and this working perfect, thnks!
When I launch the command from cli, it's working like a charm:
Then I've integrated it in a bash script named: alarmaanmp3. This script contains:
When I run this from cli, it's also working:
Now comes the part I got stuck, I've made a dummy swith and put the command in the "on" part of it (did the same for "off", but this has the same results):
In the log I see the script got activated, but no sound.
After this I've changed to LUA and made the script, named: script_device_alarmmessages.lua.
This script contains the following code:
I can see the print output in the log, but also here no sound.........
Hopefully somebody can help me with this puzzle.....
btw: I'm running Version: 2.3530, Build Hash: 9eef872, Compile Date: 2015-11-01 11:41:18
I've installed an BT dongle with the help off: https://www.domoticz.com/wiki/BTAudio, and this working perfect, thnks!
When I launch the command from cli, it's working like a charm:
Code: Select all
mplayer -ao alsa:device=bluetooth /media/alarm_ingeschakeld.mp3 -softvol -volume 30 -af resample=16000:0:0Code: Select all
#!/bin/sh
mplayer -ao alsa:device=bluetooth /media/alarm_ingeschakeld.mp3 -softvol -volume 30 -af resample=16000:0:0
Code: Select all
/home/pi/domoticz/scripts/alarmaanmp3In the log I see the script got activated, but no sound.
After this I've changed to LUA and made the script, named: script_device_alarmmessages.lua.
This script contains the following code:
Code: Select all
commandArray = {}
if (otherdevices['AlarmActive'] == 'On') then
os.execute('/home/pi/domoticz/scripts/alarmaanmp3')
print('Alarm message -aan- verstuurd naar BT-speaker')
end
return commandArray
Hopefully somebody can help me with this puzzle.....
btw: I'm running Version: 2.3530, Build Hash: 9eef872, Compile Date: 2015-11-01 11:41:18