Page 1 of 1
Python plugin: how to develop?
Posted: Thursday 20 April 2017 20:55
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!
Re: Python plugin: how to develop?
Posted: Thursday 20 April 2017 21:41
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.
Re: Python plugin: how to develop?
Posted: Thursday 20 April 2017 21:58
by Westcott
Hi Ubee,
Thanks!
I think I'll stick with my Python equivalent of Egregius' pass2php
Re: Python plugin: how to develop?
Posted: Thursday 20 April 2017 22:07
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 (

) 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.
Re: Python plugin: how to develop?
Posted: Thursday 20 April 2017 22:17
by Westcott
G3rard, thanks for the extra info!
I had read that wiki, which then prompted my 3 questions.