Good thought, Jos.
A log entry shows up immediately for the switch action and right after it (<0.5s.) for "Domoticz is sending a command", then the light switches some time after that, quite variable - just had it take 2s and 10s on two consecutive tries. On and off seem to be either quicker or slower together. The light's control module is z-wave, so it could be that the z-wave network was having a hard time earlier, perhaps, and has now settled a bit. I'll force a network heal to make sure.
I also spotted a surprising error in the log after the last test:
Code: Select all
2018-09-07 15:51:48.529 Status: LUA: Hall-switch-landing LUA event fired
2018-09-07 15:51:48.529 (Z-Wave (Aeotec Z-Stick Gen5)) Light/Switch (Hall switch landing)
2018-09-07 15:51:48.530 Status: EventSystem: Script event triggered: Hall switch2 landing lights
2018-09-07 15:51:48.559 OpenZWave: Domoticz has send a Switch command! NodeID: 23 (0x17)
2018-09-07 15:51:48.560 (Z-Wave (Aeotec Z-Stick Gen5)) Light/Switch (Landing lights)
2018-09-07 15:51:55.015 (Z-Wave (Aeotec Z-Stick Gen5)) Usage (Unknown)
2018-09-07 15:51:55.015 (Z-Wave (Aeotec Z-Stick Gen5)) General/kWh (kWh Meter)
[b]2018-09-07 15:52:00.331 Error: EventSystem: in Hall switch2 landing lights: [string "--..."]:29: attempt to index global 'devicechanged' (a nil value)[/b]
(line 29 is actually the first "if" in the code; I cut off the header comments when I posted it); I've stripped out a few irrelevant log lines caused by other, non-z-wave devices reporting in.
So, it looks like the command is sent (@48.559), received by the light and acknowledged with a status report (@48.560) all within milliseconds, then 7 seconds later the light reports a change in power usage (@55.015) which seems to cause the event to be run again, creating the error (@00.331). That empty devicechanged array is strange... why would any event code be called if no device has changed?
The light didn't actually switch on until around the same time as the power report was sent. I guess that part has to be some sort of z-wave or module configuration problem, given that the light module clearly acknowledged the command very quickly.
Any ideas on the error?