Is there a way I can run a command in ssh from dzvent?
I'm working on a script to trigger motioneye to start recording based on my motion detection. If I perform the commends from my domoticz pi ssh terminal it works fine, but as soon as I try to run it from domoticz nothing will happen.....
Code: Select all
return {
on = {
devices = {
669,
}
},
logging = {
level = domoticz.LOG_DEBUG,
marker = "motioneye"
},
execute = function(dz, device)
local motionEyeIP = "192.1.10.222"
local motionEyeUsername = "pi"
local motionEyeCommand = 'curl "http://localhost:7999/1/config/set?emulate_motion=1"'
local sshCommand = 'ssh ' .. motionEyeUsername .. '@' .. motionEyeIP .. " '" .. motionEyeCommand .. "'"
dz.log('SSH-commando: ' .. sshCommand, dz.LOG_INFO)
os.execute(sshCommand)
dz.log('SSH-commando op MotionEye', dz.LOG_INFO)
end
}