Interest in Next-gen Shelly Devices

Posted on
Sat Feb 05, 2022 9:33 am
aaronlionsheep offline
Posts: 260
Joined: Feb 24, 2019
Location: Virginia, USA

Interest in Next-gen Shelly Devices

Hi Shelly users! :D

I’m pleased that ShellyMQTT has been reliable with the original generation of Shelly devices.

Now that there seems to be a good amount of new devices being released, I think it would be worthwhile to support the new API that these devices use. ShellyMQTT would implement the new protocol over MQTT to stick with the theme of the plugin.

If anyone is interested, please reply with any new devices you have and would be willing to validate.

Thanks,
Aaron

Posted on
Sat Feb 05, 2022 9:39 am
CliveS offline
Posts: 770
Joined: Jan 10, 2016
Location: Medomsley, County Durham, UK

Re: Interest in Next-gen Shelly Devices

I'm in :)

Shelly Plus 1
Shelly Plus 1PM
Shelly Pro 4PM

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
Sat Feb 05, 2022 11:09 am
FlyingDiver offline
User avatar
Posts: 7215
Joined: Jun 07, 2014
Location: Southwest Florida, USA

Re: Interest in Next-gen Shelly Devices

What's the difference in the new protocol? Link?

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

Posted on
Sat Feb 05, 2022 11:17 am
CliveS offline
Posts: 770
Joined: Jan 10, 2016
Location: Medomsley, County Durham, UK

Re: Interest in Next-gen Shelly Devices

The difference is massive comparing the Original over Next Generation

Gen1 (original) https://shelly-api-docs.shelly.cloud/gen1/#shelly-family-overview

Gen2 (NG) https://shelly-api-docs.shelly.cloud/gen2/

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
Sat Feb 05, 2022 4:33 pm
tazswe offline
Posts: 211
Joined: Mar 13, 2017
Location: Sweden

Re: Interest in Next-gen Shelly Devices

Great news.

I have a Shelly Plus 1 and a Shelly Plus 1PM.

Have them both connected via Node Red but would appreciate to have them on the Shellymqtt like my other shellies

Will also preorder some Shelly Plus I4.


Sent from my iPad with Tapatalk

Posted on
Sun Feb 06, 2022 1:55 am
Colly offline
Posts: 535
Joined: Jan 16, 2016
Location: Ireland

Re: Interest in Next-gen Shelly Devices

Shelly Pro 4PM ready to go. Planning on adding some i4’s also.

Posted on
Tue Mar 08, 2022 2:52 pm
tazswe offline
Posts: 211
Joined: Mar 13, 2017
Location: Sweden

Re: Interest in Next-gen Shelly Devices

Hi Aaron,

Hope that the progress with the new plugin is going by schedule.

Received the following today that can be tested.
Shelly Plus I4
Shelly Plus 2PM


Sent from my iPad with Tapatalk

Posted on
Tue Mar 08, 2022 4:12 pm
aaronlionsheep offline
Posts: 260
Joined: Feb 24, 2019
Location: Virginia, USA

Re: Interest in Next-gen Shelly Devices

tazswe wrote:
Hi Aaron,

Hope that the progress with the new plugin is going by schedule.

Received the following today that can be tested.
Shelly Plus I4
Shelly Plus 2PM


Sent from my iPad with Tapatalk


Hi tazswe,

I am waiting to get my hands on a next-gen device before developing for the new API. This new API is very different than the original Shelly API, so it will be a lot easier to test against a real device during development. I have an order in with Shelly USA for a Shelly Plus 1, but it seems they have issues with stock over here. It may be time for a follow-up email...

Once I get the first next-gen Shelly device supported, the other devices should be very quick and easy to add. Especially since it seems like you guys have most of the devices and can validate support.

Posted on
Fri Apr 22, 2022 3:01 pm
aaronlionsheep offline
Posts: 260
Joined: Feb 24, 2019
Location: Virginia, USA

Re: Interest in Next-gen Shelly Devices

I thought I should provide a small update since it has been a while. I did eventually receive my Shelly Plus1 a few weeks ago and I have been making some nice progress.

I am going to try to have an alpha version of the plugin ready to test this weekend that will have some basic support for the Shelly Plus1. You can probably use any Shelly Plus/Pro device as a Plus1 in Indigo to test, but it will just use the first channel of relays and inputs.

One thing I have come to realize is that some features were lost in the new API. For example, new Shelly devices have no announcement feature. This means the plugin can't listen for new devices like before and make device creation easier. I have some ideas to try and mimic that functionality, but we'll see how that goes...

I am planning to get all Shelly NG devices supported (at least their basic functionality) with Python 2. I don't want to tie support of the newest devices to the latest version of Indigo by migrating the plugin to Python3 at the same time.

Thanks,
Aaron

Posted on
Sat Apr 30, 2022 10:56 pm
aaronlionsheep offline
Posts: 260
Joined: Feb 24, 2019
Location: Virginia, USA

Re: Interest in Next-gen Shelly Devices

Colly, Clive, tazswe, and all - I think it is time! These new devices have such a different protocol that I decided to add their support in a completely separate plugin. The main reason for this is the new devices are component-based and have a very structured API. I really wanted to use the Device Factory pattern in Indigo, but there doesn't seem to be a great way to have a Device Factory AND separate devices. It was easier to make a new plugin that uses this Device Factory pattern and keep ShellyMQTT as-is for the original devices. I've decided to call this new plugin "ShellyNGMQTT" for Shelly Next-Gen MQTT. I will request a new sub-forum for the plugin and migrate this thread over to it, so please keep all ShellyNGMQTT discussion/issues in this thread.

What will be new/possible:
  • Fully configurable devices from within Indigo (no need for the Web UI after connecting it to MQTT and WiFi)
  • Even faster and more consistent device support with this component-based system
  • Less manual device creation (sub-devices are created for you now)

What is currently missing:
  • Device announcement :| - old shelly devices all announce themselves on shellies/announce and the plugin monitored this topic to make device creation easier by pulling in the topic root. The new API does not have anything like this (yet?)

What will be coming for the plugin (not in this first alpha build):
  • Updating a device from Indigo
  • Changing a device configuration (from relay to roller and vice versa)
  • Only the System, Switch, and Input components are configurable from Indigo. BLE, WiFi, and Ethernet will come shortly if you all like how it currently works.
  • Only the Shelly Plus 1 and Shelly Plus I4 are shown in the device menu. If anyone as a PM device then I will start with that model for the power features. The remaining devices should be a breeze.
  • Better Indigo device types for the main device models. They are all currently sensors in order to enable the status request button. I will try using the on/off value to reflect the online status of each device.
  • More device data in the statues (anything I missed?)

Alpha build requirements:
  1. Update ShellyMQTT to v0.7.3 for a compatibility bug fix (plugin store or GitHub). Prior versions tried to consume ALL MQTT messages and did not play well with other plugins. https://github.com/AaronLionsheep/Shell ... /tag/0.7.3
  2. Change the MQTT prefix for NG devices to the pattern: "shellies-ng/shellyplus1-macaddresshere". In the Web UI: Networks->MQTT-> MQTT Prefix
  3. Create a new message type trigger of "shellies-ng" matching on "shellies-ng/*" to separate shelly and shelly-ng message between ShellyMQTT and ShellyNGMQTT

ShellyNGMQTT v0.1.0: https://github.com/AaronLionsheep/Shell ... /tag/0.1.0

What to test:
  • The Shelly Plus 1 should be fully functional (input and output)
  • The Shelly Plus I4 should be fully functional (I don't actually have one)
  • Try making configuration changes to the System settings and Switch/Input settings

I did have someone from Shelly US reach out (thanks Jay for putting us in touch). It sounds like Shelly had some inquiries from Insteon customer following the shutdown of Insteon. I believe I should be getting a few of the Plus and Pro models to validate the plugin with, and maybe some insider information on upcoming changes to the API. :D

Here are some sneak previews of what the plugin looks like:

Device Factory UI.png
Creating a device with the Device Factory (just select the model and the MQTT information)
Device Factory UI.png (32.34 KiB) Viewed 2978 times

Shelly Plus 1 Device Group.png
What a "Shelly Plus 1" device group looks like
Shelly Plus 1 Device Group.png (38.91 KiB) Viewed 2978 times

Shelly Plus I4 Device Group.png
What a "Shelly Plus I4" device group looks like
Shelly Plus I4 Device Group.png (37.66 KiB) Viewed 2978 times

System Component Configuration.png
System configuration UI for all main devices
System Component Configuration.png (72.65 KiB) Viewed 2978 times

Switch Component Configuration.png
Switch configuration UI
Switch Component Configuration.png (108.96 KiB) Viewed 2978 times

Input Component Configuration.png
Input configuration UI
Input Component Configuration.png (38.84 KiB) Viewed 2978 times

Posted on
Sun May 01, 2022 4:11 am
CliveS offline
Posts: 770
Joined: Jan 10, 2016
Location: Medomsley, County Durham, UK

Re: Interest in Next-gen Shelly Devices

Updated ShellyMQTT to v0.7.2 and now getting

Code: Select all
   ShellyMQTT Error                Error in plugin execution ServerReplacedElem:

Traceback (most recent call last):
  File "plugin.py", line 673, in triggerUpdated
ValueError: list.remove(x): x not in list



I opened my shellies trigger to compare with the NG version, hit save and the above error. Also happens if I duplicate and try and save it

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
Sun May 01, 2022 7:15 am
aaronlionsheep offline
Posts: 260
Joined: Feb 24, 2019
Location: Virginia, USA

Re: Interest in Next-gen Shelly Devices

CliveS wrote:
Updated ShellyMQTT to v0.7.2 and now getting

Code: Select all
   ShellyMQTT Error                Error in plugin execution ServerReplacedElem:

Traceback (most recent call last):
  File "plugin.py", line 673, in triggerUpdated
ValueError: list.remove(x): x not in list



I opened my shellies trigger to compare with the NG version, hit save and the above error. Also happens if I duplicate and try and save it


Ah I thought I was done with those trigger bugs. Please try the latest for 0.7.3: https://github.com/AaronLionsheep/Shell ... /tag/0.7.3

Posted on
Sun May 01, 2022 7:36 am
CliveS offline
Posts: 770
Joined: Jan 10, 2016
Location: Medomsley, County Durham, UK

Re: Interest in Next-gen Shelly Devices

That fixed it :)

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
Sun May 01, 2022 8:56 am
Colly offline
Posts: 535
Joined: Jan 16, 2016
Location: Ireland

Re: Interest in Next-gen Shelly Devices

Not having any joy with this yet using an i4... It's probably me!
For cleanliness I created a new broker for NG devices.
My prefix is: shellies-ng/shellyplusi4-1921681134
New trigger seems to be working as I get confirmation in the log, yet my i4 device is not connecting.
Any suggestions?
Attachments
Screenshot 2022-05-01 at 15.52.42.png
Screenshot 2022-05-01 at 15.52.42.png (44.58 KiB) Viewed 2918 times

Posted on
Sun May 01, 2022 9:03 am
aaronlionsheep offline
Posts: 260
Joined: Feb 24, 2019
Location: Virginia, USA

Re: Interest in Next-gen Shelly Devices

Colly wrote:
Not having any joy with this yet using an i4... It's probably me!
For cleanliness I created a new broker for NG devices.
My prefix is: shellies-ng/shellyplusi4-1921681134
New trigger seems to be working as I get confirmation in the log, yet my i4 device is not connecting.
Any suggestions?


Ah, no it is not you. A good portion of the main I4 device code was left out (maybe I was up too late). I will have that added back shortly.

Who is online

Users browsing this forum: No registered users and 0 guests