I have a small script wich is telling me on a given time if the bedroom door is open or close. This is because I have an airco in that room. So 5 minutes before the airco is on the script checks if the door is open or close. In case of open it sends a notify to my mobile phone. What I want is a spoken message by izsynth by a bluetooth speaker. The speaking part comes from a tutorial from Gadgets-Freaks called Domoticz voice feedback.
Here is the script:
Code: Select all
return {
on = {
timer = {
'at 22:40'
},
devices = {
'deurcontact'
},
},
logging = {
level = domoticz.LOG_ERROR, -- set to domoticz.LOG_ERROR when all ok
marker = 'Slaapkamer'
},
execute = function(dz, item, devices)
local deurcontact = dz.devices('Slaapkamer - deurcontact')
if item.isTimer then
if deurcontact.state == 'Off' then
dz.log('Slaapkamerdeur is dicht', dz.LOG_INFO)
elseif deurcontact.state == 'On' then
dz.notify('Slaapkamer', 'slaapkamer deur staat open', dz.PRIORITY_NORMAL,nil,nil, dz.NSS_PUSHOVER)
os.execute("sh /home/pi/domoticz/scripts/play_sound.sh nl ' test ' ")
end
end
end
}
In the terminal when I give the command: sh play_sound.sh nl 'test' the text is converted to a mp3 file and is audible but in the script nothing happens. I've tried several things from the Domoticz forum but nothing helps.
Maybe some can piont me out what I am doing wrong.
Thanx.