Page 1 of 1

Can someone help me with this simple script?

Posted: Saturday 23 April 2016 19:49
by leecollings
in domoticz/scripts I have a script that simply pauses our SkyHD box, which currently looks like this:

`#!/bin/bash
sky-remote-cli 10.0.0.5 pause &`

This script file is called 'skyHD_pause'.

Also in the same folder, I have a WAV file that I want to add to the script to play, so I now have the script file looking like this:

`#!/bin/bash
sky-remote-cli 10.0.0.5 pause
play doorbell_11.wav &`

I can already play the audio file directly via SSH by using that command (when I'm in the current script directory). But when Domoticz fires the script, the Sky box pauses, but the audio doesn't play.

Is the location I'm referencing the WAV file okay in the script? The script is called from the 'On' action of a script, and is displayed like this: `script://skyHD_pause`

Any help would be greatly appreciated. PS, no errors appear in the log file, only that the script was executed.

Re: Can someone help me with this simple script?

Posted: Saturday 23 April 2016 23:35
by jmleglise
hi,

1/ Try to use the full path to the audio file like this :

Code: Select all

#!/bin/bash
sky-remote-cli 10.0.0.5 pause
play /home/pi/doorbell_11.wav &
2/ if this didn't work, try to understand where is your problem with

Code: Select all

#!/bin/bash
sky-remote-cli 10.0.0.5 pause
echo "hello" >test.log &
this command will create a file test.log somewhere ...

3/ why dont' you keep the & at the end of sky-remote-cli 10.0.0.5 pause ?

Re: Can someone help me with this simple script?

Posted: Sunday 24 April 2016 8:54
by jmleglise
And try to see the error :

Code: Select all

#!/bin/bash
sky-remote-cli 10.0.0.5 pause
play /home/pi/doorbell_11.wav >> /var/log/play.log 2>&1 &
(not tested. Search "stderr redirect" on the web)