Python Plugin: Python Plugin Manager

Python and python framework

Moderator: leecollings

Post Reply
User avatar
ycahome
Posts: 248
Joined: Sunday 12 February 2017 10:55
Target OS: Linux
Domoticz version: lat Beta
Contact:

Python Plugin: Python Plugin Manager

Post by ycahome »

Hello,

Some thoughts became code.

What if we could use a plugin in order to install other plugins from a list?

So, I did it.


Wiki Link: https://www.domoticz.com/wiki/Python_Plugin_Manager (Thanks to IDANIT)

Compatibility List:
  • Raspberry Pi - Confirmed
  • Ubuntu Debian - Confirmed
  • USERS TO TEST ON DIFFERENT LINUX FLAVORS WANTED
  • Windows - Not Supported

Supported plugins can be found on : https://www.domoticz.com/wiki/Plugins


TO CONTRIBUTE YOUR PLUGINS:
In order to add your plugins to PP-Manager, make a "pull request" with your lines added:
  • Increase version at "...author="ycahome" version="1.5.xx"..." in Line 12
  • Increase version at "...Python Plugin Manager v.1.5.xx..." in Line 14
  • Under 'label="Domoticz Plugin"' in alphabetical order by 'label' and
  • Under 'self.plugindata' in alphabetical order by 'pluginText'





RELEASE NOTES

v.1.5.13

Added: "eQ-3 MAX!" plugin (Thanks to @mvzut)
Added: "SmogTok Air Quality monitor" plugin (Thanks to @smogtok)

v.1.5.9

Fix: Error when no exception files found


v.1.5.8

Fixed: Added "git fetch" before update check to fetch repository details


v.1.5.7

Removed: Daikin Airconditioning (BRP069A42) plugin (already on Domoticz Core)

v.1.5.6


Added: Crow Runner Alarm plugin
Added: Daikin Airconditioning (BRP069A42) plugin
Added: IKEA Tradfri plugin
Added: Life 360 Presence plugin
Added: Pioneer AVR plugin
Added: RAVEn Zigbee energy monitor plugin

v.1.5.5

New: Experimental Feature that parsing all installed plugins (only plugin.py) for specific regex (text patterns)
_____Currently enabled only the "IP Pattern". Scan plugins for IPs on the code in order to avoid data leakage....
______There is a file template (secpoluser.orig). Can be copied to "secpoluser.txt" and include all results that should be excluded.


v.1.5.1

New: Exclusion list file (exceptions.txt) implemented to prevent updates for selected plugins (copy exceptions.orig to exceptions.txt)
Changed: Some restructuring on functions
Fix: Some Bugfixes
Fix: Restructuring Defs

v.1.4.18:

Added: Meteo Alarm EU RSS Reader
Added: Mikrotik RouterOS
Added: Moon Phases

v.1.4.17

Added: Denon/Marantz Amplifier
Added: Disc usage
Added: Dutch earthquakes
Added: Hive Active Heating

v.1.4.10

Added: Xiaomi PM2.5 Sensor
Added: Sony Bravia TV (with Kodi remote)
Changed: Selected (NotifyOnly) is now the default option for auto update



v.1.3.2
-self update on onStop() and every day
-option to update all - daily at 12:00 (all plugins installed from GitHub are candidates)
-logging fixed
-some problems sorted out.

Version 1.2.0 .

Supports:
-self update every 24 hours
-update selected plugin (ad-hoc update) every 24 hours
-more plugins added


FEATURES:
This plugin
  • supports only plugins located on GitHub
  • has a predefined list of plugins to be installed
  • performs plugin installation only if plugin directory not exists
  • performs plugin installation and prompts you to restart Domoticz in order to activate it.
  • Self updates itself on every self.stop() or plugin update
  • option to update selected plugin (ad-hoc update) every 24 hours
  • check for updates for currently installed plugins and notify admin

To install a plugin: select it on "Domoticz Plugin" field and press update


"Auto Update" Options (After every change press "Update")
  • "All": Continuously update all plugins
  • "Selected":Continuously update selected plugin (You should first select desired plugin from "Domoticz Plugin" field)
  • "All (NotifyOnly)": Check all plugins for updates and generate notification email.
  • "Selected (NotifyOnly)":Check selected plugin for updates and generate notification email. (You should first select desired plugin from "Domoticz Plugin" field)


To install another plugin, just select it and press update.


Pending to be implemented:
  • Uninstall plugins
  • standardise execution of a shell file in order to fulfill individual plugin prerequisites
  • check self prerequisites
  • implement scripts for Windows installation



ppManager.JPG
ppManager.JPG (59.86 KiB) Viewed 28259 times



INSTALLATION:
You can download and test it from my GitHub bellow:

https://github.com/ycahome/pp-manager

or you can install and test it from GitHub bellow (git tools required):

go to your plugins folder
and execute

Code: Select all

git clone https://github.com/ycahome/pp-manager.git PP-MANAGER



BEWARE, can be used ONLY ON LINUX SYSTEMS and Raspberry Pi!!!!!!


Waiting for your comments!!!!
Last edited by ycahome on Friday 09 November 2018 10:28, edited 26 times in total.
User avatar
ycahome
Posts: 248
Joined: Sunday 12 February 2017 10:55
Target OS: Linux
Domoticz version: lat Beta
Contact:

Re: Python Plugin: Python Plugin Manager

Post by ycahome »

G3rard wrote: Saturday 05 August 2017 0:05
You can download the plugin on https://github.com/gerard33/sonos. Instructions on how to setup and use the plugin are also there.
….
Sonos plugin added
fkok
Posts: 29
Joined: Thursday 19 January 2017 9:19
Target OS: Raspberry Pi / ODroid
Domoticz version:
Location: Netherlands
Contact:

Re: Python Plugin: Python Plugin Manager

Post by fkok »

Looks Fantastic!!!! :o
User avatar
remb0
Posts: 499
Joined: Thursday 11 July 2013 22:21
Target OS: Raspberry Pi / ODroid
Domoticz version: Beta
Location: The Netherlands
Contact:

Re: Python Plugin: Python Plugin Manager

Post by remb0 »

User avatar
ycahome
Posts: 248
Joined: Sunday 12 February 2017 10:55
Target OS: Linux
Domoticz version: lat Beta
Contact:

Re: Python Plugin: Python Plugin Manager

Post by ycahome »

remb0 wrote: Sunday 25 February 2018 12:56 wow great work! definitely something you need when using multiple plugins.

can you add:
https://github.com/ycahome/WAN-IP-CHECKER
https://github.com/Xorfor/Domoticz-Speedtest-Plugin
https://github.com/flatsiedatsie/Mi_Flower_mate_plugin
https://github.com/999LV/NUT_UPS

;)
Thank you!
Mi_Flower_mate_plugin,NUT_UPS are already there
WAN-IP-CHECKER, Domoticz-Speedtest-Plugin will be added on next release together with update functionality
User avatar
EdwinK
Posts: 1820
Joined: Sunday 22 January 2017 21:46
Target OS: Raspberry Pi / ODroid
Domoticz version: BETA
Location: Rhoon
Contact:

Re: Python Plugin: Python Plugin Manager

Post by EdwinK »

Tried it, but no luck when I try to install one of the plugins with it. All devices are gone and I have to uninstall the plugin before they reappear.
Running latest BETA on a Pi-3 | Toon® Thermostat (rooted) | Hue | Tuya | IKEA tradfri | Dashticz V3 on Lenovo Huawei Tablet | Conbee
User avatar
ycahome
Posts: 248
Joined: Sunday 12 February 2017 10:55
Target OS: Linux
Domoticz version: lat Beta
Contact:

Re: Python Plugin: Python Plugin Manager

Post by ycahome »

EdwinK wrote: Sunday 25 February 2018 17:32 Tried it, but no luck when I try to install one of the plugins with it. All devices are gone and I have to uninstall the plugin before they reappear.
Will be interesting to have your logs
IDANIT
Posts: 73
Joined: Saturday 07 November 2015 10:01
Target OS: Raspberry Pi / ODroid
Domoticz version: Beta
Location: Poland
Contact:

Re: Python Plugin: Python Plugin Manager

Post by IDANIT »

EdwinK wrote: Sunday 25 February 2018 17:32 Tried it, but no luck when I try to install one of the plugins with it. All devices are gone and I have to uninstall the plugin before they reappear.
Same here, domoticz looks like after fresh install. I'm not sure if there have even left any logs...
User avatar
ycahome
Posts: 248
Joined: Sunday 12 February 2017 10:55
Target OS: Linux
Domoticz version: lat Beta
Contact:

Re: Python Plugin: Python Plugin Manager

Post by ycahome »

Let me say that this plugin is only for Debian based OS and Domoticz installations (although never tested on Raspberry).

The only one requirement has this plugin is "Git tools".

At you at least able to enable debug mode of the plugin?
User avatar
ycahome
Posts: 248
Joined: Sunday 12 February 2017 10:55
Target OS: Linux
Domoticz version: lat Beta
Contact:

Re: Python Plugin: Python Plugin Manager

Post by ycahome »

Version 1.2.0 released.

Supports:
-self update every 24 hours
-update selected plugin (ad-hoc update) every 24 hours
-more plugins added

Hope you like it more!!
User avatar
remb0
Posts: 499
Joined: Thursday 11 July 2013 22:21
Target OS: Raspberry Pi / ODroid
Domoticz version: Beta
Location: The Netherlands
Contact:

Re: Python Plugin: Python Plugin Manager

Post by remb0 »

raspberry pi latest beta domoticz and up to date raspbian.
after adding pluging I added buienradar. and it say: problems adding hardware.
after that hardwarelist is empty.
User avatar
ycahome
Posts: 248
Joined: Sunday 12 February 2017 10:55
Target OS: Linux
Domoticz version: lat Beta
Contact:

Re: Python Plugin: Python Plugin Manager

Post by ycahome »

2018-02-26 21:46:42.304 Domoticz V3.8153 (c)2012-2017 GizMoCuz
2018-02-26 21:46:42.309 Build Hash: 494fff7, Date: 2017-07-30 13:19:41
2018-02-26 21:46:42.309 Startup Path: /home/pi/domoticz/
2018-02-26 21:46:42.682 Sunrise: 07:09:00 SunSet:18:18:00
2018-02-26 21:46:42.682 EventSystem: reset all events...
2018-02-26 21:46:43.339 PluginSystem: Started, Python version '3.5.3'.
2018-02-26 21:46:43.388 Active notification Subsystems: (0/12)
2018-02-26 21:46:43.393 WebServer(HTTP) started on address: :: with port 8080
2018-02-26 21:46:43.402 Proxymanager started.
2018-02-26 21:46:43.405 Camera: settings (re)loaded
2018-02-26 21:46:43.414 Starting shared server on: :::6144
2018-02-26 21:46:43.421 TCPServer: shared server started...
2018-02-26 21:46:43.421 RxQueue: queue worker started...
2018-02-26 21:46:45.425 Hardware Monitor: Started
2018-02-26 21:46:45.426 I2C_BME280: Worker started...
2018-02-26 21:46:45.453 Pinger: Started
2018-02-26 21:46:45.454 EventSystem: reset all events...
2018-02-26 21:46:45.457 EventSystem: reset all device statuses...
2018-02-26 21:46:45.709 PluginSystem: Entering work loop.
2018-02-26 21:46:46.007 Python EventSystem: Module not found - Trying to initialize.
2018-02-26 21:46:46.012 Python EventSystem: Initalizing event module.
2018-02-26 21:46:46.028 EventSystem: Started
2018-02-26 21:46:47.315 Incoming connection from:
2018-02-26 21:46:48.676 (Wan IP Checker) Initialized version 1.2.2, author 'ycahome'
2018-02-26 21:46:51.187 (PPManager) Initialized version 1.2.15, author 'ycahome'
2018-02-26 21:46:51.250 (Wan IP Checker) Debug log level set to: 'false'.
2018-02-26 21:46:51.263 (PPManager) Debug log level set to: 'false'.
2018-02-26 21:46:51.264 (PPManager) Installation requested for Plugin:Buienradar.nl (Weather lookup)
2018-02-26 21:46:51.264 (PPManager) Plugin Display Name:Buienradar.nl (Weather lookup)
2018-02-26 21:46:51.265 (PPManager) Plugin Author:ffes
2018-02-26 21:46:51.265 (PPManager) Plugin Repository:domoticz-buienradar
2018-02-26 21:46:51.265 (PPManager) Plugin Key:Buienradar
2018-02-26 21:46:51.265 (PPManager) Installing Plugin:domoticz-buienradar
2018-02-26 21:46:51.265 (PPManager) Calling:/usr/bin/git clone -b master https://github.com/ffes/domoticz-buienradar.git Buienradar
2018-02-26 21:46:56.660 (PPManager) Git Error:b"Cloning into 'Buienradar'..."
2018-02-26 21:46:56.661 (PPManager) ---Restarting Domoticz REQUIRED to activate new plugins---
2018-02-26 21:46:59.176 (Wan IP Checker) WAN IP the same. Skipping
2018-02-26 21:47:15.629 (Bedroom) Temp + Humidity + Baro (Bedroom)

© 2012-2018 Domoticz | WWW: Domoticz.co

Strange. My raspi seems to work (2B with 3.8153)
User avatar
ycahome
Posts: 248
Joined: Sunday 12 February 2017 10:55
Target OS: Linux
Domoticz version: lat Beta
Contact:

Re: Python Plugin: Python Plugin Manager

Post by ycahome »

remb0 wrote: Monday 26 February 2018 20:29 raspberry pi latest beta domoticz and up to date raspbian.
after adding pluging I added buienradar. and it say: problems adding hardware.
after that hardwarelist is empty.
Can you delete the plugin and install with the following command (made uppercase the repository-changed also to 1st post):

Code: Select all

git clone https://github.com/ycahome/pp-manager.git PP-MANAGER
Also, after selecting "Buienraar" you press "Update" or "Add"? You should press "Update" button.

This is not a program manager as it should be. Its rather a different use of plugins
IDANIT
Posts: 73
Joined: Saturday 07 November 2015 10:01
Target OS: Raspberry Pi / ODroid
Domoticz version: Beta
Location: Poland
Contact:

Re: Python Plugin: Python Plugin Manager

Post by IDANIT »

remb0 wrote: Monday 26 February 2018 20:29 raspberry pi latest beta domoticz and up to date raspbian.
after adding pluging I added buienradar. and it say: problems adding hardware.
after that hardwarelist is empty.
So You are third with exactly the same plugin behaviour.
User avatar
ycahome
Posts: 248
Joined: Sunday 12 February 2017 10:55
Target OS: Linux
Domoticz version: lat Beta
Contact:

Re: Python Plugin: Python Plugin Manager

Post by ycahome »

IDANIT wrote: Monday 26 February 2018 20:59 So You are third with exactly the same plugin behaviour.
after selecting plugin to be installed you press "Update" or "Add"? You should press "Update" button.
User avatar
ycahome
Posts: 248
Joined: Sunday 12 February 2017 10:55
Target OS: Linux
Domoticz version: lat Beta
Contact:

Re: Python Plugin: Python Plugin Manager

Post by ycahome »

New version 1.3.2
-self update on onStop() and every day
-option to update all - daily at 12:00 (all plugins installed from GitHub are candidates)
-logging fixed
-some problems sorted out.


Guys, am searching someone to help with raspberry troubleshooting.
User avatar
remb0
Posts: 499
Joined: Thursday 11 July 2013 22:21
Target OS: Raspberry Pi / ODroid
Domoticz version: Beta
Location: The Netherlands
Contact:

Re: Python Plugin: Python Plugin Manager

Post by remb0 »

maybe Dnpwwo can help as creator of the python framework?
and maybe joincan join domoticz.slack.com (send me a pm with email)
User avatar
ycahome
Posts: 248
Joined: Sunday 12 February 2017 10:55
Target OS: Linux
Domoticz version: lat Beta
Contact:

Re: Python Plugin: Python Plugin Manager

Post by ycahome »

IDANIT wrote: Monday 26 February 2018 20:59
remb0 wrote: Monday 26 February 2018 20:29 raspberry pi latest beta domoticz and up to date raspbian.
after adding pluging I added buienradar. and it say: problems adding hardware.
after that hardwarelist is empty.
So You are third with exactly the same plugin behaviour.
Ok, noticed some strange behavior by myself on my raspberry but :
- cannot find where it comes from
- after restart Domoticz, it works fine.


I will continue to test

BTW a new version is available:
- Notify only feature activated for "selected" and "all" plugin(s) (results sent by email)
IDANIT
Posts: 73
Joined: Saturday 07 November 2015 10:01
Target OS: Raspberry Pi / ODroid
Domoticz version: Beta
Location: Poland
Contact:

Re: Python Plugin: Python Plugin Manager

Post by IDANIT »

I've read somewhere that there are some issues with python 3.5 on Raspbian Stretch.
I've change from 3.5.3 to different Python version (3.4.4) and now everything works fine.
Great Job! Keep it up!
Waiting fo BroadlinkRM2 :D ;)
User avatar
ycahome
Posts: 248
Joined: Sunday 12 February 2017 10:55
Target OS: Linux
Domoticz version: lat Beta
Contact:

Re: Python Plugin: Python Plugin Manager

Post by ycahome »

IDANIT wrote: Wednesday 28 February 2018 15:23 I've read somewhere that there are some issues with python 3.5 on Raspbian Stretch.
I've change from 3.5.3 to different Python version (3.4.4) and now everything works fine.
Great Job! Keep it up!
Waiting fo BroadlinkRM2 :D ;)
Seems that BroadlinkRM2 (http://www.domoticz.com/wiki/Plugins/Br ... For_others) is not located on GitHub. Cannot be integrated for now.

Thanks.
Post Reply

Who is online

Users browsing this forum: No registered users and 1 guest