Python Plugin: Shelly MQTT

Python and python framework

Moderator: leecollings

snellejellep
Posts: 241
Joined: Tuesday 16 May 2017 13:05
Target OS: Raspberry Pi / ODroid
Domoticz version: 2020.2
Location: The Neterlands
Contact:

Re: Python Plugin: Shelly MQTT

Post by snellejellep »

i created a video about this plugin using the dimmer.
you can check it out over here: https://www.youtube.com/watch?v=VvErOFB_fKI
raspberry pi | xiaomi vacuum | yeelight | philips hue | zwave | ubiquiti unifi | harmony | sonoff | zigbee2mqtt | https://www.youtube.com/channel/UC2Zidl ... m1OLuNldfQ
djac
Posts: 28
Joined: Tuesday 24 October 2017 9:41
Target OS: Raspberry Pi / ODroid
Domoticz version:
Contact:

Re: Python Plugin: Shelly MQTT

Post by djac »

I have an issue trying to install this, I have the MQTT part working but have an issue with Python.

From command line python3 -v gives Python 3.4.2 as result, but in Domoticz about I see this:
Version: 4.10717
Build Hash: b38b49e5
Compile Date: 2019-05-09 13:04:08
dzVents Version: 2.4.19
Python Version: None

I have also installed 3.5.2 in~/domoticz/plugins/Python-3.5.2 , but it doesn't appear anywhere.

Any suggestions please?

Thanks
Domoticz on Rpi, Z-wave, Hue with Philips and Ikea bulbs
alanf
Posts: 4
Joined: Tuesday 03 September 2019 20:14
Target OS: Raspberry Pi / ODroid
Domoticz version:
Contact:

Re: Python Plugin: Shelly MQTT

Post by alanf »

When I was trying to get the Shelly MQTT working I came across this: https://www.domoticz.com/forum/viewtopi ... 2&start=20

What worked for me on Pi : Raspbian GNU/Linux 9 (stretch): the build already includes Python 3.5.3 (reported by python3 -V), but it needs libpython3.5-dev, my cut and paste notes from command line at the time have:

Code: Select all

cd domoticz/plugins
git clone https://github.com/enesbcs/Shelly_MQTT
cd Shelly_MQTT/
chmod +x plugin.py
chmod +x mqtt.py
sudo apt-get install libpython3.5-dev
sudo systemctl restart domoticz.service
Then restart Domoticz and check the log, it should include lines:

Code: Select all

[timestamp]Status: PluginSystem: Started, Python version '3.5.3'. 
... and a couple of seconds later
[timestamp]Status: Python EventSystem: Initalizing event module. 
[timestamp]Status: EventSystem: Started 
[timestamp]Status: EventSystem: Queue thread started... 
And Domoticz "About" reports:

Code: Select all

Version: 4.10717
Build Hash: b38b49e5
Compile Date: 2019-05-09 12:04:08
dzVents Version: 2.4.19
Python Version: 3.5.3 (default, Sep 27 2018, 17:25:39) [GCC 6.3.0 20170516]
djac
Posts: 28
Joined: Tuesday 24 October 2017 9:41
Target OS: Raspberry Pi / ODroid
Domoticz version:
Contact:

Re: Python Plugin: Shelly MQTT

Post by djac »

Thanks, I now have 3.5.2 and ShellyMQTT shows up in the list.

I am planning to use Shelly 2 LED, have anyone tried this with the plugin?
Domoticz on Rpi, Z-wave, Hue with Philips and Ikea bulbs
SwordFish
Posts: 278
Joined: Sunday 14 December 2014 12:28
Target OS: Raspberry Pi / ODroid
Domoticz version: V4.11375
Contact:

Re: Python Plugin: Shelly MQTT

Post by SwordFish »

First of all thanks for this great plug-in, i have several shelly's installed and they are working great with domoticz.
Now i have 4 shelly dimmers installed and in the shelly app i see the consumption of the lights but in the plug-in this is not visible. Is this meaning that the consumption is not implanted or do i miss something?
snellejellep
Posts: 241
Joined: Tuesday 16 May 2017 13:05
Target OS: Raspberry Pi / ODroid
Domoticz version: 2020.2
Location: The Neterlands
Contact:

Re: Python Plugin: Shelly MQTT

Post by snellejellep »

SwordFish wrote: Monday 09 December 2019 19:17 First of all thanks for this great plug-in, i have several shelly's installed and they are working great with domoticz.
Now i have 4 shelly dimmers installed and in the shelly app i see the consumption of the lights but in the plug-in this is not visible. Is this meaning that the consumption is not implanted or do i miss something?
the implementation of the dimmers is still in beta. it was added by a user but not yet verified by the author who is still waiting on his.
https://github.com/enesbcs/Shelly_MQTT/issues/31
raspberry pi | xiaomi vacuum | yeelight | philips hue | zwave | ubiquiti unifi | harmony | sonoff | zigbee2mqtt | https://www.youtube.com/channel/UC2Zidl ... m1OLuNldfQ
SwordFish
Posts: 278
Joined: Sunday 14 December 2014 12:28
Target OS: Raspberry Pi / ODroid
Domoticz version: V4.11375
Contact:

Re: Python Plugin: Shelly MQTT

Post by SwordFish »

Thanks for the reply
BuderKjell
Posts: 12
Joined: Monday 11 January 2016 19:21
Target OS: Raspberry Pi / ODroid
Domoticz version: 2023.1
Location: Stockholm Sweden
Contact:

Re: Python Plugin: Shelly MQTT

Post by BuderKjell »

Domoticz 4.10717
Raspberry Pi
Shelly plugin 0.3.9
Update: Solved.
First visit to The "summer house" för several weeks, updated the Shelly plugin and missed checking the "Use Power box".


Hi, have two Domoticz installations, 300 km apart. At my home I have a working installation of Shelly plugin, Several Shellies installed. With 1PM and Plug S I can monitor energy and use Utility in Blockly.
At my "summer house" where I am right now I have a similar installation. The first 1PM added can be found under Swithes and under Utility.
The 1PM I added yesterday show upp under Switches as device and as a button but nothing under Utility. In the log I found correct info:
2019-12-11 13:26:12.286 (ShellyMQTT) MQTT message: shellies/shelly1pm-765DFD/relay/0 on
2019-12-11 13:26:12.286 (ShellyMQTT) MQTT message: shellies/shelly1pm-765DFD/input/0 0
2019-12-11 13:26:12.287 (ShellyMQTT) MQTT message: shellies/shelly1pm-765DFD/relay/0/power 567.63
2019-12-11 13:26:12.287 (ShellyMQTT) MQTT message: shellies/shelly1pm-765DFD/relay/0/energy 47595
2019-12-11 13:26:12.288 (ShellyMQTT) MQTT message: shellies/shelly1pm-765DFD/temperature 23.77
2019-12-11 13:26:12.288 (VP-765DFD-temp) Updating device from 0:'23.88' to have values 0:'23.77'.
2019-12-11 13:26:12.296 (ShellyMQTT) MQTT message: shellies/shelly1pm-765DFD/temperature_f 74.78
2019-12-11 13:26:12.296 (ShellyMQTT) MQTT message: shellies/shelly1pm-765DFD/overtemperature 0

I am going back home tomorrow and will not visit this place until end of January.
Need to follow up the energy consumption of my heat pump.
Any hints?


Any hints.
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 »

BuderKjell wrote: Wednesday 11 December 2019 13:31 The 1PM I added yesterday show upp under Switches as device and as a button but nothing under Utility. In the log I found correct info:
2019-12-11 13:26:12.286 (ShellyMQTT) MQTT message: shellies/shelly1pm-765DFD/relay/0 on
2019-12-11 13:26:12.286 (ShellyMQTT) MQTT message: shellies/shelly1pm-765DFD/input/0 0
2019-12-11 13:26:12.287 (ShellyMQTT) MQTT message: shellies/shelly1pm-765DFD/relay/0/power 567.63
2019-12-11 13:26:12.287 (ShellyMQTT) MQTT message: shellies/shelly1pm-765DFD/relay/0/energy 47595
2019-12-11 13:26:12.288 (ShellyMQTT) MQTT message: shellies/shelly1pm-765DFD/temperature 23.77
2019-12-11 13:26:12.288 (VP-765DFD-temp) Updating device from 0:'23.88' to have values 0:'23.77'.
2019-12-11 13:26:12.296 (ShellyMQTT) MQTT message: shellies/shelly1pm-765DFD/temperature_f 74.78
2019-12-11 13:26:12.296 (ShellyMQTT) MQTT message: shellies/shelly1pm-765DFD/overtemperature 0

Any hints?
I guess that automatic device creation for "shelly1pm-765DFD-0-energy" failed, and if the Domoticz device did not exist, plugin will be unable to update it with values..
If autolearn already enabled at Domoticz settings and power usage enabled at ShellyMQTT settings, than for last resort, you can try to delete some devices and Domoticz shelly hardware. Than readd and reconnect them to autolearn everything again.
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 »

mozo78 wrote: Sunday 01 December 2019 21:29 Hi,Yes implemented it but not properly. It is look like a Shelly 2. With a switch, two voltage measuring (I have only one clip installed), but without Energy and consumption.
I've already requested a sample device from Allterco for testing&implementing but still not arrived, i wont beg for it, honestly i do not need that and not important to me. Every Shelly device i've got is supported.
mozo78 wrote: Sunday 01 December 2019 21:29 2019-12-01 15:48:54.154 Error: dzVents: Error: (2.5.1) Discarding device. No last update info found: {["data"]={["icon"]="current",
I do not think it is a Shelly plugin related error.
https://github.com/domoticz/domoticz/issues/3676
At least i hope that Domoticz engine handles last update time when the plugin calls "Devices[iUnit].Update()" if not than this error has to be shown on every shelly device. I propose to simply delete "shellyem-B9F3F7-1-voltage" device from Domoticz.
josemi
Posts: 31
Joined: Thursday 08 March 2018 16:48
Target OS: Raspberry Pi / ODroid
Domoticz version:
Contact:

Re: Python Plugin: Shelly MQTT

Post by josemi »

Hi
Does anybody know if a Shelly 2.5 working as roller must create a Long Push device in domoticz?
Derik
Posts: 1601
Joined: Friday 18 October 2013 23:33
Target OS: Raspberry Pi / ODroid
Domoticz version: BETA
Location: Arnhem/Nijmegen Nederland
Contact:

Re: Python Plugin: Shelly MQTT

Post by Derik »

Does some one have the power reading working with MQTT?
Xu4: Beta Extreme antenna RFXcomE,WU Fi Ping ip P1 Gen5 PVOutput Harmony HUE SolarmanPv OTG Winddelen Alive ESP Buienradar MySensors WOL Winddelen counting RPi: Beta SMAspot RFlinkTest Domoticz ...Different backups
salvacalatayud
Posts: 112
Joined: Monday 26 June 2017 21:16
Target OS: Raspberry Pi / ODroid
Domoticz version: beta
Location: Spain
Contact:

Re: Python Plugin: Shelly MQTT

Post by salvacalatayud »

Derik wrote:Does some one have the power reading working with MQTT?
Yes, with shelly 2.5

Enviado desde mi Mi A2 mediante Tapatalk

Derik
Posts: 1601
Joined: Friday 18 October 2013 23:33
Target OS: Raspberry Pi / ODroid
Domoticz version: BETA
Location: Arnhem/Nijmegen Nederland
Contact:

Re: Python Plugin: Shelly MQTT

Post by Derik »

salvacalatayud wrote: Thursday 09 January 2020 12:02
Derik wrote:Does some one have the power reading working with MQTT?
Yes, with shelly 2.5

Enviado desde mi Mi A2 mediante Tapatalk
Perhaps how?
Without other flasing software?


Or?
Xu4: Beta Extreme antenna RFXcomE,WU Fi Ping ip P1 Gen5 PVOutput Harmony HUE SolarmanPv OTG Winddelen Alive ESP Buienradar MySensors WOL Winddelen counting RPi: Beta SMAspot RFlinkTest Domoticz ...Different backups
salvacalatayud
Posts: 112
Joined: Monday 26 June 2017 21:16
Target OS: Raspberry Pi / ODroid
Domoticz version: beta
Location: Spain
Contact:

Re: Python Plugin: Shelly MQTT

Post by salvacalatayud »

Derik wrote:
salvacalatayud wrote: Thursday 09 January 2020 12:02
Derik wrote:Does some one have the power reading working with MQTT?
Yes, with shelly 2.5

Enviado desde mi Mi A2 mediante Tapatalk
Perhaps how?
Without other flasing software?


Or?
Yes, without doing anything, it appear s as a new device when detected by the plugin

Enviado desde mi Mi A2 mediante Tapatalk

karlzre
Posts: 26
Joined: Sunday 06 August 2017 18:48
Target OS: -
Domoticz version:
Contact:

Re: Python Plugin: Shelly MQTT

Post by karlzre »

Hi,

I just installed 2 Shelly dimmer, one of teh 2 is working perfectly, the second can't dimm, it think it's DOA, as i can't dimm with the buttonr or with the app also.
I already open a ticket with SHelly.

but i din't get the consumption back to domoticz.
I get the temp.

Any idea how i can get the consumption back ?
karlzre
Posts: 26
Joined: Sunday 06 August 2017 18:48
Target OS: -
Domoticz version:
Contact:

Re: Python Plugin: Shelly MQTT

Post by karlzre »

Derik wrote:
salvacalatayud wrote: ↑Thursday 09 January 2020 13:02
Derik wrote:
Does some one have the power reading working with MQTT?
Yes, with shelly 2.5

Enviado desde mi Mi A2 mediante Tapatalk
Perhaps how?
Without other flasing software?


Or?
Yes, without doing anything, it appear s as a new device when detected by the plugin

Enviado desde mi Mi A2 mediante Tapatalk
I just saw that you have to enable it in the plugin, did you ?

I just did it, but can't see any new device yet.
bing69
Posts: 139
Joined: Thursday 05 June 2014 10:55
Target OS: Raspberry Pi / ODroid
Domoticz version: Beta
Location: 's-Hertogenbosch, NL
Contact:

Re: Python Plugin: Shelly MQTT

Post by bing69 »

Anyone have an idea? The zigbee2mqtt lamp does work, it also works via MQTT.
However, I cannot manage the Shelly's, but they do read. Both the status of the switch and, for example, I operate the shelly via Homebridge as well as the temperature being polled ...
bing69
Posts: 139
Joined: Thursday 05 June 2014 10:55
Target OS: Raspberry Pi / ODroid
Domoticz version: Beta
Location: 's-Hertogenbosch, NL
Contact:

Re: Python Plugin: Shelly MQTT

Post by bing69 »

some extra information:

I did after a crash a whole new installation with these steps:
After these steps i get a switch, when I switch it appears in the log file that I switch but it does not switch. However, when I switch the same switch via Homebridge, the status of the switch changes in Domoticz.

---------------------
2020-01-26 10:24:28.069 Status: EventSystem: Queue thread started...
2020-01-26 10:24:28.162 Status: PluginSystem: Entering work loop.
2020-01-26 10:24:28.993 Status: MQTT: Connecting to localhost:1883
2020-01-26 10:24:29.194 Status: MQTT: connected to: localhost:1883
2020-01-26 10:24:29.395 Status: MQTT: Subscribed
2020-01-26 10:25:58.967 Status: (Shelly) Started.
2020-01-26 10:25:59.355 (Shelly) Connected to MQTT Server: 127.0.0.1:1883
2020-01-26 10:25:59.295 Status: (Shelly) Entering work loop.
2020-01-26 10:25:59.296 Status: (Shelly) Initialized version 0.4.0
2020-01-26 10:26:32.232 Status: New sensors allowed for 5 minutes...
2020-01-26 10:29:04.170 Status: User: Admin initiated a switch command (1/Shelly - reserve 7A339C-0/Off)
2020-01-26 10:29:48.756 Status: EventSystem: reset all device statuses...
2020-01-26 10:29:57.583 Status: User: Admin initiated a switch command (1/Shelly - reserve 7A339C-0/Off)
2020-01-26 10:30:18.577 Status: User: Admin initiated a switch command (1/Shelly - reserve 7A339C-0/On)
2020-01-26 10:31:28.590 Status: User: Admin initiated a switch command (1/Shelly - reserve 7A339C-0/On)
------------------------
INSTALL

Node.js
curl -sL https://deb.nodesource.com/setup_10.x — Node.js 10 LTS "Dubnium" | sudo bash -
sudo apt-get install -y nodejs

Kontrole
Node -v
Npm -v

Install Domoticz
https://www.domoticz.com/wiki/Raspberry_Pi

curl -L https://install.domoticz.com | bash

Update naar laatste beta

MQTT
https://www.domoticz.com/wiki/MQTT
sudo npm install -g mqtt url request

Installing Mosquitto
http://mosquitto.org/blog/2013/01/mosqu ... epository/

wget http://repo.mosquitto.org/debian/mosquitto-repo.gpg.key
sudo apt-key add mosquitto-repo.gpg.key
cd /etc/apt/sources.list.d/
sudo wget http://repo.mosquitto.org/debian/mosquitto-buster.list
sudo apt-get update
sudo apt-get install mosquitto

Installing Node-RED
https://nodered.org/docs/getting-started/raspberrypi
bash <(curl -sL https://raw.githubusercontent.com/node- ... nd-nodered)

Als service starten
sudo systemctl enable nodered.service
Stoppen als service
sudo systemctl disable nodered.service

Aanvulling Python
sudo apt install python3-dev

MQTT server installeren onder hardware
Localhost en poort 1883

ShellyMQTT - Domoticz Python Plugin
https://github.com/enesbcs/Shelly_MQTT
cd domoticz/plugins
git clone https://github.com/enesbcs/Shelly_MQTT.git
bing69
Posts: 139
Joined: Thursday 05 June 2014 10:55
Target OS: Raspberry Pi / ODroid
Domoticz version: Beta
Location: 's-Hertogenbosch, NL
Contact:

Re: Python Plugin: Shelly MQTT

Post by bing69 »

don't use the "Custom MQTT prefix:" settings and everthing works fine!!
Problem solved! :D
Post Reply

Who is online

Users browsing this forum: No registered users and 1 guest