Optimize Program to improve OP2 Speed

sjht

Active Member
I'm looking for ways to improve the speed of my OP2.  Maybe it's just getting old.. lol.  Anyway,   looking at my zwave lighting, but also wonder if there are types of code that could potentially cause delays in my setup.  For example, when I open my garage door (into the house) or my garage door (leading to our backyard), the "not ready" of those zones issues a command to turn on the lights in the garage for a certain amount of time.  In general, it works fine.  However, sometimes it delays by 10 seconds and other times I have seen delays like at 30 seconds.  95% of the time,  it is within a couple of seconds.  I figure, something must be causing these differences (besides my zwave setup) and wonder whether some of my code that checks things every hour, etc. is doing this.  Not sure, but wondered whether there are some "don't dos" with HAI code that I can look for.  Thanks.  SJ
 
I would be inclined to suggest it is not HAI but z-wave. Do you have polling enabled? I have more than 1300 lines of code in HAI but nowhere near the delays you describe. When I had z-wave devices controlled by HAI, I had a very inconsistent performance. HAI also is polling locks every 2 mins or so, if you have any. I had detached all z-wave devices from HAI, and don't have any issues with response times.
 
Where do you control polling?  I do have two zwave lock devices.   If I look at detaching zwave from HAI, how do you control them and/or integrate with HAI events?  I do have a Homeseer unit which I could setup to control the zwave.  Only really use it for Amazon Echo integration at this point.   I'm also looking at reducing my zwave footprint and converting some over to another protocol to reduce my zwave network size.  Thanks for your suggestions.  SJ
 
With Homeseer Software integration you could have an autonomous Z-Wave network (smaller/ a la carte), integration of the  OmniPlugin and it would provide a bit more oomph to the Omni Pro panel. 
 
That and adding a UPB PIM to Homeseer will let you talk to the newer UPB devices (dual load / multitoggle stuff).
 
About a year ago I wrote a post on optimizing HAI code.  I did it myself and it produced good improvement.  Also made it easier to maintain.  I'll look for the post, but there are two things you can do.  Try to only poll each "thing" at one location, and use subroutines to reuse code. As others have said, input and output to the outside world is most time consuming, but there are tricks there also. Like with UPB, use links to control many lights at once instead of individual commands.  There is lots of optimizing to be had.
 
There is no way to control polling of locks in HAI, it happens roughly every 2 minutes and creates a ton of traffic on z-wave channel. But this is not the problem for HAI code, its a problem for the rest of zwave network which is not known to be efficient with high traffic. Homeseer is a better controller for z-wave since this is their main tech. HAI is best with UPB, zigbee or RadioRA.
 
Thanks for the info. Also, Ive been running Haiku Helper (on my Mac mini). Was primarily using it for IOS notifications, but after those stopped working, I never turned it off. Well, I stopped it running and Im now seeing a real improvement in my system. Strange.... SJ
 
Do a search here on Cocoontech relating to Haiku Helper and you will see that Haiku Helper was overwhelming the Omni network port (10Mb / 1/2 duplex) sometimes and there was no throttling in the software causing disconnects with other Omni connected devices (well like OmniPro touchscreens).
 
When the network port is overwhelmed then the serial bus gets overwhelmed then you abend the Omni panel.  You can see this happening live initially when your Omni Clock starts going way off kilter.  Then serial devices act funny (consoles, thermostats, audio) and finally you get a few disconnects on the network port then at the end it just disconnects.  HAI CT stated this was related to a too slow and promiscuous legacy network port on the omni panel) and back then many home networks had only one computer on it.  The real fix for this would be a replacement of the network chip on the omnipro panel.  A recall and fix of the network interface of the panels would be nice but I doubt very much that Leviton will be doing this.  They have updated the firmware of the panel (s) to address the issues but personally do not know if the firmware fixed it as I have left the microrouter in place and do not see this issue anymore.
 
The band fix is to install a router between the network interface and your home LAN (layer 2 - layer 3 - layer2).  Here personally installed a 1" X 2" microrouter with OpenWRT on it and initially it was powered by the OmniPro panel.  I documented here that an old network hub or switch or VLAN did not work to fix this way long time ago.
 
This would probably work for you such that you could probably keep Haiku Helper running with the microrouter in place.
 
As there is no documented fix of this from Leviton or HAI I do not know if this is the correct way to do it but it worked for me as I have never seen the problem crop up since doing this. 
 
I have a second router already in place (based on your suggestions from other threads) and has solved a lot of network issues.  However, now since having Haiku Helper off over the last several days, my system seems to be running pretty fast again.  Not noticing any slowdowns with lights, etc.  Interesting, as I followed the Haiku Helper thread and didn't see those issues.  However, I was late to that party.  Anyway, thank you!   Also, have you noticed any of these type of issues with Homeseer connectivity to HAI?   SJ
 
have you noticed any of these type of issues with Homeseer connectivity to HAI?
 
No.
 
Testing the Omni Plugin on two Homeseer computers.
 
Also using HAILogger on one of the two Homeseer computers.
 
I do sometimes compare the speed of turning on a UPB lamp via Homeseer or Omnitouch.  I do not see any difference in response times here.
 
Back
Top