Add Shelly 1PM WiFi switch in Domoticz

Add Shelly 1PM WiFi switch in Domoticz

March 30, 2022 0 Door Bjorn Meijer

With the Shelly 1PM is a compact switch that you can not only use as a switch, but also to measure the power consumption. This smart switch is therefore extremely suitable to use as a light switch or to measure the power consumption of the washing machine or dryer. It is also easy to integrate into Domoticz, Home Assistant or another home automation system.

The Shelly 1PM is easy to install behind a socket or wall switch (handy if your kids still don't know that a light switch is also meant to turn off the light). The Shelly 1PM operates on a voltage of 110-230VAC or 24-60VDC at a maximum of 16A/3500W. Enough to measure the power consumption of the washing machine or dryer.

Once you have mounted and activated the Shelly 1PM, it is time to install it in Domoticz. For this we use MQTT, which stands for Message Queue Telemetry Transport. If MQTT is already installed on your Raspberry Pi, you can skip the first @ steps.

1. Update the Raspberry Pi to the latest version via the terminal

sudo apt-get update

sudo apt-get upgrade

2. Install Mosquito

sudo apt-get install mosquitto mosquitto-clients

3. Install Python 3.5

cd domoticz/plugins
git clone https://github.com/enesbcs/Shelly_MQTT.git

4. Restart the Raspberry Pi

sudo reboot

5. Open Domoticz via the browser

Go to http://domoticz-ip:8080

6. Enter the Hardware interface

In the menu go to Settings Hardware to add new hardware to Domoticz.

7. Add New Hardware

Add new hardware and adopt the settings below.

Settings MQTT Client Gateway LAN interface
Settings MQTT Client Gateway LAN interface

Name: Give the hardware a recognizable name. For example, MQTT.
remote address: Enter the IP address of Domoticz. For example 192.168.178.29
User name: Fill a user name in.
Password: Fill a password in.
Publish Topic: Set to Flat.

8. Add Shelly MQTT hardware

Select Shelly MQTT from the Hardware list and copy the information below.

Settings Shelly MQTT
Settings Shelly MQTT

MQTT Server address: Enter the IP address of Domoticz (see step 7).

Fill the user name and password in which you in step 7 entered.

To display the Shelly 1PM switch at Devices we still need to adjust a bit in the settings of the switch.

9. Set MQTT in Shelly 1PM

Go to http://IP address of your Shelly 1PM

Then click Internet & Security and go to ADVANCED DEVELOPER SETTINGS and copy the information below.

Set MQTT to Shelly 1PM
Set MQTT to Shelly 1PM

Fill the user name, password and server in which you in step 7 entered.

click on SAVE to save the changes.

You should now see the Shelly 1PM under Devices in Domoticz. If you don't see the switch appear in Domoticz yet, reboot the Pi one more time just to be sure.