Python Plugin: Shelly MQTT

Python and python framework

Moderator: leecollings

tjabas
Posts: 564
Joined: Sunday 11 December 2016 13:51
Target OS: Raspberry Pi / ODroid
Domoticz version:
Contact:

Re: Python Plugin: Shelly MQTT

Post by tjabas »

I'm using the shelly mqtt plugin and also the teacher software in windows, I thought that I needed both these softwares for the Shelly plus devices?
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 »

tjabas wrote: Thursday 23 November 2023 16:34 I'm using the shelly mqtt plugin and also the teacher software in windows, I thought that I needed both these softwares for the Shelly plus devices?
Did you read the read.me of the script
ShellyTeacher 4 Domoticz
Shelly device teacher for Domoticz MQTT Autodiscovery hardware

You need to understand before installation:

this is not compatible with the old ShellyMQTT plugin, its based on a different hardware, which will create new devices
only the Shelly device types listed in the "Implemented devices" will be recognised, but you can change/enhance templates.txt file to add more devices
its not a plugin, nor a service, it doesn't need to run all the time - only once (Domoticz MQTT Autodiscovery is the Domoticz integrated hardware)
Domoticz running on Udoo X86 (on Ubuntu)
Devices/plugins: ZigbeeforDomoticz (with Xiaomi, Ikea, Tuya devices), Nefit Easy, Midea Airco, Omnik Solar, Goodwe Solar
tjabas
Posts: 564
Joined: Sunday 11 December 2016 13:51
Target OS: Raspberry Pi / ODroid
Domoticz version:
Contact:

Re: Python Plugin: Shelly MQTT

Post by tjabas »

Hi!

i just updated my rpi to bullseye and now it seems like shelly MQTT isnt working anymore.

is there any fix for this?
lwolf
Posts: 216
Joined: Saturday 10 November 2018 18:29
Target OS: Raspberry Pi / ODroid
Domoticz version:
Location: Hungary
Contact:

Re: Python Plugin: Shelly MQTT

Post by lwolf »

tjabas wrote: Tuesday 12 December 2023 19:13 Hi!

i just updated my rpi to bullseye and now it seems like shelly MQTT isnt working anymore.

is there any fix for this?
ShellyMQTT is not supported anymore. You can use ShellyTeacher in the future.
tjabas wrote: Tuesday 12 December 2023 19:13 2023-12-12 18:48:29.896 Error: Shelly MQTT: Disconnected from MQTT Server: 127.0.0.1:1883
If you are unable to connect to MQTT broker after upgrading Linux distribution, than its not a plugin issue, but the Mosquitto broker default security settings changed, and you are using without name+password.

You can find here, what is needed to change in your mosquitto.conf file to enable anonymous access or how can you create user/password for it:
https://www.sigmdel.ca/michel/ha/rpi/mo ... ye_en.html
DeKnep
Posts: 5
Joined: Tuesday 09 June 2020 22:24
Target OS: Raspberry Pi / ODroid
Domoticz version: beta
Location: Netherlands
Contact:

Re: Python Plugin: Shelly MQTT

Post by DeKnep »

Xavier82 wrote: Wednesday 26 October 2022 11:03 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.
I just encountered the same issue and found this fix here.
Thanks! :)

Just a small heads-up for others who also run into this: In v0.6.1 of the ShellyMQTT plugin the corresponding lines are 6 lines further down from Xavier82's description.
Post Reply

Who is online

Users browsing this forum: Bing [Bot] and 0 guests