Using Shelly devices with the MQTT plugin

Posted on
Tue Dec 31, 2019 12:18 pm
Espressomatic offline
Posts: 73
Joined: Dec 30, 2018

Using Shelly devices with the MQTT plugin

Is anyone working on a Shelly-specific plugin? MQTT has a lot of possibilities and supports a lot of messaging from a lot of very different products, but Shelly publishes details to directly integrate their products with anyone's platform. Cloud API, REST API, direct device-to-device API.

IMO, I won't ever waste my time flashing Tasmota on a SONOFF when Shelly has done things properly from the start. 4 switches arriving shortly along with some buttons to turn a pair of them into lamp-cord switches. H&T, Switch 2.5 and then their smoke detector later in the spring.

Posted on
Sat Jan 25, 2020 11:44 am
FlyingDiver offline
User avatar
Posts: 7213
Joined: Jun 07, 2014
Location: Southwest Florida, USA

Introducing the Shims plugin

Espressomatic wrote:
Is anyone working on a Shelly-specific plugin?


Why would you need one? Shelly does MQTT.

joe (aka FlyingDiver)
my plugins: http://forums.indigodomo.com/viewforum.php?f=177

Posted on
Sat Jan 25, 2020 11:52 am
FlyingDiver offline
User avatar
Posts: 7213
Joined: Jun 07, 2014
Location: Southwest Florida, USA

Re: Introducing the Shims plugin

Pre-release available - https://github.com/FlyingDiver/Indigo-S ... /tag/0.1.3

Minor changes to support Shelly native MQTT.

Changed commands sent to lower case. This is to accommodate Shelly devices that require lower case commands. See https://github.com/FlyingDiver/Indigo-Shims/issues/8 for specifics.

Tested with a Sonoff/Tasmota device and it seems to work fine.

Please test action commands from Indigo to relay type devices. Specifically on/off/toggle. That's the only thing that changed.

joe (aka FlyingDiver)
my plugins: http://forums.indigodomo.com/viewforum.php?f=177

Posted on
Wed Jan 29, 2020 12:22 pm
MarcoGT offline
Posts: 1091
Joined: Sep 11, 2014
Location: Germany

Re: Introducing the Shims plugin

Will this plugin support all Shelly devices? I bought a Shelly switch to use with Alexa, but it would be fine to integrate it with Indigo

Posted on
Wed Jan 29, 2020 12:24 pm
FlyingDiver offline
User avatar
Posts: 7213
Joined: Jun 07, 2014
Location: Southwest Florida, USA

Re: Introducing the Shims plugin

MarcoGT wrote:
Will this plugin support all Shelly devices? I bought a Shelly switch to use with Alexa, but it would be fine to integrate it with Indigo


I really don't know anything about Shelly devices, other than they (at least some) do MQTT natively. If that's true, then I would expect you can use it with my MQTT plugins. If there are issues doing so, and I can fix them without breaking something else, I'll do so.

joe (aka FlyingDiver)
my plugins: http://forums.indigodomo.com/viewforum.php?f=177

Posted on
Wed Jan 29, 2020 12:27 pm
MarcoGT offline
Posts: 1091
Joined: Sep 11, 2014
Location: Germany

Re: Introducing the Shims plugin

Ok fine.
I did a quick research and it seems that the dimmer (I bought the dimmer, not the switch) and it seems that it support MQTT

Posted on
Wed Jan 29, 2020 12:32 pm
CliveS offline
Posts: 770
Joined: Jan 10, 2016
Location: Medomsley, County Durham, UK

Re: Introducing the Shims plugin

MarcoGT wrote:
Will this plugin support all Shelly devices? I bought a Shelly switch to use with Alexa, but it would be fine to integrate it with Indigo


I have just received a Shelly 1PM and having spent all day trying to get my head around MQTT and failing so I just setup two Actions to turn on and turn off the Shelly, works fine. Also have a Shelly dimmer and so I will need to try and sort out MQTT but it just confuses me.

CliveS

Indigo 2023.2.0 : macOS Ventura 13.6.3 : Mac Mini M2 : 8‑core CPU and 10‑core GPU : 8 GB : 256GB SSD
----------------------------------------------------------------------------------
The best way to get the right answer on the Internet is not to ask a question, it's to post the wrong answer

Posted on
Wed Jan 29, 2020 12:34 pm
MarcoGT offline
Posts: 1091
Joined: Sep 11, 2014
Location: Germany

Re: Introducing the Shims plugin

How do you turn it on and off? Using MQTT?

Posted on
Wed Jan 29, 2020 12:39 pm
FlyingDiver offline
User avatar
Posts: 7213
Joined: Jun 07, 2014
Location: Southwest Florida, USA

Re: Using Shelly devices with the MQTT plugin

I moved the discussion of Shelly devices to a new thread.

joe (aka FlyingDiver)
my plugins: http://forums.indigodomo.com/viewforum.php?f=177

Posted on
Wed Jan 29, 2020 12:45 pm
FlyingDiver offline
User avatar
Posts: 7213
Joined: Jun 07, 2014
Location: Southwest Florida, USA

Re: Using Shelly devices with the MQTT plugin

Here's the docs for using MQTT with Shelly devices: https://shelly-api-docs.shelly.cloud/#reboot

joe (aka FlyingDiver)
my plugins: http://forums.indigodomo.com/viewforum.php?f=177

Posted on
Wed Jan 29, 2020 12:57 pm
siclark offline
Posts: 1960
Joined: Jun 13, 2017
Location: UK

Re: Using Shelly devices with the MQTT plugin

Really interested in the Shelly 1 and the button to give hardwired control to lamps but also remote control them.

Posted on
Wed Jan 29, 2020 1:04 pm
siclark offline
Posts: 1960
Joined: Jun 13, 2017
Location: UK

Re: Using Shelly devices with the MQTT plugin

Except it's only for their switch and not their dimmer. Two buttons on it would be perfect.

Posted on
Wed Jan 29, 2020 1:46 pm
CliveS offline
Posts: 770
Joined: Jan 10, 2016
Location: Medomsley, County Durham, UK

Re: Using Shelly devices with the MQTT plugin

MarcoGT wrote:
How do you turn it on and off? Using MQTT?


I am using 2 actions that run either On or Off python scripts

Code: Select all
# Shelly Turn Off

import urllib2
import socket

ShellyIP = "192.168.100.236"
TurnOn    = "/relay/0?turn=on"
TurnOff  = "/relay/0?turn=off"

#url_cmd = "http://" + ShellyIP + TurnOn

url_cmd = "http://" + ShellyIP + TurnOff

indigo.server.log(u"Sending to Shelly at " + ShellyIP)

try:
   response = urllib2.urlopen(url_cmd)
   response.read()
   response.close()

except socket.timeout:
   indigo.server.log(u"Timed out when talking to Shelly at " + ShellyIP)
      
except urllib2.URLError, e:
   if hasattr(e, 'reason'):
      indigo.server.log(u"Error: We failed to find Shelly at " + ShellyIP)
      indigo.server.log("Reason: " + str(e.reason))

   elif hasattr(e, 'code'):
      indigo.server.log(u"Error: The Shelly couldn\'t fulfill the request.")
      indigo.server.log("Error code: " + str(e.code))

else:
   indigo.server.log(u"Sent to Shelly at " + ShellyIP)


FlyingDiver wrote:
Here's the docs for using MQTT with Shelly devices: https://shelly-api-docs.shelly.cloud/#reboot


Yes, I have been staring at it all day but can't get my head around Mosquitto, MQTT plugin, Shims plugin and Shelly.

If anyone gets a Shelly and installs with these plugins please can you put a "how to" here (in idiot steps) and I will be eternally grateful

CliveS

Indigo 2023.2.0 : macOS Ventura 13.6.3 : Mac Mini M2 : 8‑core CPU and 10‑core GPU : 8 GB : 256GB SSD
----------------------------------------------------------------------------------
The best way to get the right answer on the Internet is not to ask a question, it's to post the wrong answer

Posted on
Wed Jan 29, 2020 2:03 pm
siclark offline
Posts: 1960
Joined: Jun 13, 2017
Location: UK

Re: Using Shelly devices with the MQTT plugin

I have always found The Hook Up to be very clear in his explanations.

https://www.youtube.com/watch?v=NjKK5ab0-Kk

As an alternative to shims, and as described in above video, you could also use nodered, which can do nodered to follow along with the above and use the indigo action nodered pluging / palette to control the devices

Posted on
Wed Jan 29, 2020 4:54 pm
CliveS offline
Posts: 770
Joined: Jan 10, 2016
Location: Medomsley, County Durham, UK

Re: Using Shelly devices with the MQTT plugin

siclark wrote:
I have always found The Hook Up to be very clear in his explanations.

https://www.youtube.com/watch?v=NjKK5ab0-Kk

As an alternative to shims, and as described in above video, you could also use nodered, which can do nodered to follow along with the above and use the indigo action nodered pluging / palette to control the devices


Yes watched that also this afternoon but it is based around Home Assistant which seems to have a very large base of Shelly support, as for Node-Red I uninstalled that a few days ago as I now have the Alexa back working with the Echo Gen 1 so did not need it, not sure I would manage to get my head around it, would rather a step by step how to for FlyingDiver's MQTT and Shims plugins, once I get one switch setup I should be fine for others.

CliveS

Indigo 2023.2.0 : macOS Ventura 13.6.3 : Mac Mini M2 : 8‑core CPU and 10‑core GPU : 8 GB : 256GB SSD
----------------------------------------------------------------------------------
The best way to get the right answer on the Internet is not to ask a question, it's to post the wrong answer

Who is online

Users browsing this forum: No registered users and 1 guest