Page 1 of 2

How can I best debug dzVents?

Posted: Wednesday 11 August 2021 11:23
by EddyG
My Zigbee plugin / Zigbee adaptor is giving me currently a lot of trouble.
I already did a lot to prevent / discover the issue.
I got this dzVents error, and wonder what is the best way to debug this further.

Code: Select all

2021-08-11 11:17:09.602 Error: dzVents: Error: (3.1.8) ...pi/domoticz/scripts/dzVents/scripts/pir zolder light.lua:25: attempt to index a nil value
2021-08-11 11:17:41.989 Error: EventSystem: in /home/pi/domoticz/dzVents/runtime/dzVents.lua: ...oticz/dzVents/runtime/device-adapters/generic_device.lua:67: attempt to index a nil value (field '_')
The last line is not very helpfull, what is field '_'?

Re: How can I best debug dzVents?

Posted: Wednesday 11 August 2021 13:25
by waltervl
Did you switch on dzVents debugging? https://www.domoticz.com/wiki/DzVents:_ ... g#Settings

Re: How can I best debug dzVents?

Posted: Thursday 12 August 2021 10:02
by EddyG
Yes, but that does not help.
I get messages like: Writing module summary .... But in that file there is no error info.
I get messages like: Dumping Domoticz data .... But that file get overwritten before I could look in it.
I get messages like: There is no device ..... But the device is present and working in Domoticz.

So non of the debug info is helpful to trace down the problem.

Should ALL devices be present in the dump data in Domoticz.lua???

Re: How can I best debug dzVents?

Posted: Thursday 12 August 2021 10:46
by waltervl
Temporarely switch off all other DzVents scripts as it seems you have a lot of actions going on that overwrite the debug logging files.
Also perhaps minimize the triggers.

I never needed the debug logging myself, just trying to help.

Re: How can I best debug dzVents?

Posted: Thursday 12 August 2021 11:15
by EddyG
Not doable. Errors are a kind of random, can take up to hours. It is a production system.
But there should some more info then "attempt to index a nil value (field '_')"
Yeh, field '_', but what is the real name, or where does this field originate from?

Re: How can I best debug dzVents?

Posted: Friday 13 August 2021 10:52
by EddyG
It gets even worse. And it is all about zigbee, the plugin or zigbee2mqtt
After I finally got both Domoticz and zigbee running, it looks like that Domoticz does not recognize some of the devices.
I get this kind of error when ever a dzVents script is called by time or a device.

Code: Select all

2021-08-13 10:41:44.085 Error: dzVents: Error: (3.1.8) There is no device with that name or id: Garage - Buiten
2021-08-13 10:41:44.085 Error: dzVents: Error: (3.1.8) An error occurred when calling event handler slave garage-buiten
2021-08-13 10:41:44.085 Error: dzVents: Error: (3.1.8) ...domoticz/scripts/dzVents/scripts/slave garage-buiten.lua:99: attempt to index a nil value
The device is 'Garage - Buiten' is present and active in both Domoticz and zigbee2mqtt.
When I set the device to On or Off in the zigbee2mqtt gui it works normally and this error disappears for this device.
The plugin has to be disabled at the start of domoticz and then enabled again.
Then it gives a normal startup without errors.

Code: Select all

2021-08-13 10:09:29.448  Status: Zigbee: (Zigbee) Initialized version 3.0.1
2021-08-13 10:09:29.497  Status: Aeon Gen5: Awake Nodes queried
2021-08-13 10:09:29.524  Zigbee: (Zigbee) Installing plugin custom page...
2021-08-13 10:09:29.543  Zigbee: (Zigbee) Installing plugin custom page completed.
2021-08-13 10:09:29.594  Zigbee: (Zigbee) Connected to MQTT Server: 192.168.2.239:1883
2021-08-13 10:09:29.697  Zigbee: (Zigbee) Zigbee2mqtt bridge is online
2021-08-13 10:09:29.709  Zigbee: (Zigbee) Received available devices list from bridge
2021-08-13 10:09:29.724  Zigbee: (Zigbee) Joining new devices is disabled on the zigbee bridge
2021-08-13 10:09:29.906  Zigbee: (Zigbee) Received groups list from bridge
Anybody any ideas???

Re: How can I best debug dzVents?

Posted: Friday 13 August 2021 11:31
by waltervl
Perhaps change the name, it could have some incorrect hidden character in it.
If this device is the only problem, delete it from Domoticz and Zigbee2MQTT and pair it again. It will be recreated in Domoticz under a new idx. I have seen this be a fix for strange behaving devices.

Re: How can I best debug dzVents?

Posted: Friday 13 August 2021 12:14
by EddyG
It is not in the name, because when I actuate the switch it is working fine and does not give errors anymore.
It looks like the plugin is not giving Domoticz the complete list of devices and that is corrected by the first actuation of the switch.
And every time the system or Domoticz is restarted the list of devices which are not working initially and giving the error is completely random.
It is always more the one device, but not all and random every restart.

Re: How can I best debug dzVents?

Posted: Friday 13 August 2021 13:10
by waltervl
Then you better make an issue in the zigbee2mqtt github https://github.com/stas-demydiuk/domoti ... qtt-plugin as it seems Python plugin related. perhaps more zigbee2mqtt users have this issue?

Re: How can I best debug dzVents?

Posted: Friday 13 August 2021 15:04
by EddyG
When I look at the commit history and the number of open issues there is not much going on.
If I cannot pinpoint the issue more, my guess is that nothing will be done.
The project is close to dead.
That is why I am already in the process (hell of a job) of getting all my devices processed my node-red.
8 devices done and 47 to go....

Re: How can I best debug dzVents?

Posted: Friday 13 August 2021 15:08
by waltervl
Or buy a Zigate ;-)

Re: How can I best debug dzVents?

Posted: Friday 13 August 2021 15:56
by heggink
EddyG wrote:When I look at the commit history and the number of open issues there is not much going on.
If I cannot pinpoint the issue more, my guess is that nothing will be done.
The project is close to dead.
That is why I am already in the process (hell of a job) of getting all my devices processed my node-red.
8 devices done and 47 to go....
What is your definition of close to dead? I have made a couple of PR's lately that all got implemented within a few days. The base plugin is quite functional so the original developer has no need to change. It's open source...

Sent from my SM-G980F using Tapatalk


Re: How can I best debug dzVents?

Posted: Friday 13 August 2021 16:10
by heggink
EddyG wrote: Friday 13 August 2021 10:52 It gets even worse. And it is all about zigbee, the plugin or zigbee2mqtt
After I finally got both Domoticz and zigbee running, it looks like that Domoticz does not recognize some of the devices.
I get this kind of error when ever a dzVents script is called by time or a device.

Code: Select all

2021-08-13 10:41:44.085 Error: dzVents: Error: (3.1.8) There is no device with that name or id: Garage - Buiten
2021-08-13 10:41:44.085 Error: dzVents: Error: (3.1.8) An error occurred when calling event handler slave garage-buiten
2021-08-13 10:41:44.085 Error: dzVents: Error: (3.1.8) ...domoticz/scripts/dzVents/scripts/slave garage-buiten.lua:99: attempt to index a nil value
The device is 'Garage - Buiten' is present and active in both Domoticz and zigbee2mqtt.
When I set the device to On or Off in the zigbee2mqtt gui it works normally and this error disappears for this device.
The plugin has to be disabled at the start of domoticz and then enabled again.
Then it gives a normal startup without errors.

Code: Select all

2021-08-13 10:09:29.448  Status: Zigbee: (Zigbee) Initialized version 3.0.1
2021-08-13 10:09:29.497  Status: Aeon Gen5: Awake Nodes queried
2021-08-13 10:09:29.524  Zigbee: (Zigbee) Installing plugin custom page...
2021-08-13 10:09:29.543  Zigbee: (Zigbee) Installing plugin custom page completed.
2021-08-13 10:09:29.594  Zigbee: (Zigbee) Connected to MQTT Server: 192.168.2.239:1883
2021-08-13 10:09:29.697  Zigbee: (Zigbee) Zigbee2mqtt bridge is online
2021-08-13 10:09:29.709  Zigbee: (Zigbee) Received available devices list from bridge
2021-08-13 10:09:29.724  Zigbee: (Zigbee) Joining new devices is disabled on the zigbee bridge
2021-08-13 10:09:29.906  Zigbee: (Zigbee) Received groups list from bridge
Anybody any ideas???
I noticed you mentioned that you are moving devices to node-red. I was going through a similar exercise when replacing OZW with our new zwavejs2mqtt plugin: whenever I disabled OZW (which disables all its devices) and enabled teh zwavejs plugin, creating new devices for the already in OWZ defined devices even though they were disabled, dzvenst would get really upset as if the disabled devices were interfering with the newly created devices. I got very similar messages like the one you see. Weird errors and shit. These all went away the moment I deleted the OWZ adapter altogether (causing all its devices to be deleted). I suspect that a domoticz restart may actually solve the ussues around disabled adapters and its devices. Not sure if this is the same underlying issue in your case though.

Also interested to hear what problems you face with the zigbee2mqtt plugin.

Re: How can I best debug dzVents?

Posted: Friday 13 August 2021 18:44
by EddyG
waltervl wrote: Friday 13 August 2021 15:08 Or buy a Zigate ;-)
I consider that.
heggink wrote: Friday 13 August 2021 15:56 What is your definition of close to dead? I have made a couple of PR's lately that all got implemented within a few days. The base plugin is quite functional so the original developer has no need to change. It's open source...

Sent from my SM-G980F using Tapatalk
Look at the number of open issues. Milestone v3.1 last update 3 month ago. I appreciated your 'Update adaptor.py'
https://github.com/stas-demydiuk/domoti ... issues/569 is from 8 feb.

About devices, I had a lot of trouble comming from the switch from pre v3.0 to v3.0, I will look it over again if there is some residues.
With more then 50 devices in production I am not happy to start all over again.
A simple but stupid problem is still there: this device https://www.zigbee2mqtt.io/devices/WSDC ... wsdcgq11lm
gives a pressure device in BAR and I can tell you that the current 1019 Bar is a lot, it should be a barometer device in hPa

Re: How can I best debug dzVents?

Posted: Friday 13 August 2021 19:57
by EddyG
heggink wrote: Friday 13 August 2021 16:10 These all went away the moment I deleted the OWZ adapter altogether (causing all its devices to be deleted). I suspect that a domoticz restart may actually solve the ussues around disabled adapters and its devices.
The problem with that methode is that all historical data is gone....

Re: How can I best debug dzVents?

Posted: Friday 13 August 2021 21:15
by waltervl
EddyG wrote: Friday 13 August 2021 19:57
heggink wrote: Friday 13 August 2021 16:10 These all went away the moment I deleted the OWZ adapter altogether (causing all its devices to be deleted). I suspect that a domoticz restart may actually solve the ussues around disabled adapters and its devices.
The problem wxith that methode is that all historical data is gone....
You can use the domoticz replace function, the old device will automatically be deleted.
So disable old hardware, enable new hardware and replace all devices. Then delete old hardware. But everything in a small timeframe.

Re: How can I best debug dzVents?

Posted: Friday 13 August 2021 21:26
by heggink
EddyG wrote:
waltervl wrote: Friday 13 August 2021 15:08 Or buy a Zigate ;-)
I consider that.
heggink wrote: Friday 13 August 2021 15:56 What is your definition of close to dead? I have made a couple of PR's lately that all got implemented within a few days. The base plugin is quite functional so the original developer has no need to change. It's open source...

Sent from my SM-G980F using Tapatalk
Look at the number of open issues. Milestone v3.1 last update 3 month ago. I appreciated your 'Update adaptor.py'
https://github.com/stas-demydiuk/domoti ... issues/569 is from 8 feb.

About devices, I had a lot of trouble comming from the switch from pre v3.0 to v3.0, I will look it over again if there is some residues.
With more then 50 devices in production I am not happy to start all over again.
A simple but stupid problem is still there: this device https://www.zigbee2mqtt.io/devices/WSDC ... wsdcgq11lm
gives a pressure device in BAR and I can tell you that the current 1019 Bar is a lot, it should be a barometer device in hPa
I have a number of these aqara sensors. They all report hpa, not bar so weird that yours don't. I know that I had to delete in order for the plugin to create the correct device. That's the downside of open source, sometimes it takes a couple of iterations before it's solid and sometimes that leads to breaking changes.

I follow all updates of the plugin. The fact that there are outstanding PRs does not mean that no work is done. Without exception, ALL changes I proposed were accepted in days. I have seen PRs for implementing devices that should be part of the universal adapter and therefore being questioned. If then there's no answer, I understand why these are outstanding.

Also, if all of us depend on Stas doing all the changes then it will take time. Domoticz is as good as the community willing to contribute. That's not as good as it should be at the moment. That said, I looked at HA (had it running in parallel). Community is very active but support for both Python plugins and something like dzvents is dismal.

Choices...

Sent from my SM-G980F using Tapatalk


Re: How can I best debug dzVents?

Posted: Friday 13 August 2021 21:29
by heggink
EddyG wrote:
heggink wrote: Friday 13 August 2021 16:10 These all went away the moment I deleted the OWZ adapter altogether (causing all its devices to be deleted). I suspect that a domoticz restart may actually solve the ussues around disabled adapters and its devices.
The problem with that methode is that all historical data is gone....
You should be able to retain the history if you don't delete the old device. Domoticz has an option to swap a device and retain the history.

Sent from my SM-G980F using Tapatalk


Re: How can I best debug dzVents?

Posted: Friday 13 August 2021 21:35
by EddyG
Are you sure, when you delete hardware, I think that associated devices are deleted too.
I deleted all devices from that aqura sensor.
My '_press' device was newly created. So that is strange

Re: How can I best debug dzVents?  [SOLVED]

Posted: Friday 13 August 2021 21:38
by heggink
If you delete hardware,all devices are lost so that doesn't work Indeed. You need new devices before you delete the old and then transfer the history.

Sent from my SM-G980F using Tapatalk