Using Python plugins
Plugins are great! Since the ability to create Python plugins was added to Domoticz, it has seen an explosion of plugins.
- Check this list of plugins that have already been developed and where to find them. Brand new plugins are also shared on the forum.
- Would you like to create your own plugin? This page will get you started developing plugins to extend the functionality of Domoticz.
Required: install Python
If you want to use plugins you must have Python 3.4 or above installed:
- Optional: some plugins require beta versions for newer features if so, upgrade to the beta version
- install python3 runtime
- you may need to install python3 development libraries for now - see this issue thread
- restart your Domoticz service
- check your logs
Installing Python for Windows
Installing Python on Raspberry Pi with Raspbian
This assumes you have a vanilla, production release Domoticz server.
sudo apt-get install -y python3
Domoticz Beta versions since V3.6129 also require...
sudo apt-get install -y python3-dev
Update to the latest beta version
cd ~/domoticz ./updatebeta
Restart the service
sudo systemctl restart domoticz.service
Now check the logs to make sure there are no errors.
Installing a plugin
Generally installing a plugin takes a few steps:
- Download the plugin and copy its folder into the domoticz/plugins directory. Each plugin at the very least consists of a plugin.py file.
- Give the plugin.py file execute permissions. Right click on the file to change its permissions, or use the terminal to navigate to the directory, and then type:
- Restart the Domoticz service (or reboot the entire server)
- In the Domoticz interface, navigate to the hardware page. There you should now find the plugin name in the device types dropdown list.
Optionally, you may have to install extra software like drivers. Check the plugin documentation to find out.
Example for Raspberry Pi with Raspbian
Let's run through an example installation.
A lot of plugins store their code on Github, a website made for this purpose. If you run Domoticz on a Linux system, install Git to easily download the plugins through the terminal:
sudo apt-get update sudo apt-get install git
Next, navigate to the plugin directory, and install the plugin straight from Github. In the documentation of most plugins you'll find the Git link you an use. Here we install the Smart Virtual Thermostat in a folder called 'SVT':
cd domoticz/plugins git clone https://github.com/999LV/SmartVirtualThermostat.git SVT
So in this case the directory structure should now be: domoticz/plugins/SVT/plugin.py
Next, if you run Linux, we have to make the plugin.py file executable. Let's enter the directory and issue the command:
cd SVT chmod +x plugin.py
Next, we restart Domoticz so that it will find the plugin:
sudo systemctl restart domoticz.service
From here the plugin should be able to be set-up from the Domoticz interface. Go to the hardware page and look in the dropdown. Note: the plugin and directory name are often different.
- check the log via the web interface (Setup / Log)
- you should see
PluginSystem: Started, Python version '3.x.y'
- if there is no mention at all of plugins
- check have set up plugins (see above)
- if you see
PluginSystem: Failed dynamic library load
- have you installed the pyhton3 development libraries
- check article 
There are also currently some issues with using python 3.5 on Raspbian Stretch. To fix this, install python 3.4 and set python 3.4 as the executable.
To find which version is active (3.4 or 3.5), type this command:
If you are using 3.5, try this:
sudo apt-get install python3.4 libpython3.4 python3.4-dev
Next, set 3.4 as the main version to use. You can change it back later if you want.
update-alternatives --install /usr/bin/python python3 /usr/bin/python3.5 1 update-alternatives --install /usr/bin/python python3 /usr/bin/python3.4 2
Now you can switch between them by issueing this command, and selecting your preference:
update-alternatives --config python3
More details on telling linux which version of Python to use: https://linuxconfig.org/how-to-change-from-default-to-alternative-python-version-on-debian-linux