Page 1 of 1
Script run but no command are executed
Posted: Friday 08 March 2019 22:16
by emme
Ciao,
DOmoticz 4.10547....
Got a wired issue with dzVents....
script runs correctly as invoked, but no switchOn and switchOff commands are executed....
no telegram on MQTT for that device....
no error on log, devices can be switched manually....
is anyone having the same issue?
Re: Script run but no command are executed
Posted: Saturday 09 March 2019 10:24
by SweetPants
Can you provide the script part that does the actual switching/notification?
Re: Script run but no command are executed
Posted: Saturday 09 March 2019 10:28
by emme
I think I found....
There were 2 devices with the same name (both temp devices...)
somehow it messed up the entire scripting daemon

Re: Script run but no command are executed
Posted: Monday 11 March 2019 19:18
by emme
still got the issue....

even on old beta.... probably I did not discover it before...
wired situation... for any switch I have a double execution:
2019-03-11 19:14:57.297 Status: User: marco initiated a switch command (1827/Luce_Bagnetto/On)
2019-03-11 19:14:57.537 Status: dzVents: Info: [BAGNETTO Ventola]: ------ Start internal script: dzBagnettoFan: Device: "Luce_Bagnetto (net_ZW_Gen5)", Index: 1827
2019-03-11 19:14:57.541 Status: dzVents: Info: [BAGNETTO Ventola]: T: 23.60000038147°C - H: 30%
2019-03-11 19:14:57.543 Status: dzVents: Info: [BAGNETTO Ventola]: Accensione Luce Bagno ==> Ventola ON/Off
2019-03-11 19:14:57.543 Status: dzVents: Info: [BAGNETTO Ventola]: ------ Finished dzBagnettoFan
2019-03-11 19:14:57.673 Status: dzVents: Info: [BAGNETTO Ventola]: ------ Start internal script: dzBagnettoFan: Device: "Luce_Bagnetto (net_ZW_Gen5)", Index: 1827
2019-03-11 19:14:57.675 Status: dzVents: Info: [BAGNETTO Ventola]: T: 23.60000038147°C - H: 30%
2019-03-11 19:14:57.676 Status: dzVents: Info: [BAGNETTO Ventola]: Accensione Luce Bagno ==> Ventola ON/Off
2019-03-11 19:14:57.676 Status: dzVents: Info: [BAGNETTO Ventola]: ------ Finished dzBagnettoFan
I've pushed on the light switch which is supposed to switch on the fan.... script runs twice... and none of them push on the fan...
here is the script:
Code: Select all
local devTempHum = 'TEM_Bagnetto'
local devLuce = 'Luce_Bagnetto'
local varHMax = 'bagnettoHumMax'
local varHMin = 'bagnettoHumMin'
local devFan = 'Ventola_Bagnetto'
return {
on = {
devices = { devTempHum, devLuce }
},
logging = {
level = domoticz.LOG_INFO,
marker = "[BAGNETTO Ventola]"
},
execute = function(dz, devName)
local humMax = tonumber(dz.variables(varHMax).value )
local humMin = tonumber(dz.variables(varHMin).value )
dz.log('T: '..dz.devices(devTempHum).temperature..'°C - H: '..dz.devices(devTempHum).humidity..'%')
if devName.name == devLuce and devName.state == 'On' then
dz.devices(devFan).switchOn().checkFirst()
dz.log('Accensione Luce Bagno ==> Ventola ON/'..dz.devices(devFan).state)
elseif devName.name == devLuce and devName.state == 'Off' then
dz.log('Spegnimento Luce Bagno ==> Valutazione')
if tonumber(dz.devices(devTempHum).humidity) > humMax then
dz.log('Umidità ['..dz.devices(devTempHum).humidity..'%] sopra il valore impostato.... accensione')
dz.devices(devFan).switchOn().checkFirst()
elseif tonumber(dz.devices(devTempHum).humidity) <= humMin then
dz.log('Umidità ['..dz.devices(devTempHum).humidity..'%] sotto il valore impostato.... spegnimento')
dz.devices(devFan).switchOff().checkFirst()
end
elseif devName.name == devTempHum and dz.devices(devLuce).state == 'Off' then
dz.log('Variazione T e H ==> Valutazione')
if tonumber(dz.devices(devTempHum).humidity) > humMax then
dz.log('Umidità ['..dz.devices(devTempHum).humidity..'%] sopra il valore impostato.... accensione')
dz.devices(devFan).switchOn().checkFirst()
elseif tonumber(dz.devices(devTempHum).humidity) <= humMin then
dz.log('Umidità ['..dz.devices(devTempHum).humidity..'%] sotto il valore impostato.... spegnimento')
dz.devices(devFan).switchOff().checkFirst()
end
end
end
}
Re: Script run but no command are executed
Posted: Monday 11 March 2019 20:33
by waaren
emme wrote: Monday 11 March 2019 19:18
still got the issue....

even on old beta.... probably I did not discover it before...
Sometimes Zwave or Xiaomi devices does send the state of a device more than 1 time to domoticz. dzVents cannot prevent this but you could do something with an extra check like
Code: Select all
local devTempHum = 'TEM_Bagnetto' -- temperature bathroom
local devLuce = 'Luce_Bagnetto' -- light
local varHMax = 'bagnettoHumMax' -- humidity
local varHMin = 'bagnettoHumMin'
local devFan = 'Ventola_Bagnetto' -- ventilator bathroom
return {
on = {
devices = { devTempHum, devLuce }
},
logging = {
level = domoticz.LOG_INFO,
marker = "[BAGNETTO Ventola]"
},
data = { lastupdate = { initial = 0 } },
execute = function(dz, devName)
local humMax = tonumber(dz.variables(varHMax).value )
local humMin = tonumber(dz.variables(varHMin).value )
dz.log('T: '..dz.devices(devTempHum).temperature..'°C - H: '..dz.devices(devTempHum).humidity..'%')
dz.log(devName.name .. "; State ==>> " .. devName.state,dz.LOG_INFO)
if tonumber(dz.data.lastupdate) + 2 > os.time(os.date('*t')) then -- Too soon
return
end
dz.data.lastupdate = os.time(os.date('*t'))
if devName.name == devLuce and devName.state == 'On' then
dz.devices(devFan).switchOn().checkFirst()
dz.log('Accensione Luce Bagno ==> Ventola ON/'..dz.devices(devFan).state)
elseif devName.name == devLuce and devName.state == 'Off' then
dz.log('Spegnimento Luce Bagno ==> Valutazione')
if tonumber(dz.devices(devTempHum).humidity) > humMax then
dz.log('Umidità ['..dz.devices(devTempHum).humidity..'%] sopra il valore impostato.... accensione')
dz.devices(devFan).switchOn().checkFirst()
elseif tonumber(dz.devices(devTempHum).humidity) <= humMin then
dz.log('Umidità ['..dz.devices(devTempHum).humidity..'%] sotto il valore impostato.... spegnimento')
dz.devices(devFan).switchOff().checkFirst()
end
elseif devName.name == devTempHum and dz.devices(devLuce).state == 'Off' then
dz.log('Variazione T e H ==> Valutazione')
if tonumber(dz.devices(devTempHum).humidity) > humMax then
dz.log('Umidità ['..dz.devices(devTempHum).humidity..'%] sopra il valore impostato.... accensione')
dz.devices(devFan).switchOn().checkFirst()
elseif tonumber(dz.devices(devTempHum).humidity) <= humMin then
dz.log('Umidità ['..dz.devices(devTempHum).humidity..'%] sotto il valore impostato.... spegnimento')
dz.devices(devFan).switchOff().checkFirst()
end
end
end
}
Re: Script run but no command are executed
Posted: Tuesday 12 March 2019 7:54
by emme
that's not a gateway problem, switches can be correctly operated manually or via mqtt/http... seems to be a event daemon related issue
even with blocky or LUA switches does not operate...
I tried a worst scenario: reinstall from scratch and copy back the DB (dzvents scripts will come from the internal generated scripts

)
Today worked... I'll se when I'll get home this evening if it does still works... then I assume it was a core/rights related issue