script:///C:\Users\server\Desktop\MyAir2.py 192.168.0.201 --mode Favorite
But domoticz thinks the third forward slash is part of the path and I'm getting this error (without the parameters)
Error: SQLHelper: Error script not found '/C:\Users\server\Desktop\MyAir2.py
When that didn't work I also found a dzvents script that I modified
Code: Select all
return
{
on =
{
devices =
{
331, -- MI robot Control
},
},
logging =
{
level = domoticz.LOG_DEBUG,
marker = 'cleaner',
},
execute = function(dz, device)
local lodash = dz.utils._
dz.log('Device ' .. device.name .. ' was updated', dz.LOG_DEBUG)
dz.log('LevelNames: ' .. lodash.str(device.levelNames), dz.LOG_DEBUG)
if device.levelName == 'Auto' then
os.execute("C:\\Users\\server\\Desktop\\MyAir2.py 192.168.0.201 --mode Favorite")
end
dz.log(lodash.str(dz.globalData),dz.LOG_DEBUG)
end
}
2022-12-30 17:47:40.981 Status: dzVents: Info: cleaner: ------ Start internal script: Script #3: Device: "Air purifer (Custom Sensors)", Index: 331
2022-12-30 17:47:40.982 Status: dzVents: Debug: cleaner: Device Air purifer was updated
2022-12-30 17:47:40.982 Status: dzVents: Debug: cleaner: LevelNames: {"Off", "Auto"}
2022-12-30 17:47:41.091 Status: dzVents: Debug: cleaner: {}
2022-12-30 17:47:41.091 Status: dzVents: Info: cleaner: ------ Finished Script #3
Does anybody know how I could make it work?