Page 1 of 1
Silent() not working for Qubino shutter
Posted: Wednesday 20 November 2019 23:03
by ronaldbro
Hi,
When I use the following commands to my Qubino z-wave roller shutter I still get device triggers in my scripts:
dz.devices('shutter').close().silent()
dz.devices('shutter').open().silent()
dz.devices('shutter').dimTo().silent()
Is this a bug or has it something to do with the hardware?
Is there any way to work around this?
I'm building a script to control my roller shutters and want to detect a manual action to change the controlling state in my script. Normally it should run automatically but when a manual action occurs it should stay in manual mode until it gets dark.
Because of this problem the state goed to manual mode after the first automatic action.
Regards Ronald
Re: Silent() not working for Qubino shutter
Posted: Thursday 21 November 2019 0:10
by waaren
ronaldbro wrote: Wednesday 20 November 2019 23:03
When I use the following commands to my Qubino z-wave roller shutter I still get device triggers in my scripts:
dz.devices('shutter').close().silent()
dz.devices('shutter').open().silent()
dz.devices('shutter').dimTo().silent()
Seems to be related to what is described
here
Re: Silent() not working for Qubino shutter
Posted: Thursday 21 November 2019 0:17
by ronaldbro
Not really, I don’t send two commands. Only one command is send to the shutter.
Re: Silent() not working for Qubino shutter
Posted: Thursday 21 November 2019 1:47
by waaren
ronaldbro wrote: Thursday 21 November 2019 0:17
Not really, I don’t send two commands. Only one command is send to the shutter.
Even if you do not send this on purpose some zwave devices kind of echo the command causing domoticz to trigger an event.
Would be interesting to see what is in the log.
Re: Silent() not working for Qubino shutter
Posted: Thursday 21 November 2019 9:10
by ronaldbro
I guess you are right.
I made a simple test script to remove all the extra fuzz in the log and I see two switch commands.
Also in the device log I see two entries. First the sutter reports it's current position and then the setpoint.
Do you have any suggestions to work around this? I can think of storing the time the command is send in the script and then ignore all device updates for 1 second but I don't think this is very reliable. It could take longer to send the command to the device and when I increase the time I could mis a manual stop command.
Script:
- Spoiler: show
- return {
on = {
devices = {
idx_test_switch
}
},
-- custom logging level for this script
logging = {
level = domoticz.LOG_DEBUG,
marker = "Test"
},
execute = function(dz, Item, info)
if Item.level == 10 then -- left button click
dz.devices(idx_woonkamer_rolluik).dimTo(0)
elseif Item.level == 20 then -- left button double click
elseif Item.level == 40 then -- right button click
end
end
}
Log:
- Spoiler: show
- 2019-11-21 08:59:42.059 (Xiaomi) Light/Switch (Test Switch)
2019-11-21 08:59:42.372 OpenZWave: Domoticz has send a Switch command!, Level: 0, NodeID: 12 (0x0c)
2019-11-21 08:59:42.374 (zwave) Usage (Woonkamer: Rolluik - Unknown)
2019-11-21 08:59:42.381 (zwave) General/kWh (Woonkamer: Rolluik - kWh Meter)
2019-11-21 08:59:42.396 (zwave) Light/Switch (Woonkamer: Rolluik)
2019-11-21 08:59:42.477 (zwave) Light/Switch (Woonkamer: Rolluik)
2019-11-21 08:59:42.353 Status: dzVents: Info: Test: ------ Start internal script: Knoptest zigate: Device: "Test Switch (Xiaomi)", Index: 528
2019-11-21 08:59:42.354 Status: dzVents: Debug: Test: Processing device-adapter for Woonkamer: Rolluik: Switch device adapter
2019-11-21 08:59:42.355 Status: dzVents: Debug: Test: Constructed timed-command: Set Level 0
2019-11-21 08:59:42.355 Status: dzVents: Info: Test: ------ Finished Knoptest zigate
2019-11-21 08:59:43.443 (zwave) Usage (Woonkamer: Rolluik - Unknown)
2019-11-21 08:59:43.459 (zwave) General/kWh (Woonkamer: Rolluik - kWh Meter)
2019-11-21 08:59:45.445 (zwave) Usage (Woonkamer: Rolluik - Unknown)
2019-11-21 08:59:45.460 (zwave) General/kWh (Woonkamer: Rolluik - kWh Meter)
Device log:
2019-11-21 08:59:42 Open
2019-11-21 08:59:42 Closed
Re: Silent() not working for Qubino shutter
Posted: Thursday 21 November 2019 10:02
by waaren
ronaldbro wrote: Thursday 21 November 2019 9:10
Do you have any suggestions to work around this?
Only work-around I can think of is the script in
the topic I posted earlier in this thread
Re: Silent() not working for Qubino shutter
Posted: Thursday 21 November 2019 11:22
by hestia
Hi
it seems to be the same issue as this post
https://www.domoticz.com/forum/viewtopi ... 99#p224799
I've set up this workaround, but I have to go to 9 seconds, and of course I miss some manual On/Off
I first find it in a previous beta of the previous release, perhaps it is due to an extension of my network ("some zwave devices kind of echo the command causing domoticz to trigger an event").
I have 1 device that don't have the issue, but on the other hand , its state is not refresh in domoticz when I switch if manually.
Re: Silent() not working for Qubino shutter
Posted: Thursday 21 November 2019 12:04
by hestia
I've just include a new Qubino ZMNHBDx Flush 2 Relays+
For the refresh in Domoticz when I switch it manually it is OK
And for the silent it is also ok. I did a testing during 1/2 hour with 1 test / min. No wrong event.
I put it near another one with this issue and heal the network: no change it still work fine. I think this test show it is not an echo on the network...
Version: 4.11503
Re: Silent() not working for Qubino shutter
Posted: Monday 25 November 2019 9:30
by ronaldbro
I did some investigation on the triggeredItem.dump() return values and noticed some differences when controlled with the buttons or from the script.
When I control it with the buttons the dump() returns values like LOG_FORCE, LOG_INFO, LOG_MODULE_EXEC_INFO.
But when I try to use this by:
If triggeredItem.LOG_MODULE_EXEC_INFO ~= nil then
ManualMode = true
End
Then I always see nil for LOG_MODULE_EXEC_INFO
Is there any way to use this?
Re: Silent() not working for Qubino shutter
Posted: Monday 25 November 2019 10:57
by waaren
ronaldbro wrote: Monday 25 November 2019 9:30
I did some investigation on the triggeredItem.dump() return values and noticed some differences when controlled with the buttons or from the script.
When I control it with the buttons the dump() returns values like LOG_FORCE, LOG_INFO, LOG_MODULE_EXEC_INFO.
But when I try to use this by:
If triggeredItem.LOG_MODULE_EXEC_INFO ~= nil then
ManualMode = true
End
Then I always see nil for LOG_MODULE_EXEC_INFO
Is there any way to use this?
What you see in the dump as value for LOG_MODULE_EXEC_INFO is actually the value for
triggeredItem.lastUpdate.utils.LOG_MODULE_EXEC_INFO and this should be the same as domoticz.LOG_MODULE_EXEC_INFO (or dz.LOG_MODULE_EXEC_INFO depending how you pass your domoticz object to the dzVents script in the execute = call )
I have no idea why the value of this attribute could be different for your device when triggered by button or triggered by script but if it is you can use it with:
Code: Select all
dz.log('value of dz.LOG_MODULE_EXEC_INFO: ' .. tostring(dz.LOG_MODULE_EXEC_INFO),dz.LOG_FORCE)
dz.log('value of triggeredItem.lastUpdate.utils.LOG_MODULE_EXEC_INFO: ' .. tostring(triggeredItem.lastUpdate.utils.LOG_MODULE_EXEC_INFO),dz.LOG_FORCE)
if dz.LOG_MODULE_EXEC_INFO ~= nil then
ManualMode = true
end
or
Code: Select all
dz.log('value of dz.LOG_MODULE_EXEC_INFO: ' .. tostring(dz.LOG_MODULE_EXEC_INFO),dz.LOG_FORCE)
dz.log('value of triggeredItem.lastUpdate.utils.LOG_MODULE_EXEC_INFO: ' .. tostring(triggeredItem.lastUpdate.utils.LOG_MODULE_EXEC_INFO),dz.LOG_FORCE)
ManualMode = triggeredItem.lastUpdate.utils.LOG_MODULE_EXEC_INFO ~= nil
Re: Silent() not working for Qubino shutter
Posted: Tuesday 26 November 2019 8:59
by hestia
I've tried this
Code: Select all
local SWITCH = {867}
return {
on = { devices = SWITCH },
logging = { level = domoticz.LOG_DEBUG,
marker = "ZwaveSwitch" },
execute = function(dz, triggeredItem)
local ManualMode = false
dz.log('Device '.. triggeredItem.name .. " (" .. triggeredItem.id .. ")" .. triggeredItem.state , dz.LOG_DEBUG)
if triggeredItem.active then
dz.log('Active',dz.LOG_FORCE)
else
dz.log('NOT active',dz.LOG_FORCE)
end
if dz.LOG_MODULE_EXEC_INFO == nil then
dz.log('value of dz.LOG_MODULE_EXEC_INFO: NIL',dz.LOG_FORCE)
else
dz.log('value of dz.LOG_MODULE_EXEC_INFO: ' .. tostring(dz.LOG_MODULE_EXEC_INFO),dz.LOG_FORCE)
end
if tostring(triggeredItem.lastUpdate.utils.dz.LOG_MODULE_EXEC_INFO) == nil then
dz.log('value of triggeredItem.lastUpdate.utils.dz.LOG_MODULE_EXEC_INFO: NIL',dz.LOG_FORCE)
else
dz.log('value of triggeredItem.lastUpdate.utils.dz.LOG_MODULE_EXEC_INFO: ' .. tostring(triggeredItem.lastUpdate.utils.dz.LOG_MODULE_EXEC_INFO),dz.LOG_FORCE)
end
end
}
I've got this error
- Spoiler: show
-
2019-11-26 08:56:46.063 Status: User: xxxx initiated a switch command (867/Studio SdB 1/On)
2019-11-26 08:56:46.256 Status: dzVents: Info: ZwaveSwitch: ------ Start internal script: Switch: Device: "Studio SdB 1 (Z-Wave Plus Z-Stick Gen5)", Index: 867
2019-11-26 08:56:46.257 Status: dzVents: Debug: ZwaveSwitch: Device Studio SdB 1 (867)On
2019-11-26 08:56:46.257 Status: dzVents: !Info: ZwaveSwitch: Active
2019-11-26 08:56:46.257 Status: dzVents: !Info: ZwaveSwitch: value of dz.LOG_MODULE_EXEC_INFO: 2
2019-11-26 08:56:46.257 Status: dzVents: Info: ZwaveSwitch: ------ Finished Switch
2019-11-26 08:56:46.257 Error: dzVents: Error: (2.5.0) ZwaveSwitch: An error occurred when calling event handler Switch
2019-11-26 08:56:46.257 Error: dzVents: Error: (2.5.0) ZwaveSwitch: ...pi/domoticz/scripts/dzVents/generated_scripts/Switch.lua:31: attempt to index a nil value (field 'dz')
My mistake?
On the other hand, no difference for my device dz.LOG_MODULE_EXEC_INFO: 2 with a real switch or the dz device
Re: Silent() not working for Qubino shutter
Posted: Tuesday 26 November 2019 10:38
by waaren
hestia wrote: Tuesday 26 November 2019 8:59
My mistake?
No, mine

; too much copy / paste...
change utils.dz to utils everywhere in the script.
Re: Silent() not working for Qubino shutter
Posted: Tuesday 26 November 2019 23:36
by hestia
Thanks waaren
no longer an error, but still the same value for the real switch or the dz device.
It would have been convenient to have a field with a different value regarding a real switch or the GUI
Re: Silent() not working for Qubino shutter [Solved]
Posted: Sunday 08 December 2019 19:31
by ronaldbro
I decided to solve the problem in a different way. In my shutter script I save the send setpoint and the datetime and then I use an execute time of 60 seconds in which the script will not do anything. After this time I compare the shutter level to the send setpoint and when it’s different I assume it’s manual operated and a state change is forced.
This solution will be more stable in future then maybe getting it to work with an undocumented feature
Anyway, thanks for your help.
Re: Silent() not working for Qubino shutter
Posted: Sunday 08 December 2019 22:14
by ronaldbro