Indigo setup for Shelly1

Posted on
Sun Feb 12, 2023 5:35 pm
SMUSEBY offline
Posts: 511
Joined: Sep 16, 2009
Location: California

Indigo setup for Shelly1

I'm unable to operate my first Shelly device with Indigo (a Shelly1 to control a wall outlet). While there are likely multiple issues, I'm guessing that the first one is the ShellyMQTT plug-in itself: the dot to the left of it is Yellow. Further, when trying to add the device in Indigo, in "Edit device settings", "use information from device" is grayed out. I've reloaded the plug-in, it's freshly installed. (The broker is installed).
Skipping ahead, I'm confused as to topics subscripts. Reading the "Getting Started" guide, I understand that it's important to limit the number of topics (I hope to install about 30 Shelly1 controls). What is/are the topic(s) to which I should subscribe?
thank you,
Bob

Posted on
Sun Feb 12, 2023 5:52 pm
aaronlionsheep offline
Posts: 260
Joined: Feb 24, 2019
Location: Virginia, USA

Re: Indigo setup for Shelly1

Hello!

SMUSEBY wrote:
... I'm guessing that the first one is the ShellyMQTT plug-in itself: the dot to the left of it is Yellow.


Nope, that is fine. The yellow indicates the plugin is using the Indigo 2.x API instead of the 3.0 API. I have a version that will be 3.0 compatible that I'm still testing before releasing. Then, the plugin orb will turn green.

SMUSEBY wrote:
when trying to add the device in Indigo, in "Edit device settings", "use information from device" is grayed out. I've reloaded the plug-in, it's freshly installed. (The broker is installed).


That dropdown is populated from an internal list of devices, and yours is empty. When the plugin sees an announcement message from a device not in Indigo, then the announcement details go into this internal list. Then this "new" device is shown in that list to auto-fill some of the device settings.

Your shelly has not announced itself fully yet, so the plugin does not know about the device.

SMUSEBY wrote:
Skipping ahead, I'm confused as to topics subscripts. Reading the "Getting Started" guide, I understand that it's important to limit the number of topics (I hope to install about 30 Shelly1 controls). What is/are the topic(s) to which I should subscribe?


That was written at a time when the inter-plugin communication was new, and we only had a few shelly devices. I don't think you need to worry about the number of devices at this point.

I now recommend you create a single trigger that matches on shellies/# (I think this is "shellies" and then the "Any" option) and set this is a message type of "shellies". Then you only have to remember that your message type is "shellies" when creating new devices.

Here is my MQTT Connector device subscriptions. I create a subscription on "shellies/#" to capture all shelly traffic.
Screen Shot 2023-02-12 at 6.56.43 PM.png
Connector config with subscribed topic
Screen Shot 2023-02-12 at 6.56.43 PM.png (96.02 KiB) Viewed 1084 times


Then I create a single trigger that matches on shellies/# and queues all the messages with a message type of "shellies". Use the Any option instead of match with # for the wildcard.
Screen Shot 2023-02-12 at 6.53.44 PM.png
Trigger for all shelly messages
Screen Shot 2023-02-12 at 6.53.44 PM.png (89.55 KiB) Viewed 1084 times


Here is an example of the working configuration for one of my devices.
Screen Shot 2023-02-12 at 6.55.27 PM.png
Device configuration with message type
Screen Shot 2023-02-12 at 6.55.27 PM.png (166.57 KiB) Viewed 1084 times

Posted on
Tue Feb 14, 2023 4:32 pm
SMUSEBY offline
Posts: 511
Joined: Sep 16, 2009
Location: California

Re: Indigo setup for Shelly1

Thank you for your response with screenshots - which take all the guesswork out of the set up. While I still can't connect with my Shelly1 relay, I'm hopeful that I'm close.
I followed your screenshots very carefully, and there are only two differences on my setup:
In the course of detailing my setup to troubleshoot, I found the issue: on the device itself, I was using my MQTT UID/pw, not my computer UID/PW.
It works!
And in spite of that, I nevertheless have two questions:
1) for the Shelly1 relay device, I have the MAC address, whereas you have a 6 character alpha-numeric. I haven't seen any ID that looks like the one you are using (and others as well).
2) the topic subscriptions in the connector are not intuitively obvious. - in fact, not obvious at all. Can I assume that for the operation of a relay, the topic should be something that covers On/Off - or is it more complicated than that? Is there a resource that I could use to help me understand better? - say if I want to monitor a sensor?
Thanks again for your help - you've made my day.
Bob
Attachments
Screenshot 2023-02-14 at 14.28.17.png
Screenshot 2023-02-14 at 14.28.17.png (15.91 KiB) Viewed 1033 times
Last edited by SMUSEBY on Tue Feb 14, 2023 5:07 pm, edited 1 time in total.

Posted on
Tue Feb 14, 2023 5:03 pm
aaronlionsheep offline
Posts: 260
Joined: Feb 24, 2019
Location: Virginia, USA

Re: Indigo setup for Shelly1

SMUSEBY wrote:
1) In the Connector device, your address is a LAN ip, whereas mine is localhost. I don't know how that field is being populated, but presumably, it's not an issue; and


So the connector device address should be the address to connect to the broker. I have my MQTT Broker running on a separate server on my network, so I use the LAN address (192.168.100.12) for the server where the Broker is running. If you have your broker running on the same machine as the Indigo Server, then localhost would be appropriate I think.

Do you mind sharing what broker you are using?

SMUSEBY wrote:
2) for the Shelly1 relay device, I have the MAC address, whereas you have a 6 character alpha-numeric. The screenshot attached shows the devices Mac address and a long numeric. I haven't seen any ID that looks like the one you are using (and others as well).


Unless I misunderstood, I don't see a screenshot attached to your post. The "MQTT Topic Root" is the MQTT prefix used by your device. I know the older devices only used the last 6 characters of it's Mac address, and the newer devices use the full address.

I think we could make this process a bit easier if we look at your MQTT traffic to confirm a few things. If you don't already have the MQTT Explorer program, it is a pretty good tool to interact with MQTT messages.

http://mqtt-explorer.com - There is a download section if you scroll down. I recommend you use MQTT Explorer to connect to your broker, and then we can confirm your Shelly is actually connecting to the broker and confirm the device's address. You'll eventually see all the MQTT traffic and your Shelly should show up as publishing some data periodically and when you interact with it.

Posted on
Tue Feb 14, 2023 5:59 pm
SMUSEBY offline
Posts: 511
Joined: Sep 16, 2009
Location: California

Re: Indigo setup for Shelly1

I posted a reply to this thread 2 days ago, posing questions when I had been unable to connect Indigo to my relay, including the question about the local host vs ip address. I didn't see the post on the thread, so I assumed I didn't press 'submit', the second post (today) had different questions - so while the first message was before I was able to get it running today; today's message questions were to educate me.
Do you mind sharing what broker you are using?

If I understand your question as to which broker I'm using, the Type - MQTT Connector, and Model: MQTT Broker.copied verbatim from your screen shots. - or is there something else?
I have no idea why you didn't see the attachment - but no need - it just showed the Mac address, which I now understand is what I need to use.
I'm happy to download mqtt-explorer, but I hope you understand that as of today, Indigo is able to control my relay. My questions today were to educate me as I'm uncomfortable not having a better (as in some) understanding of how this technology is managed.
I suspect I'll be back with, 'how do I connect the mqtt-explorer?'.
Bob

Posted on
Tue Feb 14, 2023 6:18 pm
aaronlionsheep offline
Posts: 260
Joined: Feb 24, 2019
Location: Virginia, USA

Re: Indigo setup for Shelly1

SMUSEBY wrote:
I posted a reply to this thread 2 days ago, posing questions when I had been unable to connect Indigo to my relay, including the question about the local host vs ip address. I didn't see the post on the thread, so I assumed I didn't press 'submit', the second post (today) had different questions - so while the first message was before I was able to get it running today; today's message questions were to educate me.
Do you mind sharing what broker you are using?

If I understand your question as to which broker I'm using, the Type - MQTT Connector, and Model: MQTT Broker.copied verbatim from your screen shots. - or is there something else?
I have no idea why you didn't see the attachment - but no need - it just showed the Mac address, which I now understand is what I need to use.
I'm happy to download mqtt-explorer, but I hope you understand that as of today, Indigo is able to control my relay. My questions today were to educate me as I'm uncomfortable not having a better (as in some) understanding of how this technology is managed.
I suspect I'll be back with, 'how do I connect the mqtt-explorer?'.
Bob


Ah fantastic that you got everything working now. Then next 29 devices should be a breeze!

I think the only outstanding question you have now is regarding clarity on the topic subscriptions on the broker, correct? I agree it could be confusing, so let me see if I can explain what it is doing.

The MQTT Connector plugin is a CLIENT, not a broker. It connects to a broker and can publish/subscribe to the broker. A broker would be something like ApacheMQ, Mosquitto, or FlyingDiver's MQTT Broker Plugin (runs a broker implemented in Python directly in the plugin).

The MQTT Connector plugin acts as a client for all of Indigo and allows you to subscribe to any mqtt topics. In this case we recommend you make a single topic subscription, "shellies/#", that will ensure ALL shelly messages are captured into Indigo. So at this moment: Shelly traffic makes it into the MQTT Connector plugin, but nothing happens with the messages.

The next thing you did was create an "MQTT Connector Event" trigger of type "Topic Component Match". The connector plugin will scan every trigger and see if the topic matches what our trigger is configured for. In this case, we recommend you make a trigger that also matches on all Shelly messages with a match of "Shellies" and then "Any". This matches the wildcard subscription we did with "shellies/#". We also make sure to "Queue Message" with a message type of "shellies". What this does is add the incoming MQTT message into an internal indigo queue named "shellies". Other plugins and read from this queue and get the MQTT data without having to do all the MQTT stuff.

This is where ShellyMQTT comes in. It reads all the messages from the shellies queue and figures out which Indigo device each message is targeted at (based on the MQTT Topic Root in each device) and reads the content of each message. Each device does require you indicate which queue to read messages from, but this would just always be "shellies" if we have one message queue for all Shelly messages. (I plan to make this a dropdown in the future so don't have to remember).

Long story short: configure MQTT Connector send all Shelly message to ShellyMQTT by subscribing the MQTTConnector device to all Shelly traffic (shellies/#), and put all Shelly traffic in an Indigo message queue called "shellies" with the trigger.

Posted on
Tue Feb 14, 2023 6:49 pm
SMUSEBY offline
Posts: 511
Joined: Sep 16, 2009
Location: California

Re: Indigo setup for Shelly1

It's getting a little clearer.
The MQTT Connector plugin acts as a client for all of Indigo and allows you to subscribe to any mqtt topics. In this case we recommend you make a single topic subscription, "shellies/#", that will ensure ALL shelly messages are captured into Indigo. So at this moment: Shelly traffic makes it into the MQTT Connector plugin, but nothing happens with the messages.

Going verbatim from your screenshot, I also subscribed to "plex/#, Shellies-ng/#, and tasmotas/#. I gather those three for some other purpose. They made no sense to me.
I've installed explorer-mqtt, and can't get past the opening dialog - see attachment. But since I don't seem to be able to send attachments, I edited the MQTT Connection by giving it a name, and in host, the LAN IP address of the host indigo computer, and port 1883; and my computer user credentials. On the advanced page, I subscribed to shellies/#.
Pressing 'Save' results in the "Disconnected from server' message.
Attachments
Screenshot 2023-02-14 at 16.48.18.jpg
Screenshot 2023-02-14 at 16.48.18.jpg (147.52 KiB) Viewed 1021 times

Page 1 of 1

Who is online

Users browsing this forum: No registered users and 2 guests