Python Plugin: Woonvelig Gate01 Alarmsystem Topic is solved

Python and python framework
stuffnl
Posts: 6
Joined: Wednesday 24 May 2017 14:09
Target OS: Raspberry Pi
Domoticz version: v3.8003
Contact:

Python Plugin: Woonvelig Gate01 Alarmsystem

Post by stuffnl » Wednesday 24 May 2017 14:30

Hi guys,

I've created a plugin I would like to share with you. The plugin will integrate the Woonveilig Gate01 alarmsystem into Domoticz.

The following Woonveilig accessories are supported:
  • Door contacts
  • Keypad
More info and installation instructions can be found at: https://github.com/StuffNL/domoticz-woonveilig

If you have any comments or suggestions please let me know. Cheers!
Woonveilig devices.PNG
Preview of Woonveilig devices
Woonveilig devices.PNG (32.83 KiB) Viewed 1406 times

jpbriaire
Posts: 7
Joined: Friday 28 July 2017 21:26
Target OS: NAS (Synology & others)
Domoticz version:
Contact:

Re: Python Plugin: Woonvelig Gate01 Alarmsystem

Post by jpbriaire » Friday 28 July 2017 21:31

Thanks for this! I was looking for an easy way to include my Woonveilig system into Domoticz.

Unfortunately, I get an error when trying to use the plugin:

Code: Select all

2017-07-28 21:18:23.327 Error: (Woonveilig) failed to load 'plugin.py', Python Path used was '/usr/local/domoticz/var/plugins/domoticz-woonveilig/:/volume1/@appstore/py3k/usr/local/lib/python35.zip:/volume1/@appstore/py3k/usr/local/lib/python3.5/:/volume1/@appstore/py3k/usr/local/lib/python3.5/plat-linux:/volume1/@appstore/py3k/usr/local/lib/python3.5/lib-dynload'.
2017-07-28 21:18:23.327 Error: (Woonveilig Alarm) Module Import failed, exception: 'ImportError'
2017-07-28 21:18:23.327 Error: (Woonveilig Alarm) Module Import failed: ' Name: demjson'
Do you know what's wrong?

stuffnl
Posts: 6
Joined: Wednesday 24 May 2017 14:09
Target OS: Raspberry Pi
Domoticz version: v3.8003
Contact:

Re: Python Plugin: Woonvelig Gate01 Alarmsystem

Post by stuffnl » Saturday 29 July 2017 0:00

Did you install demjson?

For installation instructions check https://github.com/StuffNL/domoticz-woo ... /README.md

jpbriaire
Posts: 7
Joined: Friday 28 July 2017 21:26
Target OS: NAS (Synology & others)
Domoticz version:
Contact:

Re: Python Plugin: Woonvelig Gate01 Alarmsystem

Post by jpbriaire » Saturday 29 July 2017 8:54

Oh, I totally did not read that part, sorry... Going to try and get that up and running on my Synology then.

jpbriaire
Posts: 7
Joined: Friday 28 July 2017 21:26
Target OS: NAS (Synology & others)
Domoticz version:
Contact:

Re: Python Plugin: Woonvelig Gate01 Alarmsystem

Post by jpbriaire » Saturday 29 July 2017 9:25

So, I installed demjson:

Code: Select all

running install
running build
running build_py
running build_scripts
creating build/scripts-3.5
copying and adjusting jsonlint -> build/scripts-3.5
changing mode of build/scripts-3.5/jsonlint from 644 to 755
Skipping optional fixer: buffer
Skipping optional fixer: idioms
Skipping optional fixer: set_literal
Skipping optional fixer: ws_comma
running install_lib
copying build/lib/demjson.py -> /volume1/@appstore/py3k/usr/local/lib/python3.5/site-packages
byte-compiling /volume1/@appstore/py3k/usr/local/lib/python3.5/site-packages/demjson.py to demjson.cpython-35.pyc
  File "/volume1/@appstore/py3k/usr/local/lib/python3.5/site-packages/demjson.py", line 645
    class json_int( (1L).__class__ ):    # Have to specify base this way to satisfy 2to3
                      ^
SyntaxError: invalid syntax

running install_scripts
copying build/scripts-3.5/jsonlint -> /volume1/@appstore/py3k/usr/local/bin
changing mode of /volume1/@appstore/py3k/usr/local/bin/jsonlint to 755
running install_egg_info
Writing /volume1/@appstore/py3k/usr/local/lib/python3.5/site-packages/demjson-2.2.4-py3.5.egg-info
After that, still no luck. Getting the same error in Domoticz.

jpbriaire
Posts: 7
Joined: Friday 28 July 2017 21:26
Target OS: NAS (Synology & others)
Domoticz version:
Contact:

Re: Python Plugin: Woonvelig Gate01 Alarmsystem

Post by jpbriaire » Sunday 30 July 2017 19:20

Ok, so I figured out that demjson was not in the correct folder. I copied demjson.py to the folder

/volume1/@appstore/py3k/usr/local/lib/python3.5/

and made it executable. This solves the first problem. But now, I'm getting an other error:

Code: Select all

2017-07-30 18:46:04.547 Error: (Woonveilig) failed to load 'plugin.py', Python Path used was '/usr/local/domoticz/var/plugins/domoticz-woonveilig/:/volume1/@appstore/py3k/usr/local/lib/python35.zip:/volume1/@appstore/py3k/usr/local/lib/python3.5/:/volume1/@appstore/py3k/usr/local/lib/python3.5/plat-linux:/volume1/@appstore/py3k/usr/local/lib/python3.5/lib-dynload'.
2017-07-30 18:46:04.547 Error: (Woonveilig) Module Import failed, exception: 'SyntaxError'
2017-07-30 18:46:04.547 Error: (Woonveilig) Import detail: File: /volume1/@appstore/py3k/usr/local/lib/python3.5/demjson.py, Line: 1803059968, offset: 645
2017-07-30 18:46:04.547 Error: (Woonveilig) Error Line 'class json_int( (1L).__class__ ): # Have to specify base this way to satisfy 2to3
I know, this has nothing to do with your plugin. But for me, as a non-coder, it's kinda hard figuring out those problems every time :cry:

So now I'm stuck with a demjson problem, in the code. Don't know what to do now.

jpbriaire
Posts: 7
Joined: Friday 28 July 2017 21:26
Target OS: NAS (Synology & others)
Domoticz version:
Contact:

Re: Python Plugin: Woonvelig Gate01 Alarmsystem

Post by jpbriaire » Monday 31 July 2017 13:43

Have been trying to figure out how to get past this error. My logic is that there is something going wrong with the Python 2to3 conversion of demjson. I think my current installation of Python3, from the original Synology source, does not include the 2to3 library. Tried the same with the SynoCommunity version of Python3: no luck. Installed Python3 with Easy Boot Installer including all the necessary extra modules: no luck.

I'm out of options now. Been putting a lot of hours the past days to get this to work. If there is someone that got this to work on Synology I would appreciate some pointers on how they did it.

rbo0567
Posts: 12
Joined: Thursday 13 April 2017 16:41
Target OS: Linux
Domoticz version: v3.8153
Location: 's-Hertogenbosch
Contact:

Re: Python Plugin: Woonvelig Gate01 Alarmsystem

Post by rbo0567 » Thursday 03 August 2017 22:23

Didn't get it to work on a Synology but on a RPi it works like a charm.
Keep up the good work!! :D

avantwist
Posts: 12
Joined: Wednesday 21 September 2016 21:51
Target OS: Raspberry Pi
Domoticz version:
Contact:

Re: Python Plugin: Woonvelig Gate01 Alarmsystem

Post by avantwist » Wednesday 09 August 2017 20:42

Hello,

I have succesfully installed all additional plugins and software, and after the reboot I see the" Woonveilig Gate 01" under Hardware.
But when I add it, nothing happens. It will not appear under the Hardware list
If I addd other "hardware" they are addes to the list.

Any ideas?

stuffnl
Posts: 6
Joined: Wednesday 24 May 2017 14:09
Target OS: Raspberry Pi
Domoticz version: v3.8003
Contact:

Re: Python Plugin: Woonvelig Gate01 Alarmsystem

Post by stuffnl » Wednesday 09 August 2017 21:26

avantwist wrote:
Wednesday 09 August 2017 20:42
Hello,

I have succesfully installed all additional plugins and software, and after the reboot I see the" Woonveilig Gate 01" under Hardware.
But when I add it, nothing happens. It will not appear under the Hardware list
If I addd other "hardware" they are addes to the list.

Any ideas?
It''s a lon dhot but in the past I had a similar problem (in Chrome). Could you try add the plug-in by using a different browser?

avantwist
Posts: 12
Joined: Wednesday 21 September 2016 21:51
Target OS: Raspberry Pi
Domoticz version:
Contact:

Re: Python Plugin: Woonvelig Gate01 Alarmsystem

Post by avantwist » Wednesday 09 August 2017 21:59

perfect.
It works.

avantwist
Posts: 12
Joined: Wednesday 21 September 2016 21:51
Target OS: Raspberry Pi
Domoticz version:
Contact:

Re: Python Plugin: Woonvelig Gate01 Alarmsystem

Post by avantwist » Thursday 10 August 2017 20:24

Unfortunately Im getting the same error on my Pi in the log when addning the hardware:

2017-08-10 20:20:51.413 Error: (Woonveilig) failed to load 'plugin.py', Python Path used was '/home/pi/domoticz/plugins/domoticz-woonveilig/:/usr/lib/python3.4/:/usr/lib/python3.4/plat-arm-linux-gnueabihf:/usr/lib/python3.4/lib-dynload'.
2017-08-10 20:20:51.413 Error: (Woonveilig) Module Import failed, exception: 'ImportError'
2017-08-10 20:20:51.413 Error: (Woonveilig) Module Import failed: ' Name: demjson'

Any suggestions?

jpbriaire
Posts: 7
Joined: Friday 28 July 2017 21:26
Target OS: NAS (Synology & others)
Domoticz version:
Contact:

Re: Python Plugin: Woonvelig Gate01 Alarmsystem

Post by jpbriaire » Thursday 24 August 2017 16:36

avantwist wrote:
Thursday 10 August 2017 20:24
Unfortunately Im getting the same error on my Pi in the log when addning the hardware:

2017-08-10 20:20:51.413 Error: (Woonveilig) failed to load 'plugin.py', Python Path used was '/home/pi/domoticz/plugins/domoticz-woonveilig/:/usr/lib/python3.4/:/usr/lib/python3.4/plat-arm-linux-gnueabihf:/usr/lib/python3.4/lib-dynload'.
2017-08-10 20:20:51.413 Error: (Woonveilig) Module Import failed, exception: 'ImportError'
2017-08-10 20:20:51.413 Error: (Woonveilig) Module Import failed: ' Name: demjson'

Any suggestions?
Looks like demjson isn't loaded. Did you install it?

avantwist
Posts: 12
Joined: Wednesday 21 September 2016 21:51
Target OS: Raspberry Pi
Domoticz version:
Contact:

Re: Python Plugin: Woonvelig Gate01 Alarmsystem

Post by avantwist » Thursday 24 August 2017 19:35

Yes I have,

This is the message I receive when I try to install it again.Any other weay to test it?

[email protected]:~ $ sudo pip install demjson
Requirement already satisfied (use --upgrade to upgrade): demjson in /usr/local/lib/python2.7/dist-packages
Cleaning up...

jpbriaire
Posts: 7
Joined: Friday 28 July 2017 21:26
Target OS: NAS (Synology & others)
Domoticz version:
Contact:

Re: Python Plugin: Woonvelig Gate01 Alarmsystem

Post by jpbriaire » Thursday 24 August 2017 20:52

Sorry, I can't help you with that. Maybe the topic starter can help.

stuffnl
Posts: 6
Joined: Wednesday 24 May 2017 14:09
Target OS: Raspberry Pi
Domoticz version: v3.8003
Contact:

Re: Python Plugin: Woonvelig Gate01 Alarmsystem

Post by stuffnl » Thursday 24 August 2017 21:40

Hi, can hou check if your demjson module is located in /usr/local/lib/python3.4/dist-packages?

avantwist
Posts: 12
Joined: Wednesday 21 September 2016 21:51
Target OS: Raspberry Pi
Domoticz version:
Contact:

Re: Python Plugin: Woonvelig Gate01 Alarmsystem

Post by avantwist » Thursday 24 August 2017 21:45

hmm, no, directory is empty
it is located in /usr/local/lib/python2.7/dist-packages

Can I just move it ?

imdos
Posts: 3
Joined: Thursday 03 August 2017 21:50
Target OS: Raspberry Pi
Domoticz version:
Contact:

Re: Python Plugin: Woonvelig Gate01 Alarmsystem

Post by imdos » Friday 25 August 2017 10:51

avantwist wrote:
Thursday 24 August 2017 21:45
hmm, no, directory is empty
it is located in /usr/local/lib/python2.7/dist-packages

Can I just move it ?
No; you should get the python 3 version (3.4 or 3.5) with for example pip3 or apt-get.
I solved it through:

Code: Select all

sudo apt-get install pip3
sudo pip3 install demjson

Daehnie
Posts: 2
Joined: Wednesday 27 September 2017 7:33
Target OS: Raspberry Pi
Domoticz version:
Contact:

Re: Python Plugin: Woonvelig Gate01 Alarmsystem

Post by Daehnie » Wednesday 27 September 2017 7:44

Hi,

I've installed Domoticz on a Raspberry with Raspbian Stretch.
Now, I had install the Plugin and the Logfile tolds me:

2017-09-27 07:36:28.820 Error: (Woonveilig) failed to load 'plugin.py', Python Path used was '/home/pi/domoticz/plugins/domoticz-woonveilig/:/usr/lib/python35.zip:/usr/lib/python3.5:/usr/lib/python3.5/plat-arm-linux-gnueabihf:/usr/lib/python3.5/lib-dynload'.
2017-09-27 07:36:28.820 Error: (Egardia) Module Import failed, exception: 'ImportError'
2017-09-27 07:36:28.820 Error: (Egardia) Module Import failed: ' Name: demjson'
2017-09-27 07:36:28.821 Error: (Egardia) Error Line details not available.

But demjson is installed!
Location: /usr/local/lib/python3.5/dist-packages

Python: 3.5.3
demjson 2.2.4

In the plugin.py I've seen "sys.path.append('/usr/local/lib/python3.4/dist-packages')"

So, doesn't it work with Raspbian Stretch, because of a newer Python-Version?

User avatar
Dnpwwo
Posts: 627
Joined: Sunday 23 March 2014 10:00
Target OS: Raspberry Pi
Domoticz version: Beta
Location: Melbourne, Australia
Contact:

Re: Python Plugin: Woonvelig Gate01 Alarmsystem

Post by Dnpwwo » Wednesday 27 September 2017 9:19

@Daehnie,

The Python Plugin Framework functions on Python 3.4 and above and has been tested (and works) on Stretch's default version (3.5).

The log details you have posted would suggest that /usr/local/lib/python3.5/dist-packages is not in the Python path so you package is not being found. You could try adding it with something like:

Code: Select all

sys.path.append('/usr/local/lib/python3.5/dist-packages')
import demjson
in the plugin.py
The reasonable man adapts himself to the world; the unreasonable one persists to adapt the world to himself. Therefore all progress depends on the unreasonable man. George Bernard Shaw

Post Reply

Who is online

Users browsing this forum: art4me and 2 guests