Z-Wave

Questions and comments specific to a particular plugin should go here.
User avatar
kgschlosser
Site Admin
Posts: 4652
Joined: Fri Jun 05, 2015 5:43 am
Location: Rocky Mountains, Colorado USA

Re: Z-Wave

Post by kgschlosser » Sat Aug 11, 2018 8:32 am

@holdestmade

Does that black bar also appear with other plugins??? I would test it with another plugin that has a decent amount of controls. and complex controls mind you. 50 buttons does not count!! LOL

I need to know if it is perhaps a limitation of wxPython (the GUI control system in EG) for some reason I can remember this coming up before. and if i remember correctly it is something I am unable to directly fix. What I can do is give you the ability to zoom the controls.. there are 2 main portions of the controls in the admin panel. the network panel on the left and the object panel on the right.. both panels are scrollable panels horizontally and vertically so by adding a zoom in and zoom out feature to make the text bigger is not going to cause any issues. I will not do this if i did not make use of a scrolled panel because the user can accidentally make the whole dialog so large they will have a tough time closing it. with the scrollable panels all it will do is make the virtual space the data is in bigger without adjusting the size of the dialog. So i can't see a reason as to why i can't do that up for ya.


As far as the Vera goes. I am sooooooooooo happy to be finally done with that thing. there is no looking back now. I was never able to locate any software that is already made that doesn't have some kind of a performance issue. or it simply does not update changes made. or it doesn't expose all of the firmware level changes that can be done to the devices. I can say this. This ZWave plugin i made is screaming fast compared to every other piece of software I have tried. Most of the other software is using the same core that I am. well... not exactly the same core. The one that I compiled for use in this plugin has been modified a whole lot. to improve performance. ease of use, As an example. the louie library. I had planned on making a signal callback for the plugin. I had not gotten to it. and as it happens. louie was causing issues anyway. you have to remember that something like louie is made so that it can fill the needs of the many. and is not tailored for the needs of the one. so it worked in a manner that would give best overall performance across the board. where as the 50 lines of code i wrote gives better performance then louid did and it fills our specific needs.

libraries are there for convenience and they are to be used to fill that need until you can get around to making a more streamlined version for your specific program. there are cases like the use of wxPython because of how massive it simply does not make sense to write the whole thing over so instead we do what is called monkey patching. rewrite sections of it and override it's code with your code. We have done this on several occasions in the EG core. it is seamless to the user and provides bugfixes or streamlined code. I wrote a pure python version of a slider control. the one that is in wxPython uses the Windows API and has the OS make it. and Microsoft's implementation is well.. pretty shitty. and that's being nice. if you tell it to have a range from 0 to 10000 and to put a tick mark on each digit.. well... it never happens. You can sit there and watch it actually draw the thing for hours. eventually it stops. my version does not have this issue. nor does it flicker when you move the slider. and holy cow the slider keeps up with the mouse! LOL.. Point being is that I believe there has been some significant performance increase from the code I have written. But also possibly because of Stackless. and what they did to it to make this all possible for us. It is a more optimized python core. Now mow much that may impact performance. I do not know. I can only reference things like HomeAsistant or Domotics which both use zwave that is being used in EG but there are serious lagging issues with it.
If you like the work I have been doing then feel free to Image

holdestmade
Experienced User
Posts: 180
Joined: Thu Dec 04, 2014 2:44 pm

Re: Z-Wave

Post by holdestmade » Sat Aug 11, 2018 11:41 am

HI,

I've attached a screenshot of a few other plugin windows, they all have the same black bar:

Image

If I resize the window, it makes kind of black trails:

Image

Honestly, as you can see it is perfectly useable and not worth your time if it doenst affect anyone else, but I expect as more people move towards 4k monitors it will become more apparent.

Yes so glad to see the Vera go, I do thank you though for the lot for the work you put in with me to make it useable !

User avatar
kgschlosser
Site Admin
Posts: 4652
Joined: Fri Jun 05, 2015 5:43 am
Location: Rocky Mountains, Colorado USA

Re: Z-Wave

Post by kgschlosser » Sat Aug 11, 2018 11:10 pm

that is going o be an issue not with 4K but with wxPython and the high DPI. tho i do not understand how setting the DPI to a higher number enlarges anything on the screen.


Dots Per Inch (DPI) as you know is the number of horizontal and the number of vertical dits that are drawn in a given inch of space. a font set to say 12 point is a constant. it translates to some many pixels tall and the width is a ratio for that based on what the font is. so at 13 point we will call it say 30 pixels tall. so if you have a dpi that is set to 30 that means that a single character will fill that given inch os space. so if you set the dpi to 90 then 3 characters will fill an inch. so by making the DPI higher i would think would make the font smaller.


Also you can change the size of the font that is being used in EG somply by going into the appearance settings for Windows. Most dialogs that are used in EG do not have custom font sizes the system font is used and that is a mechanism for you to be able to make the text more readable while keeping your DPI at 100 to avoid the issue with the black bars. I will forward this issue over o the makers of wxPython. not saying they will fix it but at the very least they will know about it.
If you like the work I have been doing then feel free to Image

User avatar
kgschlosser
Site Admin
Posts: 4652
Joined: Fri Jun 05, 2015 5:43 am
Location: Rocky Mountains, Colorado USA

Re: Z-Wave

Post by kgschlosser » Sun Aug 12, 2018 4:40 am

OK i did some research on the black marks when running in what is called "High DPI Mode" and this is something that is not fully supported in wxPython 3.0. I can set wxPython into High DPI Mode but there is still a large portion of the wx Code that does not correctly work with it.. Specifically Sizers. Sizers and containers which you can put the controls into (and other sizers as well), and they take all of the legwork out of having to handle the sizing of all of the controls. so instead of having to use absolute position and absolute size it takes care of everything dynamically. when you change the DPI it throws off the sizing and positioning and the sizers do not know what to do with the odd data it is getting, hence the black marks.

So in this situation i do not have a fix for ya. and the band-aide with changing the font size is the only thing i can offer ya.
If you like the work I have been doing then feel free to Image

holdestmade
Experienced User
Posts: 180
Joined: Thu Dec 04, 2014 2:44 pm

Re: Z-Wave

Post by holdestmade » Sun Aug 12, 2018 9:52 am

Ok no problem. Its not really a big issue.
The dpi setting in windows in in percent. 100% is normal scaling, and if I use that, icons, text and app buttons are tiny. Using 150% takes it all back to "normal" sizes. There are a few mainstream apps that don't compensate for the higher dpi % as well.

User avatar
kgschlosser
Site Admin
Posts: 4652
Joined: Fri Jun 05, 2015 5:43 am
Location: Rocky Mountains, Colorado USA

Re: Z-Wave

Post by kgschlosser » Sun Aug 12, 2018 6:26 pm

well in the event you do not want to see the black bars. I have added the zooming features to the plugin

zoom in = ctrl + numpad+
zoom out = ctrl + numpad-

I am going to have to dink around with the HighDPI stuff in windows to see if there is anything I can do about it. It is going to take me a while tho

New version is attached to the first post.
If you like the work I have been doing then feel free to Image

User avatar
kgschlosser
Site Admin
Posts: 4652
Joined: Fri Jun 05, 2015 5:43 am
Location: Rocky Mountains, Colorado USA

Re: Z-Wave

Post by kgschlosser » Wed Aug 15, 2018 5:37 am

new version is up on the first post. please read the directions at the bottom.
If you like the work I have been doing then feel free to Image

holdestmade
Experienced User
Posts: 180
Joined: Thu Dec 04, 2014 2:44 pm

Re: Z-Wave

Post by holdestmade » Wed Aug 15, 2018 9:06 am

Just tried the graph button got this error:

Code: Select all

10:05:38   Exception in thread Thread-73:
10:05:38   Traceback (most recent call last):
10:05:38     File "threading.pyc", line 801, in __bootstrap_inner
10:05:38     File "threading.pyc", line 754, in run
10:05:38     File "C:\ProgramData\EventGhost\plugins\ZWave\zwave_admin.py", line 1061, in do
10:05:38       from zwave_cord_diagram import Plot
10:05:38     File "C:\ProgramData\EventGhost\plugins\ZWave\zwave_cord_diagram.py", line 19, in <module>
10:05:38       import matplotlib.pyplot as plt
10:05:38     File "C:\ProgramData\EventGhost\plugins\ZWave\libs\matplotlib\__init__.py", line 127, in <module>
10:05:38       from . import cbook
10:05:38     File "C:\ProgramData\EventGhost\plugins\ZWave\libs\matplotlib\cbook\__init__.py", line 35, in <module>
10:05:38       import numpy as np
10:05:38     File "C:\ProgramData\EventGhost\plugins\ZWave\libs\numpy\__init__.py", line 142, in <module>
10:05:38       from . import add_newdocs
10:05:38     File "C:\ProgramData\EventGhost\plugins\ZWave\libs\numpy\add_newdocs.py", line 13, in <module>
10:05:38       from numpy.lib import add_newdoc
10:05:38     File "C:\ProgramData\EventGhost\plugins\ZWave\libs\numpy\lib\__init__.py", line 8, in <module>
10:05:38       from .type_check import *
10:05:38     File "C:\ProgramData\EventGhost\plugins\ZWave\libs\numpy\lib\type_check.py", line 11, in <module>
10:05:38       import numpy.core.numeric as _nx
10:05:38     File "C:\ProgramData\EventGhost\plugins\ZWave\libs\numpy\core\__init__.py", line 26, in <module>
10:05:38       raise ImportError(msg)
10:05:38   ImportError: 
10:05:38   Importing the multiarray numpy extension module failed.  Most
10:05:38   likely you are trying to import a failed build of numpy.
10:05:38   If you're working with a numpy git repo, try `git clean -xdf` (removes all
10:05:38   files not under version control).  Otherwise reinstall numpy.
10:05:38   
10:05:38   Original error was: DLL load failed: The specified module could not be found.
10:05:38   
10:05:38   

User avatar
kgschlosser
Site Admin
Posts: 4652
Joined: Fri Jun 05, 2015 5:43 am
Location: Rocky Mountains, Colorado USA

Re: Z-Wave

Post by kgschlosser » Thu Aug 16, 2018 3:48 am

ok so I want you to replace the libs folder in the plugin directory with the one i have attached to this post. just go into the plugins folder and delete the libs folder. then uncompress this into the plugin folder.

see if the error still occurs.
Attachments
libs.zip
(17.99 MiB) Downloaded 11 times
If you like the work I have been doing then feel free to Image

holdestmade
Experienced User
Posts: 180
Joined: Thu Dec 04, 2014 2:44 pm

Re: Z-Wave

Post by holdestmade » Thu Aug 16, 2018 10:15 am

Hi, replaced the libs folder, this error came up after 10seconds or so after the graph window opens then eg stops (system idle in log)

Code: Select all

11:13:29   C:\ProgramData\EventGhost\plugins\ZWave\zwave_cord_diagram.py:573: RuntimeWarning: invalid value encountered in double_scalars
11:13:29     (y_lim[1] - y_lim[0]) /
11:13:29   Exception in thread Thread-72:
11:13:29   Traceback (most recent call last):
11:13:29     File "threading.pyc", line 801, in __bootstrap_inner
11:13:29     File "threading.pyc", line 754, in run
11:13:29     File "C:\ProgramData\EventGhost\plugins\ZWave\zwave_admin.py", line 1064, in do
11:13:29       self._image, self.graph_nodes = plot.image
11:13:29     File "C:\ProgramData\EventGhost\plugins\ZWave\zwave_cord_diagram.py", line 501, in image
11:13:29       pad_inches=0.02
11:13:29     File "C:\ProgramData\EventGhost\plugins\ZWave\libs\matplotlib\pyplot.py", line 695, in savefig
11:13:29       res = fig.savefig(*args, **kwargs)
11:13:29     File "C:\ProgramData\EventGhost\plugins\ZWave\libs\matplotlib\figure.py", line 2062, in savefig
11:13:29       self.canvas.print_figure(fname, **kwargs)
11:13:29     File "C:\ProgramData\EventGhost\plugins\ZWave\libs\matplotlib\backends\backend_wx.py", line 828, in print_figure
11:13:29       filename, *args, **kwargs)
11:13:29     File "C:\ProgramData\EventGhost\plugins\ZWave\libs\matplotlib\backend_bases.py", line 2212, in print_figure
11:13:29       **kwargs)
11:13:29     File "C:\ProgramData\EventGhost\plugins\ZWave\libs\matplotlib\backends\backend_agg.py", line 532, in print_png
11:13:29       self.figure.dpi, metadata=metadata)
11:13:29   RuntimeError: libpng signaled error
11:13:29   
11:14:19   System.Idle

User avatar
kgschlosser
Site Admin
Posts: 4652
Joined: Fri Jun 05, 2015 5:43 am
Location: Rocky Mountains, Colorado USA

Re: Z-Wave

Post by kgschlosser » Thu Aug 16, 2018 2:21 pm

ok so good new is we got past the first problem. bad new is that error doesn't tell me a thing. LOL
If you like the work I have been doing then feel free to Image

User avatar
kgschlosser
Site Admin
Posts: 4652
Joined: Fri Jun 05, 2015 5:43 am
Location: Rocky Mountains, Colorado USA

Re: Z-Wave

Post by kgschlosser » Thu Aug 16, 2018 2:32 pm

well this is what has me a little bit confused

Code: Select all

RuntimeError: libpng signaled error
libpng is a linux thing. so why it is throwing an error on windows is beyond me.

I made a change and removed the use of saving the data to a temp file and then loading that temp file into PIL.Image. so this may help I am dumping the data directly into PIL.Image instead.

I am not sure if this will bypass the need for matplotlib to use libpng. but it is worth a try that is for sure. if this does not work there is another way i can go about dumping raw pixel data into a PIL.Image. this is a more involved process But if i do that I know 100% there would be no need for it to use libpng because i would be pulling pixel data right off the canvas. But this also will have it's own set of problems to sort through.

So what I am doing now if I amusing matplotlib to "save" the canvas as a png into a buffer instead of writing a file. I am not sure if the issue is coming up when it tries to write the file or if it is having an issue when it is converting the pixel data into png format. this new file is going to let us know.

drop the attached file into the plugin folder. overwrite the old file.
Attachments
zwave_cord_diagram.py
(18.53 KiB) Downloaded 11 times
If you like the work I have been doing then feel free to Image

holdestmade
Experienced User
Posts: 180
Joined: Thu Dec 04, 2014 2:44 pm

Re: Z-Wave

Post by holdestmade » Fri Aug 17, 2018 12:50 pm

No same error I'm afraid:

Code: Select all

13:49:40   C:\ProgramData\EventGhost\plugins\ZWave\zwave_cord_diagram.py:587: RuntimeWarning: invalid value encountered in double_scalars
13:49:40     (y_lim[1] - y_lim[0]) /
13:49:40   Exception in thread Thread-72:
13:49:40   Traceback (most recent call last):
13:49:40     File "threading.pyc", line 801, in __bootstrap_inner
13:49:40     File "threading.pyc", line 754, in run
13:49:40     File "C:\ProgramData\EventGhost\plugins\ZWave\zwave_admin.py", line 1064, in do
13:49:40       self._image, self.graph_nodes = plot.image
13:49:40     File "C:\ProgramData\EventGhost\plugins\ZWave\zwave_cord_diagram.py", line 512, in image
13:49:40       pad_inches=0.02
13:49:40     File "C:\ProgramData\EventGhost\plugins\ZWave\libs\matplotlib\pyplot.py", line 695, in savefig
13:49:40       res = fig.savefig(*args, **kwargs)
13:49:40     File "C:\ProgramData\EventGhost\plugins\ZWave\libs\matplotlib\figure.py", line 2062, in savefig
13:49:40       self.canvas.print_figure(fname, **kwargs)
13:49:40     File "C:\ProgramData\EventGhost\plugins\ZWave\libs\matplotlib\backends\backend_wx.py", line 828, in print_figure
13:49:40       filename, *args, **kwargs)
13:49:40     File "C:\ProgramData\EventGhost\plugins\ZWave\libs\matplotlib\backend_bases.py", line 2212, in print_figure
13:49:40       **kwargs)
13:49:40     File "C:\ProgramData\EventGhost\plugins\ZWave\libs\matplotlib\backends\backend_agg.py", line 532, in print_png
13:49:40       self.figure.dpi, metadata=metadata)
13:49:40   RuntimeError: libpng signaled error
13:49:40   

User avatar
kgschlosser
Site Admin
Posts: 4652
Joined: Fri Jun 05, 2015 5:43 am
Location: Rocky Mountains, Colorado USA

Re: Z-Wave

Post by kgschlosser » Sat Aug 18, 2018 6:49 am

new version is up.

@holdestmade

the new version may have a fix that works, give it a shot and see. if at all possibly if you can remove the old version from the tree and delete the plugin from %programdata%\eventghost\plugins\zwave

then install the new plugin..
If you like the work I have been doing then feel free to Image

holdestmade
Experienced User
Posts: 180
Joined: Thu Dec 04, 2014 2:44 pm

Re: Z-Wave

Post by holdestmade » Mon Aug 20, 2018 7:53 am

Hi, so just tried installing new version and deleting the plugin from programdata folder.

Back to this error:

Code: Select all

08:52:20   Exception in thread Thread-74:
08:52:20   Traceback (most recent call last):
08:52:20     File "threading.pyc", line 801, in __bootstrap_inner
08:52:20     File "threading.pyc", line 754, in run
08:52:20     File "C:\ProgramData\EventGhost\plugins\ZWave\zwave_admin.py", line 1065, in do
08:52:20       from zwave_cord_diagram import Plot
08:52:20     File "C:\ProgramData\EventGhost\plugins\ZWave\zwave_cord_diagram.py", line 19, in <module>
08:52:20       import matplotlib.pyplot as plt
08:52:20     File "C:\ProgramData\EventGhost\plugins\ZWave\libs\matplotlib\__init__.py", line 126, in <module>
08:52:20       from . import cbook
08:52:20     File "C:\ProgramData\EventGhost\plugins\ZWave\libs\matplotlib\cbook\__init__.py", line 34, in <module>
08:52:20       import numpy as np
08:52:20     File "C:\ProgramData\EventGhost\plugins\ZWave\libs\numpy\__init__.py", line 142, in <module>
08:52:20       from . import add_newdocs
08:52:20     File "C:\ProgramData\EventGhost\plugins\ZWave\libs\numpy\add_newdocs.py", line 13, in <module>
08:52:20       from numpy.lib import add_newdoc
08:52:20     File "C:\ProgramData\EventGhost\plugins\ZWave\libs\numpy\lib\__init__.py", line 8, in <module>
08:52:20       from .type_check import *
08:52:20     File "C:\ProgramData\EventGhost\plugins\ZWave\libs\numpy\lib\type_check.py", line 11, in <module>
08:52:20       import numpy.core.numeric as _nx
08:52:20     File "C:\ProgramData\EventGhost\plugins\ZWave\libs\numpy\core\__init__.py", line 26, in <module>
08:52:20       raise ImportError(msg)
08:52:20   ImportError: 
08:52:20   Importing the multiarray numpy extension module failed.  Most
08:52:20   likely you are trying to import a failed build of numpy.
08:52:20   If you're working with a numpy git repo, try `git clean -xdf` (removes all
08:52:20   files not under version control).  Otherwise reinstall numpy.
08:52:20   
08:52:20   Original error was: DLL load failed: The specified module could not be found.
08:52:20   
08:52:20   

Post Reply