Domoticz now has a plugin management system developed in Python like most other Open Source home automation servers (Home Assistant, OpenHAB). Launched timidly in 2018, many plugins are now available. If you have special needs, you can even get started developing your plugin by following these specifications.
There are two ways to install plugins. Either install them manually, or use the plugin “Python Plugin Manager” (PP Manager) that takes care of this task. We will see how to do both.
Check the installation of Python 3 on Raspbian, Linux, Windows, macOS
Domoticz supports plugins developed in Python 3. This is a critical point and for all to confess, I have had to leave a freshly installed Raspbian to get there despite having followed the advice of the official WiKi to the letter. Run the following command to check the version of Python 3 installed on Linux
python3 -V Python 3.5.3
As you can see, I tested with version 3.5.3 (the last at the time of writing the tutorial) without any problem. There seemed to be some problems with upgrading from version 3.4 to version 3.5 but that does not seem to be the case anymore. No need to install an older version.
If Python is not installed, run this command under Linux or Raspbian
sudo apt install python3
On Windows or macOS, go to the official website to download the installer and follow the instructions of the latter.
Then you have to install the additional libraries libpython and python3-dev
sudo apt install libpython3.5 python3-dev
Restart Domoticz to start the plugin loading system
sudo systemctl restart domoticz.service
Last thing to do, make sure the system is up to date and that the git package is installed. It will be necessary to download and install the plugins on your server
sudo apt-get update sudo apt-get install git
How to know if the plugins are loaded correctly at startup Before going further, it is better to check that everything is correctly in place. To know if the plugins will be loaded at startup, the only way is to go to the execution log that is in the Settings menu. If everything is correctly installed, you must find the trace PluginSystem: Started, Python version ‘3 .xx ‘in the log.
If this is not the case, go to the What to do if plugins do not appear in the menu? to find a track.
What plugins are available?
In addition to the Python Plugin Manager plugin, there are 60 plugins available. The official list is here on the official WiKi. Here is the current list. As you can see, not all plugins are supported by PP Manager, you will have to do a manual installation for them.
Manually install a plugin
Now everything is ready, we will be able to add our first plugin. I propose you to install the plugin Zigbee2MQTT which allows to directly integrate home automation accessories Xiaomi Aqara or Mijia in Domoticz. This plugin was developed by the project team. In addition to configuring access to the MQTT broker, it allows you to enable or disable the discovery of accessories without having to modify the configuration file manually.
Open a Terminal and go to the plugins directory.
cd domoticz/plugins
then we clone with the command git the desired plugin. Use the link to the source code found in the previous table by adding .git to it at the end
git clone URL_PLUGIN.git PLUGIN_DESTINATION_FOLDER
Which gives for Zigbee2MQTT.
git clone https://github.com/stas-demydiuk/domoticz-zigbee2mqtt-plugin.git zigbee2mqtt
You have to make the python script executable
cd Zigbee2Mqtt chmod +x plugin.py
Now we restart Domoticz
sudo systemctl restart domoticz.service
Refresh the browser view and go to the Settings -> Hardware hardware page. In the selection list, you should now find at the end of the list the plugin Zigbee2MQTT.
Voilà, it remains only to configure the parameters to integrate accessories Xiami Aqara!
Install Python Plugin Manager
The PP Manager plugin is only available on Linux. PP Manager installs like any other plugin. Follow the same steps as before.
The operation of PP Manager is a bit special.
To install a plugin with PP Manager
To install a plugin with PP Manager, select Python Manager Plugin as the hardware type then in the selector
I advise you to name the hardware with the name of the plugin that you will install followed by the keyword plugin. This will allow you to differentiate between the plugin and the hardware configuration. This will be very useful for updates.
In the list of plugins to install, choose the desired plugin. If you trust the plugin developer, you can let PP Manager automatically update (Auto Update) but it is not recommended.
Click on Add to finish the installation.
For the moment, it is unfortunately necessary to manually restart the Domoticz service from the Terminal to reload the list of plugins
sudo systemctl restart domoticz.service
Add an accessory
Once the plugin installed with PP Manger, we can configure a new material as usual. I also advise you to name the material differently in order to quickly distinguish it with the plugin.
For that, just look for the plugin in the list of materials as usual.
Managed plugins with PP Manager are installed with the root user. It will be necessary to connect in root or change of user to make modifications in the files.
PP Manager does not manage the uninstallation of the plugins.
What to do if the plugins do not appear in the menu?
On the official WiKi, it is recommended to install the beta version of Domoticz in case of problems. Everything works perfectly with version 4.9700.
It must always restart the Domoticz server including when using the plugin Python Plugin Manager from the Terminal with the command
sudo systemctl restart domoticz.service
Do not forget to refresh the browser to reload the list of plugins in the selector.If it still does not work, re-start the system (sudo reboot) or from the browser Settings -> More Options -> Restart.
It still does not work, all you have to do is leave with a new installation of Raspbian
- Install Domoticz on NAS Synology DS718+ with Docker or virtual machine under Debian Buster
- Use the plugins on Domoticz. Manual installation or via Python Plugin Manager
- CloudMQTT test, free online MQTT broker. Control Domoticz with the JSON API
- Securing Domoticz with Let’s Encrypt certificate, access from HTTPS internet
- Xiaomi Mijia Honeywell Smoke Detector Test with Domoticz, Emergency Notification with PushOver