Python Plugin: Shelly MQTT

Python and python framework

Moderator: leecollings

hendryman
Posts: 9
Joined: Sunday 22 October 2017 16:20
Target OS: Raspberry Pi / ODroid
Domoticz version:
Contact:

Re: Python Plugin: Shelly MQTT

Post by hendryman »

The basic setup is this: /etc/mosquitto/mosquitto.conf is the default file, and that file then calls /etc/mosquitto/conf.d/mosquitto.conf for user customizations. However, even the default file does not get called my Mosquitto, contrary to what the wiki and other resources write. Either my installation is somehow broken, or the config file handling got changed by the Mosquitto 2.x update...

Basically, the best way to hack this is if someone could tell me how to modify the mosquitto init.d file so the "-c FILEPATH" option is invoked every time the demon starts.
extremeaudio
Posts: 47
Joined: Tuesday 24 November 2020 17:57
Target OS: Linux
Domoticz version:
Contact:

Re: Python Plugin: Shelly MQTT

Post by extremeaudio »

Does anyone have the solution for the MQTT 2.0 issue?
User avatar
waltervl
Posts: 5711
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 »

extremeaudio wrote: Saturday 25 September 2021 11:28 Does anyone have the solution for the MQTT 2.0 issue?
What MQTT 2.0 issue?
Domoticz running on Udoo X86 (on Ubuntu)
Devices/plugins: ZigbeeforDomoticz (with Xiaomi, Ikea, Tuya devices), Nefit Easy, Midea Airco, Omnik Solar, Goodwe Solar
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
Do you know if addon for temperature with ds18b20 devices is recognised in domoticz with this plugins and mqtt?
Thank's for your help
Gerwin
Posts: 84
Joined: Friday 12 August 2016 13:08
Target OS: Raspberry Pi / ODroid
Domoticz version:
Contact:

Re: Python Plugin: Shelly MQTT

Post by Gerwin »

by samourai47 » Saturday 25 September 2021 18:55

hello
Do you know if addon for temperature with ds18b20 devices is recognised in domoticz with this plugins and mqtt?
Thank's for your help

Yes it is reconized and work's verry well

Gerwin
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 »

Gerwin wrote: Sunday 26 September 2021 13:03 by samourai47 » Saturday 25 September 2021 18:55

Yes it is reconized and work's verry well

Gerwin
Great news... Thank's. I just command the deivice today and i completely newbies with mosquitto

So if i have undestood the configuration is...
Install mosquitto on RPI
Configure domoticz with the serveur
Install the shelly plugin
Create a dummy device for Temperature

And after?..... How send the value of the ds18b20 to the dummy device....
Neutrino
Posts: 21
Joined: Sunday 08 May 2016 19:00
Target OS: Raspberry Pi / ODroid
Domoticz version: 2021.1
Location: France
Contact:

Re: Python Plugin: Shelly MQTT

Post by Neutrino »

The plugin creates the devices, you don't need dummy.
extremeaudio
Posts: 47
Joined: Tuesday 24 November 2020 17:57
Target OS: Linux
Domoticz version:
Contact:

Re: Python Plugin: Shelly MQTT

Post by extremeaudio »

viewtopic.php?f=28&t=35706

Is this of concern or no?
waltervl wrote: Saturday 25 September 2021 11:33
extremeaudio wrote: Saturday 25 September 2021 11:28 Does anyone have the solution for the MQTT 2.0 issue?
What MQTT 2.0 issue?
User avatar
waltervl
Posts: 5711
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 »

extremeaudio wrote: Wednesday 06 October 2021 17:17 viewtopic.php?f=28&t=35706

Is this of concern or no?
waltervl wrote: Saturday 25 September 2021 11:33
extremeaudio wrote: Saturday 25 September 2021 11:28 Does anyone have the solution for the MQTT 2.0 issue?
What MQTT 2.0 issue?
The solution is in that topic so if you still have questions about that continue there.
Domoticz running on Udoo X86 (on Ubuntu)
Devices/plugins: ZigbeeforDomoticz (with Xiaomi, Ikea, Tuya devices), Nefit Easy, Midea Airco, Omnik Solar, Goodwe Solar
extremeaudio
Posts: 47
Joined: Tuesday 24 November 2020 17:57
Target OS: Linux
Domoticz version:
Contact:

Re: Python Plugin: Shelly MQTT

Post by extremeaudio »

waltervl wrote: Thursday 07 October 2021 15:47 The solution is in that topic so if you still have questions about that continue there.
Thank you for your offer to help. I am totally unable to get this to work. I am using raspbian buster.

I followed the tutorial here - https://www.youtube.com/watch?v=w7QhsFqBr30&t=3s

to install mqtt.

When I issue

Code: Select all

sudo apt-get install mosquitto mosquitto-clients
I get

Code: Select all

Process: 1369 ExecStart=/usr/sbin/mosquitto -c /etc/mosquitto/mosquitto.conf (code=exited, status=3)
 Main PID: 1369 (code=exited, status=3)
dpkg: error processing package mosquitto (--configure):
 installed mosquitto package post-installation script subprocess returned error exit status 1
Processing triggers for systemd (241-7~deb10u6+rpi1) ...
Processing triggers for man-db (2.8.5-2) ...
Processing triggers for libc-bin (2.28-10+rpi1) ...
Errors were encountered while processing:
 mosquitto
N: Ignoring file 'mosquitto-buster.list.2' in directory '/etc/apt/sources.list.d/' as it has an invalid filename extension
N: Ignoring file 'mosquitto-buster.list.3' in directory '/etc/apt/sources.list.d/' as it has an invalid filename extension
N: Ignoring file 'mosquitto-buster.list.1' in directory '/etc/apt/sources.list.d/' as it has an invalid filename extension
E: Sub-process /usr/bin/dpkg returned an error code (1)
osirisguitar
Posts: 15
Joined: Thursday 27 August 2020 14:59
Target OS: Raspberry Pi / ODroid
Domoticz version:
Contact:

Re: Python Plugin: Shelly MQTT

Post by osirisguitar »

Thanks for making this plugin!

Devices weren't created when I did "allow new hardware for 5 minutes", I had to switch that on permanently. Is that a fluke or a bug in the plugin?
extremeaudio
Posts: 47
Joined: Tuesday 24 November 2020 17:57
Target OS: Linux
Domoticz version:
Contact:

Re: Python Plugin: Shelly MQTT

Post by extremeaudio »

Can someone provide a step by step guide on configuring this plugin from scratch on a raspberry pi please ?
svde
Posts: 28
Joined: Sunday 17 April 2016 10:36
Target OS: Linux
Domoticz version:
Contact:

Re: Python Plugin: Shelly MQTT

Post by svde »

lwolf wrote: Saturday 10 November 2018 20:42 If anyone interested, I've made a Python plugin for Shelly MQTT integration into Domoticz. Currently I have only got a Shelly1 device to test, but more will come soon.
I would like to thank the zigbee2mqtt project for it's nice MQTT library that i reused.
https://github.com/enesbcs/Shelly_MQTT
Thank you for making this plugin.

I've recently updated the linux distribution on my system to a version which includes python 3.10.0. The Shelly MQTT plugin crashes with this python version. I looked on the github page, where it used to be possible to submit an issue, but this is no longer the case.
verygood142
Posts: 1
Joined: Friday 05 November 2021 14:00
Target OS: Linux
Domoticz version:
Contact:

Re: Python Plugin: Shelly MQTT

Post by verygood142 »

has anyone found the solution for shelly 1 plus from 2Gen?
User avatar
EdwinK
Posts: 1820
Joined: Sunday 22 January 2017 21:46
Target OS: Raspberry Pi / ODroid
Domoticz version: BETA
Location: Rhoon
Contact:

Re: Python Plugin: Shelly MQTT

Post by EdwinK »

When I issue

Code: Select all

sudo apt-get install mosquitto mosquitto-clients
I get

Code: Select all

N: Ignoring file 'mosquitto-buster.list.2' in directory '/etc/apt/sources.list.d/' as it has an invalid filename extension
N: Ignoring file 'mosquitto-buster.list.3' in directory '/etc/apt/sources.list.d/' as it has an invalid filename extension
N: Ignoring file 'mosquitto-buster.list.1' in directory '/etc/apt/sources.list.d/' as it has an invalid filename extension
E: Sub-process /usr/bin/dpkg returned an error code (1)
There should only be one such file in the directory, and the filename should end with list. So not with a number. You should try with renaming one of them and remove the others
Running latest BETA on a Pi-3 | Toon® Thermostat (rooted) | Hue | Tuya | IKEA tradfri | Dashticz V3 on Lenovo Huawei Tablet | Conbee
GSchets
Posts: 1
Joined: Friday 26 November 2021 14:56
Target OS: Raspberry Pi / ODroid
Domoticz version: 2021.1
Location: Breda
Contact:

Re: Python Plugin: Shelly MQTT

Post by GSchets »

I bought four Shelly Plug-S plugs and connected them to my Domoticz on Raspberry-pi via MQTT.
I want to keep an eye on the connected power with these plugs, but to my disappointment I get no power but temperature in Domoticz.
I already have a number of Shelly-1's, Shelly dimmer and an i3 and they all work perfectly.
I suspect that the Shelly plugin does not provide this.
Can someone help me?

Gerard
Thelion
Posts: 54
Joined: Saturday 08 October 2016 12:15
Target OS: Raspberry Pi / ODroid
Domoticz version: 2022.1
Location: The Netherlands
Contact:

Re: Python Plugin: Shelly MQTT

Post by Thelion »

Hi,

Got my Shelly Pro4PM a couple of days ago and tried to add it to Domoticz with this (https://github.com/enesbcs/Shelly_MQTT) plugin, which works fine with all kinds of Shelly devices.

The events and status of the Pro4PM are visible in MQTT, but with a completely different topic and event structure, so it isn't recognized by the plugin and not added to Domoticz.

I even tried firmware 0.9.0-beta2 to check if it works with that, but it doesn't 🙁

Tried changing the MQTT prefix in the device, which lists it at the correct topic, but the structure of the payload is apparently also completely different, but it still doesn't show up, which indicates more than just a different topic.

The maker of the plugin doesn't list any means of contacting him, so that's not the way to solve this.

Anybody has/found a way to solve this?

Apart from pushing the whole bidirectional communication through NodeRED and trying to get it to work?
User avatar
waltervl
Posts: 5711
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 »

If Shelley supports Home assistant MQTT Autodiscover you could try that with latest Domoticz beta. https://www.domoticz.com/wiki/MQTT#Auto ... .28Beta.29
Domoticz running on Udoo X86 (on Ubuntu)
Devices/plugins: ZigbeeforDomoticz (with Xiaomi, Ikea, Tuya devices), Nefit Easy, Midea Airco, Omnik Solar, Goodwe Solar
CronoS
Posts: 135
Joined: Wednesday 15 July 2015 23:40
Target OS: -
Domoticz version:
Contact:

Re: Python Plugin: Shelly MQTT

Post by CronoS »

What could be a nice native way to use Shelly devices with Domoticz? Basically the plugin by itself works OK, I don't have any issues with it. But I have a allot of shelly devices in my house lately, so I am also very depended on this plugin. In my opinion maybe to depended, if something breaks in the plugin or in a combination with Domoticz, then I could potentially have an issue for my whole house automation. So maybe there is a alternative to integrate it with Domoticz, better find out now maybe ;)
Also the Shelly Plus is available and the new valve is coming, which I like but I don't know if the plugin will ever support those. So for me, ongoing development on the plugin is important because because of this. I am not quite sure if there is still development on this plugin?
hoeby
Posts: 531
Joined: Saturday 02 June 2018 11:05
Target OS: Raspberry Pi / ODroid
Domoticz version: V2022.1
Location: Echt, Netherlands
Contact:

Re: Python Plugin: Shelly MQTT

Post by hoeby »

CronoS wrote: Tuesday 07 December 2021 20:45 So for me, ongoing development on the plugin is important because of this.
For me this is the reason to not use plugins, because then you will be dependent on the developers of this plugin.
For this reason, i use nodered and make flows. When i started with it, i thoughed is this the best way. Now i think, yes it is.
When you have the flows and information. Then it will be getting easier and easier to extend the flow.
By doing this, you will not be dependent on the plugin, you have controll in your own hands.

I don't have much shelly devices, but more zigbee devices.
In the past i used zigbee2mqtt, but also this i stopped and transfered to sonoff tasmota zigbee.
For zigbee i will be dependent from the firmware for the zigbee coordinator. But i will try to keep this to a minimum.

This is a small flow i use for the shelly 2.5. To give you an idea
shelly.png
shelly.png (59.67 KiB) Viewed 2009 times
Thin-client --> Docker Domoticz main environment
Pi3A+ --> Google home (GAssistPi)
Pi3B+ --> Docker (P1monitor, Domoticz test environment, Ubiquity controller)
Post Reply

Who is online

Users browsing this forum: No registered users and 1 guest