Python Plugin: Shelly MQTT

Python and python framework

Moderator: leecollings

Post Reply
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 »

sic79 wrote: Tuesday 28 May 2019 17:28 Great plugin, but I cant seem to get on/off working on my ”Shelly Plug s”. Anyone tried to get that working?
I only has a Shelly Plug and it is working. Without a Shelly Plug S, i can not say what can be the problem.
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 »

minime wrote: Tuesday 28 May 2019 22:16 2019-05-28 22:14:02.369 (Shelly_MQTT) MQTT message: shellies/shelly1-XXXXX/longpush/0 1
Hi!
It is currently not supported but can be... i think a new Switch device has to be added for using it as input value.
In which firmware did this feature appear in?
In the meantime, I wrote to Allterco about the previously listed devices. (Shelly2LED, Shelly EM, Shelly Smoke,Shelly Plug S)
Andyyyy
Posts: 29
Joined: Saturday 13 July 2013 23:46
Target OS: -
Domoticz version:
Contact:

Re: Python Plugin: Shelly MQTT

Post by Andyyyy »

Hello lwolf !
great plugin !!!!
is it possible to add support for power and energy of my shellies 2.5 ?
in the log i get this..
Anmerkung 2019-06-03 082647.jpg
Anmerkung 2019-06-03 082647.jpg (67.13 KiB) Viewed 5188 times
but only the marked is added in domoticz

Andyyyy
minime
Posts: 18
Joined: Thursday 15 November 2018 15:41
Target OS: Raspberry Pi / ODroid
Domoticz version:
Contact:

Re: Python Plugin: Shelly MQTT

Post by minime »

lwolf wrote: Sunday 02 June 2019 9:20 Hi!
It is currently not supported but can be... i think a new Switch device has to be added for using it as input value.
In which firmware did this feature appear in?
In the meantime, I wrote to Allterco about the previously listed devices. (Shelly2LED, Shelly EM, Shelly Smoke,Shelly Plug S)
I don't know the exact firmware anymore, sorry. but I've seen it in one of the last ones. Made Updates last weekend :(
I'm running some of the shelly's in detached switch mode and want to switch different shellys with those signals. One by normal push, another one by long push.

I'm using blockly and domoticz on a pi, I've realized the scripts will be handled not as fast as expected. E.g. Light will turn of up to 20 seconds (sometimes never) after motion sensor was triggered. Do someone know how to get this behaviour fixed?
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 »

Andyyyy wrote: Monday 03 June 2019 8:28 Hello lwolf !
great plugin !!!!
is it possible to add support for power and energy of my shellies 2.5 ?
in the log i get this..
Anmerkung 2019-06-03 082647.jpg
but only the marked is added in domoticz
Andyyyy
I see. I only have Shelly 2 which energy+power output is sum of all channels. On Shelly 2.5 energy+power is per channel. I have to obtain a Shelly2.5 for testing. :) I have to modify the plugin codebase to store channel in unitname, i think.
DosN
Posts: 49
Joined: Monday 29 January 2018 7:58
Target OS: Raspberry Pi / ODroid
Domoticz version:
Contact:

Re: Python Plugin: Shelly MQTT

Post by DosN »

I have also purchased a shelly1, it looks better then the SONOFF which i have
I flashed the SONOFF with tasmota software, and now it is running fine. The SONOFF communicates with MQTT mosquitto, so i thought the Shelly 1 should run out of the box( standard supporting MQTT)
The Shelly is running , i can switch it with the app.. ( did a fireware update) I can also add MQTT server in the shelly , but i cannot find a setting where i have to but the IDX of my dummy switch .. At the sonoff i added the IDX , so the sonoff communicates through MQTT to the IDX of domoticz

But i cannot setup the shelly to communicate with domoticz. I think the shelly will communicate with MQTT, but there is no connection with MQTT and domoticz dummy switch ?

is there anybody how can explain, how it should work?. it would be nice if i do not have to flash the original firmware of the shelly
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 »

DosN wrote: Wednesday 05 June 2019 16:16 is there anybody how can explain, how it should work?. it would be nice if i do not have to flash the original firmware of the shelly
As the Shelly supports some kind of Generic MQTT you have to install the MQTT translator which converts the messages between the Shelly and Domoticz.
Read the manual about how to install it:
https://github.com/enesbcs/Shelly_MQTT

Currently supported devices is:
Shelly 1 Open Source (relay)
Shelly Plug (relay and power consumption reporting)
Shelly2 Switch (relay and roller shutter mode, positioning)
Shelly4 Pro (relay and power consumption reporting)
Shelly H&T
Shelly RGBW2
DosN
Posts: 49
Joined: Monday 29 January 2018 7:58
Target OS: Raspberry Pi / ODroid
Domoticz version:
Contact:

Re: Python Plugin: Shelly MQTT

Post by DosN »

ok looks like Shelly MQTT must be installed, and muquitto is not suitable
Sjaak66
Posts: 1
Joined: Saturday 13 April 2019 12:32
Target OS: Linux
Domoticz version:
Contact:

Re: Python Plugin: Shelly MQTT

Post by Sjaak66 »

Hi IWolf,

Simple and clean your plugin worked for my "out of the box". Shelly 1's btw!
Thank you very much for your efford .

btw using Mosquitto as the broker server.

Regards Jan
Janssuhhh
Posts: 3
Joined: Wednesday 19 June 2019 14:12
Target OS: Raspberry Pi / ODroid
Domoticz version:
Contact:

Re: Python Plugin: Shelly MQTT

Post by Janssuhhh »

Hi lwolf,

I've been using your plugin, which works well.

However, the Plug S only work one-way. They report everything perfectly (status on/off, power consumption), but they cannot be controlled.

When trying to turn the Plug S on/off, it simply doesn't work.
When digging through the code, it looks like it goes wrong at line 91 device_id = device.DeviceID.split('-')
The new Shelly Plug S use the following topic: shellyplug-s-XXXXXX, so I guess the split gets messed up there.

Is this something you can create a workaround for?

Cheers!
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 »

Janssuhhh wrote: Wednesday 19 June 2019 14:21 When digging through the code, it looks like it goes wrong at line 91 device_id = device.DeviceID.split('-')
The new Shelly Plug S use the following topic: shellyplug-s-XXXXXX, so I guess the split gets messed up there.
Thanks for debugging it, i have some idea for a workaround. i guess that its name is stored in the Domoticz database correctly, only the device_id array needs to be reconstructed.
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 »

In the recent few days there are several code fixing arrived thanks to joba-1 and damsma, which enhanced ShellyPlug-S, Shelly 2.5 and Shelly Bulb support.
Janssuhhh
Posts: 3
Joined: Wednesday 19 June 2019 14:12
Target OS: Raspberry Pi / ODroid
Domoticz version:
Contact:

Re: Python Plugin: Shelly MQTT

Post by Janssuhhh »

lwolf wrote: Friday 21 June 2019 18:06 In the recent few days there are several code fixing arrived thanks to joba-1 and damsma, which enhanced ShellyPlug-S, Shelly 2.5 and Shelly Bulb support.
Works like a charm now!
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 »

lwolf wrote: Friday 21 June 2019 18:06 In the recent few days there are several code fixing arrived thanks to joba-1 and damsma, which enhanced ShellyPlug-S, Shelly 2.5 and Shelly Bulb support.
Thank you. ;)
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
When a new Shelly 2.5 is added, it creates two blinds devices:
1. Venetian Blinds EU, which you do not have the chance to pick 'inverted'
2. Blinds Percentage, which you could change the switch type to Blinds Percentage Inverted if you need to do it.

Is there any chance to change the Venetian Blind EU to get the inverted behaviour (open/close) without changing wires? :?:

Image
salopette
Posts: 187
Joined: Tuesday 07 March 2017 21:03
Target OS: Raspberry Pi / ODroid
Domoticz version: BETA
Location: Germany
Contact:

Re: Python Plugin: Shelly MQTT

Post by salopette »

you can adjust it via the IP of the Shelly!
Attachments
sshot-2019-06-26-[1].jpg
sshot-2019-06-26-[1].jpg (108.74 KiB) Viewed 4908 times
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 »

salopette wrote: Wednesday 26 June 2019 16:49 you can adjust it via the IP of the Shelly!
But both buttons and Shelly app are ok, only it is inverted in domoticz

Could this option be?

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

Somebody says this way is good, other persons says the opposite. I am a little tired with this whole inversion thing, and i will not planning to rewrite this part again and again. This is why global inversion option created. Check or uncheck it as you wish.
Feedbacks are awaited in this github issue, if enough details and reports arrives from many users than it will be finalized someday.
https://github.com/enesbcs/Shelly_MQTT/issues/17
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 »

lwolf wrote: Friday 28 June 2019 21:21 Somebody says this way is good, other persons says the opposite. I am a little tired with this whole inversion thing, and i will not planning to rewrite this part again and again. This is why global inversion option created. Check or uncheck it as you wish.
Feedbacks are awaited in this github issue, if enough details and reports arrives from many users than it will be finalized someday.
https://github.com/enesbcs/Shelly_MQTT/issues/17
This option is what I was looking for. Thank you for implementing. I have activated it and both domoticz & shelly app are working in the same way.
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 »

josemi wrote: Saturday 29 June 2019 10:09
lwolf wrote: Friday 28 June 2019 21:21 Somebody says this way is good, other persons says the opposite. I am a little tired with this whole inversion thing, and i will not planning to rewrite this part again and again. This is why global inversion option created. Check or uncheck it as you wish.
Feedbacks are awaited in this github issue, if enough details and reports arrives from many users than it will be finalized someday.
https://github.com/enesbcs/Shelly_MQTT/issues/17
This option is what I was looking for. Thank you for implementing. I have activated it and both domoticz & shelly app are working in the same way.
Good to hear, thanks for the feedback.
Post Reply

Who is online

Users browsing this forum: No registered users and 1 guest