The ffmpeg command works at the commandline. I had to put in an escape \\ for the ! In my password.
I also tried another command, “rm ~/abc.avi” , this also didnt work.
Does anybody now how i can fix this?
This is the log with command "ls"
Code: Select all
2019-09-18 18:43:13.581 Status: User: Admin initiated a switch command (68/Alarm signaal/On)
2019-09-18 18:43:13.601 Status: dzVents: Info: Handling events for: "Alarm signaal", value: "Locked"
2019-09-18 18:43:13.601 Status: dzVents: Info: ------ Start internal script: Script #1: Device: "Alarm signaal (Dummy)", Index: 68
2019-09-18 18:43:13.604 Status: dzVents: backups
2019-09-18 18:43:13.604 Config
2019-09-18 18:43:13.604 domoticz
2019-09-18 18:43:13.604 domoticz_crash.log
2019-09-18 18:43:13.604 domoticz.db
2019-09-18 18:43:13.604 domoticz.db-shm
2019-09-18 18:43:13.604 domoticz.db-wal
2019-09-18 18:43:13.604 domoticz.sh
2019-09-18 18:43:13.604 dzVents
2019-09-18 18:43:13.604 History.txt
2019-09-18 18:43:13.604 License.txt
2019-09-18 18:43:13.604 plex
2019-09-18 18:43:13.604 plugins
2019-09-18 18:43:13.604 scripts
2019-09-18 18:43:13.604 server_cert.pem
2019-09-18 18:43:13.604 updatebeta
2019-09-18 18:43:13.604 updaterelease
2019-09-18 18:43:13.604 www
2019-09-18 18:43:13.604
2019-09-18 18:43:13.604 Status: dzVents: Info: Alarm Alarm signaal is afgegaan
2019-09-18 18:43:13.604 Status: dzVents: Info: ------ Finished Script #1
Code: Select all
return {
on = {
devices = {
'Alarm signaal'
}
},
execute = function(domoticz, device)
cmd="ffmpeg -i rtsp://user:abc000\\[email protected]:88/videoMain -t 10 -acodec copy -vcodec copy abc.avi"
local f = assert(io.popen(cmd, 'r'))
s = assert(f:read('*a'))
f:close()
print(s)
domoticz.log('Alarm ' .. device.name .. ' is afgegaan', domoticz.LOG_INFO)
end
}
Code: Select all
2019-09-18 16:25:55.371 (Dummy) Lighting 1 (Alarm signaal)
2019-09-18 16:25:55.367 Status: User: Admin initiated a switch command (68/Alarm signaal/Off)
2019-09-18 16:25:55.388 Status: dzVents: Info: Handling events for: "Alarm signaal", value: "Unlocked"
2019-09-18 16:25:55.388 Status: dzVents: Info: ------ Start internal script: Script #1: Device: "Alarm signaal (Dummy)", Index: 68
2019-09-18 16:25:58.245 Status: dzVents:
2019-09-18 16:25:58.245 Status: dzVents: Info: Alarm Alarm signaal is afgegaan
2019-09-18 16:25:58.245 Status: dzVents: Info: ------ Finished Script #1