Python plugin: how to develop?

Python and python framework

Moderator: leecollings

Post Reply
User avatar
Westcott
Posts: 423
Joined: Tuesday 09 December 2014 17:04
Target OS: Raspberry Pi / ODroid
Domoticz version: Beta
Location: UK - Glos
Contact:

Python plugin: how to develop?

Post by Westcott »

Hi,
I've searched the Wikis and this forum, but can't find answers to these questions.
It must be obvious because several posters have already created plugins successfully.

import Domoticz
Where does this library come from?

Does the plugin run continuously?

How to run new versions of my code?
I hope this doesn't involve restarting Domoticz every time!
Zwave - Sigma Z+ stick, Fibaro, Horstmann, Neo Coolcam, EUROtronic
RFlink - IR detectors and temperatures
Wifi - YeeLights, ESP32s, Anoop sockets
Zigbee - lots with zigbee2mqtt and ZbBridge
ubee
Posts: 66
Joined: Tuesday 10 February 2015 20:38
Target OS: Raspberry Pi / ODroid
Domoticz version: 2021.1
Location: Sweden
Contact:

Re: Python plugin: how to develop?

Post by ubee »

The library is provided by the plugin system in Domoticz. Please note the Python plugin support is just available in the beta version.

The plugin executes on specific events by call-back functions.

You have to restart the Domoticz daemon if you update your plugin.
User avatar
Westcott
Posts: 423
Joined: Tuesday 09 December 2014 17:04
Target OS: Raspberry Pi / ODroid
Domoticz version: Beta
Location: UK - Glos
Contact:

Re: Python plugin: how to develop?

Post by Westcott »

Hi Ubee,
Thanks!
I think I'll stick with my Python equivalent of Egregius' pass2php
Zwave - Sigma Z+ stick, Fibaro, Horstmann, Neo Coolcam, EUROtronic
RFlink - IR detectors and temperatures
Wifi - YeeLights, ESP32s, Anoop sockets
Zigbee - lots with zigbee2mqtt and ZbBridge
User avatar
G3rard
Posts: 669
Joined: Wednesday 04 March 2015 22:15
Target OS: -
Domoticz version: No
Location: The Netherlands
Contact:

Re: Python plugin: how to develop?

Post by G3rard »

ubee wrote: You have to restart the Domoticz daemon if you update your plugin.
Pressing the Update button in the hardware page is most of the times sufficient.
At least when changing code in the plugin.py. When you add/change fields to the XML part, then a restart is necessary, but most changes will be to the code and the new code is available after pressing the Update button.

The library is loaded from Domoticz ( 8-) ) and enables adding devices, updating devices, print to the log etc.

Have a look at https://www.domoticz.com/wiki/Developin ... hon_plugin. That gives a lot of additional information.
Not using Domoticz anymore
User avatar
Westcott
Posts: 423
Joined: Tuesday 09 December 2014 17:04
Target OS: Raspberry Pi / ODroid
Domoticz version: Beta
Location: UK - Glos
Contact:

Re: Python plugin: how to develop?

Post by Westcott »

G3rard, thanks for the extra info!
I had read that wiki, which then prompted my 3 questions.
Zwave - Sigma Z+ stick, Fibaro, Horstmann, Neo Coolcam, EUROtronic
RFlink - IR detectors and temperatures
Wifi - YeeLights, ESP32s, Anoop sockets
Zigbee - lots with zigbee2mqtt and ZbBridge
Post Reply

Who is online

Users browsing this forum: No registered users and 1 guest