Python Plugin: Shelly MQTT

Python and python framework

Moderator: leecollings

Number8
Posts: 374
Joined: Friday 23 May 2014 7:55
Target OS: Linux
Domoticz version: 2022.1
Location: Saint Pierre de Jards
Contact:

Re: Python Plugin: Shelly MQTT

Post by Number8 »

FWIW, I setup an Home assistant instance and make then talk to each other using MQTT
Debian buster on NUC and three RPi with buster.
SavioThecnic
Posts: 13
Joined: Thursday 27 August 2020 9:46
Target OS: Raspberry Pi / ODroid
Domoticz version: 2022.1
Location: Italy
Contact:

Re: Python Plugin: Shelly MQTT

Post by SavioThecnic »

Doesn't run on Raspberry Pi OS 11 Bullseye

Hi friend I wanted to tell you that the plugin is not compatible with the new Raspberry Pi OS 11 Bullseye system
for now it only works on Buster
Tested with both the latest stable version of Domoticz and the latest Beta
imautohuttraeger
Posts: 97
Joined: Saturday 14 March 2020 13:40
Target OS: Raspberry Pi / ODroid
Domoticz version:
Contact:

Re: Python Plugin: Shelly MQTT

Post by imautohuttraeger »

@Number8: Thx for your hint. Have you installed HA in parallel to Domoticz on the same device (e. g. Raspberry)? Can the existing MQTT Broker work both for Domoticz and HA?
SavioThecnic
Posts: 13
Joined: Thursday 27 August 2020 9:46
Target OS: Raspberry Pi / ODroid
Domoticz version: 2022.1
Location: Italy
Contact:

Re: Python Plugin: Shelly MQTT

Post by SavioThecnic »

I am doing various tests
For now HA I'm using it on a different device
However, I confirm MQTT is seen by both Domoticz and HA but I preferred to install it smoothly on the raspberry because under Broker as for Nodered and Influxdb I had problems seeing it then in the network if it was under the HA Broker
Number8
Posts: 374
Joined: Friday 23 May 2014 7:55
Target OS: Linux
Domoticz version: 2022.1
Location: Saint Pierre de Jards
Contact:

Re: Python Plugin: Shelly MQTT

Post by Number8 »

imautohuttraeger wrote: Wednesday 14 September 2022 10:13 @Number8: Thx for your hint. Have you installed HA in parallel to Domoticz on the same device (e. g. Raspberry)? Can the existing MQTT Broker work both for Domoticz and HA?
I've got HA on a different RasPI3. I've got MQTT broker on another specific RasPI3. Only one broker. Not all eggs in the same basket.
Debian buster on NUC and three RPi with buster.
Number8
Posts: 374
Joined: Friday 23 May 2014 7:55
Target OS: Linux
Domoticz version: 2022.1
Location: Saint Pierre de Jards
Contact:

Re: Python Plugin: Shelly MQTT

Post by Number8 »

imautohuttraeger wrote: Wednesday 14 September 2022 10:13 @Number8: Thx for your hint. Have you installed HA in parallel to Domoticz on the same device (e. g. Raspberry)? Can the existing MQTT Broker work both for Domoticz and HA?
I've got HA on a different RasPI3. I've got MQTT broker on another specific RasPI3. Only one broker. Not all eggs in the same basket.
Debian buster on NUC and three RPi with buster.
imautohuttraeger
Posts: 97
Joined: Saturday 14 March 2020 13:40
Target OS: Raspberry Pi / ODroid
Domoticz version:
Contact:

Re: Python Plugin: Shelly MQTT

Post by imautohuttraeger »

Thx folks! Will give HA on a different RasPi a trial.
CronoS
Posts: 135
Joined: Wednesday 15 July 2015 23:40
Target OS: -
Domoticz version:
Contact:

Re: Python Plugin: Shelly MQTT

Post by CronoS »

I have one Shelly Plus running with Domoticz using the discovery script on the Shelly. But unfortunately it is not a stable solution or a workable solution with Domoticz using this setup. In the last month I lost several times the connection between Domoticz and the Shelly. On the device everything seems to be OK, but on the Domoticz the switch does not work. The only way to fix it is to delete the Shelly Plus device from Domoticz and readd it again... So the Gen2 devices are not really usable for me at this moment using this method

Also; one time the Shelly itself stopped working because of the script that is running on it I think. The script got allot of impact on the device itself I think. The Website on the device was also not accessable, so I needed to cut the power on the Shelly in order to reset things. If this device is behind a wall outlet, it is not something you want to do frequently...
Xavier82
Posts: 178
Joined: Tuesday 07 June 2016 22:09
Target OS: Raspberry Pi / ODroid
Domoticz version: 2023.2
Location: Netherlands
Contact:

Re: Python Plugin: Shelly MQTT

Post by Xavier82 »

Hi all,

expering strange? behaviour with Shelly Dimmer 2 in Domoticz...

Used software and version:
Domoticz version 2022.1
Shelly MQTT https://github.com/enesbcs/Shelly_MQTT
DZGA Version: 1.10.9 master (DomoticZ Google Assistent) for integration between Domoticz and Google for voice controle

Setup:
Domoticz to integrate multiple hardware vendors and protocols, central home automation control, using smart metering P1, All kinds of Shelly devices, temperature (thermostat), security control, Airco Control, multimedia and weater integration.
Using Shelly MQTT to connect to Shelly devices (DImmer2, Shelly1, Shelly1PM, Shelly 2.5 (blinds control), Shelly Plug-S, etc.
DZGA is used for integration with Google Assistent.

Issue:
Shelly Dimmer2 devices appear in Domoticz as type "Color switch, white, dimmer"
ShellyDimmer2_Domoticz.png
ShellyDimmer2_Domoticz.png (10.4 KiB) Viewed 3004 times
Within DZGA a Shelly Dimmer2 appears as "ColorSwitch":
Shelly Dimmer2_DZGA.png
Shelly Dimmer2_DZGA.png (3.73 KiB) Viewed 3004 times
When looking at the MQTT based on "Zigbee2MQTT Plugin" https://github.com/stas-demydiuk/domoti ... issues/714 then a dimmer shows up as "Light/Switch" and not as "Color Switch".

The Shelly Dimmer2 can only dim lights and has no feature as Color Switch.

When doing a voice command to Google Assistent like "All lights on" this command will activate ALL devices with type "Light" AND "Color Switch", while ONLY should activate type "Light".

Does anyone has a solution for this?
Is it possible to show Shelly Dimmer2 as "Light/Switch" like is done with Zigbee2MQTT instead of "Color Switch"?
Why does Domoticz gets the device type "Color Switch"? Is this being caused by the Shelly MQTT plugin?

I hope somebody can help.

Thanks!
ProjektC
Posts: 67
Joined: Sunday 17 December 2017 17:59
Target OS: Raspberry Pi / ODroid
Domoticz version: 4.10717
Location: Germany
Contact:

Re: Python Plugin: Shelly MQTT

Post by ProjektC »

viewtopic.php?p=292961#p292961

I have very big problems there.
Is it Bullseye or the new MQTT version ?
I have installed this 2 years ago once and everything ran on the first go.
Now I sit hours and hours and do not get it right
ProjektC
Posts: 67
Joined: Sunday 17 December 2017 17:59
Target OS: Raspberry Pi / ODroid
Domoticz version: 4.10717
Location: Germany
Contact:

Re: Python Plugin: Shelly MQTT

Post by ProjektC »

So now Buster installed but has brought nothing.
listener 1883
removed and then it worked

There are unfortunately many sites that write even with 2.0.11 it must be in.
Xavier82
Posts: 178
Joined: Tuesday 07 June 2016 22:09
Target OS: Raspberry Pi / ODroid
Domoticz version: 2023.2
Location: Netherlands
Contact:

Re: Python Plugin: Shelly MQTT

Post by Xavier82 »

Xavier82 wrote: Friday 23 September 2022 11:22 Hi all,

expering strange? behaviour with Shelly Dimmer 2 in Domoticz...

Used software and version:
Domoticz version 2022.1
Shelly MQTT https://github.com/enesbcs/Shelly_MQTT
DZGA Version: 1.10.9 master (DomoticZ Google Assistent) for integration between Domoticz and Google for voice controle

Setup:
Domoticz to integrate multiple hardware vendors and protocols, central home automation control, using smart metering P1, All kinds of Shelly devices, temperature (thermostat), security control, Airco Control, multimedia and weater integration.
Using Shelly MQTT to connect to Shelly devices (DImmer2, Shelly1, Shelly1PM, Shelly 2.5 (blinds control), Shelly Plug-S, etc.
DZGA is used for integration with Google Assistent.

Issue:
Shelly Dimmer2 devices appear in Domoticz as type "Color switch, white, dimmer"
ShellyDimmer2_Domoticz.png
Within DZGA a Shelly Dimmer2 appears as "ColorSwitch":
Shelly Dimmer2_DZGA.png

When looking at the MQTT based on "Zigbee2MQTT Plugin" https://github.com/stas-demydiuk/domoti ... issues/714 then a dimmer shows up as "Light/Switch" and not as "Color Switch".

The Shelly Dimmer2 can only dim lights and has no feature as Color Switch.

When doing a voice command to Google Assistent like "All lights on" this command will activate ALL devices with type "Light" AND "Color Switch", while ONLY should activate type "Light".

Does anyone has a solution for this?
Is it possible to show Shelly Dimmer2 as "Light/Switch" like is done with Zigbee2MQTT instead of "Color Switch"?
Why does Domoticz gets the device type "Color Switch"? Is this being caused by the Shelly MQTT plugin?

I hope somebody can help.

Thanks!
Nobody with this issue? of who can help me out?
DoMoAD
Posts: 13
Joined: Friday 11 May 2018 14:24
Target OS: Raspberry Pi / ODroid
Domoticz version: BETA
Location: Netherlands
Contact:

Re: Python Plugin: Shelly MQTT

Post by DoMoAD »

I have a problem with my blinds that stopt working. I opend a topic in the forum because domoticz changed a lot lately with the blinds. The problem is that i can't controle the blinds anymore but MQTT commands from the blinds to domoticz still work.

viewtopic.php?f=6&t=39240&sid=91707c36b ... 6129bada04
Xavier82
Posts: 178
Joined: Tuesday 07 June 2016 22:09
Target OS: Raspberry Pi / ODroid
Domoticz version: 2023.2
Location: Netherlands
Contact:

Re: Python Plugin: Shelly MQTT

Post by Xavier82 »

So I finally found the issue/error and with some help I managed to fix it!:
2 rows (line 1177+1178) need to be adjusted:

Code: Select all

elif (mqttpath[2] in ["white"]) or ("2LED" in unitname):
              Domoticz.Device(Name=unitname, Unit=iUnit,Type=241, Subtype=3, Switchtype=7, Used=1,DeviceID=unitname).Create() # create Color White device 
and 2 rows (1179 and 1180) need to be added after row 1178:

Code: Select all

elif (mqttpath[2] in ["light"]):
              Domoticz.Device(Name=unitname, Unit=iUnit,Type=244, Subtype=73, Switchtype=7, Used=1,DeviceID=unitname).Create() # create Light Dimmer device 

To all who are using the Shelly MQTT Python script of "enesbcs" and have issues with device type in Domoticz with a Shelly Dimmer2
Copy the code and paste(overwrite+ add) the code in the /domoticz/plugins/Shelly_MQTT/plugin.py file.
Save the file plugin.py file.
Remove the faulty devices in Domoticz
Quickly restart Domoticz service
After some time you will find the new created devices in the device tab with the correct device type "Light/Switch, Switch, Dimmer" instead of "Color Switch".

I tried to contact "enesbcs" but failed, I also tried to do a new pull request on GitHub, but this also failed because it is not supported.
User avatar
waltervl
Posts: 5148
Joined: Monday 28 January 2019 18:48
Target OS: Linux
Domoticz version: 2024.7
Location: NL
Contact:

Re: Python Plugin: Shelly MQTT

Post by waltervl »

Xavier82 wrote: Wednesday 26 October 2022 11:03

I tried to contact "enesbcs" but failed, I also tried to do a new pull request on GitHub, but this also failed because it is not supported.
Creating a pull request is supported i think. Tou first have to fork (copy) the repository to your own github, make the changes in your fork and then create the pull request to the original repository of enesbcs.
Domoticz running on Udoo X86 (on Ubuntu)
Devices/plugins: ZigbeeforDomoticz (with Xiaomi, Ikea, Tuya devices), Nefit Easy, Midea Airco, Omnik Solar, Goodwe Solar
DoMoAD
Posts: 13
Joined: Friday 11 May 2018 14:24
Target OS: Raspberry Pi / ODroid
Domoticz version: BETA
Location: Netherlands
Contact:

Re: Python Plugin: Shelly MQTT

Post by DoMoAD »

DoMoAD wrote: Sunday 23 October 2022 23:24 I have a problem with my blinds that stopt working. I opend a topic in the forum because domoticz changed a lot lately with the blinds. The problem is that i can't controle the blinds anymore but MQTT commands from the blinds to domoticz still work.

viewtopic.php?f=6&t=39240&sid=91707c36b ... 6129bada04
Found the problem.
Domoticz is sending the command "open" and "close" where ShellyMQTT plugin is expecting "on" and "off". changed "on" and "off" from row 192 until 201.

(the wiki on blinds states 0 an 100 for open and close, that was my first attempt to fix it)
samourai47
Posts: 50
Joined: Wednesday 06 March 2019 21:52
Target OS: Raspberry Pi / ODroid
Domoticz version:
Contact:

Re: Python Plugin: Shelly MQTT

Post by samourai47 »

Hello
Is the shelly 1 plus recogneized with this pluginS

I have 4 shelly 1 and no problem for the integration

But with the shelly1 plus is not recognised...

Perhaps the configuration?


Thank's for your help
mastadook
Posts: 58
Joined: Wednesday 18 April 2018 13:03
Target OS: Raspberry Pi / ODroid
Domoticz version: 2022.1
Location: Deutschland
Contact:

Re: Python Plugin: Shelly MQTT

Post by mastadook »

Hi All,

one Question regarding this Plugin and Shelly3EM:
Will there a Power Device created automatically?
In my Setup it creates 3 Devices per Phase:
1 Current in A
2 Voltage in V
3 Powerfactor
But no Device for Power but via mqtt Explorer I can see that the Shelly send all needed data.

What I am doing wrong?
The Plugin is the newest one and Domoticz is Version 2022.1 Stable
________________________________________________________________________
global chief of permanent lightning and strike detonator
manuloup
Posts: 31
Joined: Sunday 23 November 2014 16:18
Target OS: Raspberry Pi / ODroid
Domoticz version:
Location: France
Contact:

Re: Python Plugin: Shelly MQTT

Post by manuloup »

Hi all,

Any hope that the plugin will be updated to recognize the new devices like Shelly 4PM pro or Shelly H&T plus ?

Regards,
Manu
Rapberry PI B+ (RaspBian), RFXtrx433E USB 433.92MHz Transceiver, AEON LABS Controler Z-Wave, Aeon Labs Z-Stick S2, Everspring ST814 Temperature Sensor, Everspring SF812 Smoke Detector, 2x Fibaro Wallplug, Aeon Zwave Miniremote , Xbee Teleinfo USB
CronoS
Posts: 135
Joined: Wednesday 15 July 2015 23:40
Target OS: -
Domoticz version:
Contact:

Re: Python Plugin: Shelly MQTT

Post by CronoS »

Does anyone has a working Node Red Node for the Shelly Plus devices? This because the Shelly MQTT plugin is not compatible.

The Homeassistent MQTT autodiscover script is not reliable on the Shelly plus. It is still under investigation at Shelly Support. Using MQTT with Node Red is the stable solution, but I am not familiar enough with Node Red to create a node. So hopefully I can have a jumpstart here with someone who knows how Node Red can work.
Post Reply

Who is online

Users browsing this forum: No registered users and 1 guest