Project

General

Profile

Bug #134

Z-Wave interface: Poll Interval=0 doesn't disable polling, but the OZW does extreme aggressive polling

Added by Alexie about 7 years ago. Updated about 7 years ago.

Status:
Closed
Priority:
Normal
Assignee:
-
Category:
-
Target version:
Start date:
05/18/2012
Due date:
% Done:

0%

Estimated time:
Resolution:

Description

Hi Ron,

I was testing with the Open Z-Wave and poll interval=0, but if you disable the logging on the Z-Wave interface, you will not notice that the Open Z-Wave goes into a verryyy aggressive poll mode of the devices. I think this is more a bug in the Open Z-Wave project, but i don't see it fixed the very quickly.

Regards,
Alex

History

#1 Updated by rdnzl about 7 years ago

Yeah I know.
Coding the OZW wrapper is a pain in the ass...
Every time something work ok, the guys from OZW change it and some other stuff get broken, or not documenten or even noted.

I tried to put this :

    
Options::Get()->AddOptionInt("PollInterval", polltime);
Options::Get()->AddOptionBool("IntervalBetweenPolls", true);

Between a if polltime > 0 clause, but it didn't help but I'm not sure.
Somewhere in the commit notes they say each device value now has a poll variable, maybe we should set those instead.
Anyway I can use some help to get it working better, then we fork the open-zwave code it work with and keep our own stable one.

#2 Updated by rdnzl about 7 years ago

  • Status changed from New to In Progress

#3 Updated by Alexie about 7 years ago

Hi Ron,

Yes, got the same feeling about the Open Z-Wave project :D

If no poll time isn't specified, it goes to the default 30 seconds ... which is better then the aggressive polling, until we can get it fixed for domotiga.

I will dive a little bit more in the open z-wave, and i will come back when i got something useful.

Regards,
Alex

#4 Updated by rdnzl about 7 years ago

  • Status changed from In Progress to Feedback

Changed it in r883.

#5 Updated by Alexie about 7 years ago

Hi Ron,

Thanks, this is an improvement. Only i think the polling with Domotiga for Z-Wave needs to be revised a little bit with Open Z-Wave library. I noticed the following differences:

- Listening devices: they get automatically polled by the library, we don't have to manually poll them ourselves. The poll interval supplied by Domotiga is used
- Sleeping devices: they are NOT automatically polled, i think we need to start polling them manually with Domotiga. If we poll the device when at sleep, the library will queue it up until it wakes up again (I have tested this with the HSM100 device). Possible an additional polling parameter needs to be introduced into Domotiga for it, to differentiate between listening and sleeping devices.

TBC :P

Regards,
Alex

#6 Updated by Alexie about 7 years ago

Hi Ron,

I found the solution! :-)

It took me a while to figure out, but it seems that the device also remembers that a polltime is configured.

It will work perfectly, If you implement the following in "DomoZWave.cpp":

        if ( polltime > 0 )
        {
                Options::Get()->AddOptionInt("PollInterval", polltime);
                Options::Get()->AddOptionBool("IntervalBetweenPolls", true);
        }

to:

       Options::Get()->AddOptionInt("PollInterval", polltime);
       Options::Get()->AddOptionBool("IntervalBetweenPolls", true);

And in the "CZWave.class" hard disable the polling if polltime=0:

PUBLIC SUB OZW_AllQueried()

  DIM rResultNodes AS Result

  IF iPollTime = 0 THEN
    IF bZWaveDebug THEN Main.WriteDebugLog(("[Z-Wave] Polling is disabled, specify a polltime to enable."))
    RETURN
  ENDIF

  IF bZWaveDebug THEN Main.WriteDebugLog(("[Z-Wave] Searching for nodes to poll."))
  rResultNodes = Main.hDB.Exec("SELECT * from devices_zwave WHERE sleeping is FALSE")
  IF rResultNodes THEN
    IF (rResultNodes.Count >= 1) THEN
      FOR EACH rResultNodes
        IF rResultNodes!nodeid <> Main.hZWave.iControllerID THEN ' we cannot query ourselves
          IF bZWaveDebug THEN Main.WriteDebugLog(("[Z-Wave] Enable polling for node " & rResultNodes!nodeid & " every " & iPollTime & " mS."))
          DomoZWave_EnablePolling(rResultNodes!nodeid, iPolltime)
        ENDIF
      NEXT
    ENDIF
  ENDIF

END

to:

PUBLIC SUB OZW_AllQueried()

  DIM rResultNodes AS Result

  IF bZWaveDebug THEN Main.WriteDebugLog(("[Z-Wave] Searching for nodes to poll."))
  rResultNodes = Main.hDB.Exec("SELECT * from devices_zwave WHERE sleeping is FALSE")
  IF rResultNodes THEN
    IF (rResultNodes.Count >= 1) THEN
      FOR EACH rResultNodes
        IF rResultNodes!nodeid <> Main.hZWave.iControllerID THEN ' we cannot query ourselves
          IF iPollTime = 0 THEN
            IF bZWaveDebug THEN Main.WriteDebugLog(("[Z-Wave] Disable polling for node " & rResultNodes!nodeid ))
            DomoZWave_DisablePolling(rResultNodes!nodeid)
          ELSE
            IF bZWaveDebug THEN Main.WriteDebugLog(("[Z-Wave] Enable polling for node " & rResultNodes!nodeid & " every " & iPollTime & " mS."))
            DomoZWave_EnablePolling(rResultNodes!nodeid, iPolltime)
          ENDIF
        ENDIF
      NEXT
    ENDIF
  ENDIF

END

Regards,
Alex

#7 Updated by Alexie about 7 years ago

Hi Ron,

This issue can be closed, it works fine now ;)

Regards,
Alex

#8 Updated by rdnzl about 7 years ago

  • Status changed from Feedback to Closed

Also available in: Atom PDF