Luup delay help

I used this string to play a wave file from the PC, depending on who unlocks the door(unique entry codes). This worked when I added it to the luup tab of a scene:

os.execute(‘curl -g “http://192.168.1.110:8080/requests/status.xml?command=in_play&input=file:///C:/HomeVoice/welcomehome.wav”’)

The problem (besides me being confused by lua code) is that the wave file plays before the door is open and I want to add a 5 second delay. I tried using a delay in the scene, but I only have the option to delay device functions. The next thing I tried was saving the above code as welcomehome.xml and uploading it to luup files under apps.

I then used the below code on the luup tab of the scene:

luup.call_delay (“welcomehome”,5)

This results in no sound at all. Am I using the uploaded luup wrong or is something wrong with the way I’m calling it up from the scene? Any help is appreciated. I may not have been searching efficiently, but I have searched this for 2 days on vera and lua forums.

thanks,

Rick

You shouldn’t put that in an xml file and upload it, but create a function in the same scene like:

function welcomehome()
    os.execute('curl -g "http://192.168.1.110:8080/requests/status.xml?command=in_play&input=file:///C:/HomeVoice/welcomehome.wav"')
end

luup.call_delay("welcomehome", 5)

Thanks duiffie! That works perfectly. I’m at work, but I have a camera in my living room that I tested with. I hit the scene button and counted to 5 and watched the dog go from a dead sleep to doing a flip off the couch. I’d say that means I have sound again. lol

Haha, poor dog… :wink: