Having trouble getting started

Posted on
Mon Jun 27, 2022 10:46 pm
pgershon offline
Posts: 506
Joined: Jul 10, 2004

Having trouble getting started

Not sure what I am doing wrong. I successfully installed the mosquito code through brew, as directed. I believe I have it running on a terminal session. But when I try to create a MQTT connector device in Indigo, I get lost. Trying to use my machine's IP (192.168.1.100), Port 1883 (which is what Mosquito started with) and a blank user/password. Also tried with my Mac login info. The device comes up red and "connection failed". I have a feeling the Mosquito side is not configured properly. Is there a more detail script I should follow? Thanks.

I have been using the other Shelly plugin but at this point, it is unable to handle the Shelly Plus One connectors I just purchased.

Thanks

Posted on
Tue Jun 28, 2022 12:06 am
tazswe offline
Posts: 211
Joined: Mar 13, 2017
Location: Sweden

Re: Having trouble getting started

Shelly suddenly changed how the mqtt was presented, for the plus items that was released last year, witch required a new plugin.

There is a beta plugin found here for your Shelly Plus One https://github.com/AaronLionsheep/Shell ... /0.3.0.zip

This plugin will only work with the latest PLUS Shellies and all “old” Shellies will need the plugin in the plugin shop to work.

Try the plugin in the link and if you run into trouble we will try to help you from there.

You can also download a program called mqtt explorer that is very helpful to check that your Shellies are communicating with your mqtt server. It works as soon as you have made the settings on the device ip page.

Posted on
Tue Jun 28, 2022 9:04 am
pgershon offline
Posts: 506
Joined: Jul 10, 2004

Re: Having trouble getting started

Thanks. Unfortunately the link did not fully go through - and I cant figure out the "..." in this case.

I have the MQTT Explorer loaded too. Unfortunately I am not able to connect. There is something, probably obvious, that I am missing. I am trying to connect to my host at 192.168.1.100. I am told disconnected from server. Posting screen shot. Either the server is not running or I am connecting the wrong way, or both.
Screen Shot 2022-06-28 at 11.03.30 AM.png
Screen Shot 2022-06-28 at 11.03.30 AM.png (206.72 KiB) Viewed 2689 times

To get the server running, I am using mosquito with terminal window open (screenshot attached too)
Attachments
Screen Shot 2022-06-28 at 10.58.48 AM.png
Screen Shot 2022-06-28 at 10.58.48 AM.png (257.73 KiB) Viewed 2689 times

Posted on
Tue Jun 28, 2022 9:55 am
CliveS offline
Posts: 761
Joined: Jan 10, 2016
Location: Medomsley, County Durham, UK

Re: Having trouble getting started

Add the following 2 lines to the bottom of mosquitto.conf

Code: Select all
listener 1883
allow_anonymous true

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
Tue Jun 28, 2022 10:34 am
pgershon offline
Posts: 506
Joined: Jul 10, 2004

Re: Having trouble getting started

Thanks. That got me past the roadblock. Will try to get plugin working tonight.

Posted on
Tue Jun 28, 2022 7:16 pm
aaronlionsheep offline
Posts: 260
Joined: Feb 24, 2019
Location: Virginia, USA

Re: Having trouble getting started

CliveS wrote:
Add the following 2 lines to the bottom of mosquitto.conf

Code: Select all
listener 1883
allow_anonymous true


Mosquitto made this change between versions 1.x and 2.x, but these configuration parameters revert this change back to what is needed. (allowing connections to the broker from other devices)

If you are running Indigo 2022.1, then I would suggest checking out the Broker that FlyingDiver implemented in Python. It is a broker that runs inside of the plugin, so there is less to manage. https://www.indigodomo.com/pluginstore/260/

pgershon wrote:
Thanks. Unfortunately the link did not fully go through - and I cant figure out the "..." in this case.


The download for the latest version of the plugin can be found here: https://github.com/AaronLionsheep/Shell ... /0.3.0.zip

Please note this plugin is not fully released yet, but most of the core functions are available. There are still some issues with processing power/energy information from the PM devices. If you are comfortable running the plugin while it is beta, then please let me know which devices you are using. I like to have an idea of devices that are being heavily used when introducing a new feature during testing.

(Thanks tazswe and Clive!)

Posted on
Tue Jun 28, 2022 8:26 pm
FlyingDiver offline
User avatar
Posts: 7189
Joined: Jun 07, 2014
Location: Southwest Florida, USA

Re: Having trouble getting started

If you don't want to mess with Mosquitto, the MQTT Broker plugin is back in the plugin store. It's trivial to set up. You just can't run it at the same time as Mosquitto.

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

Posted on
Wed Jun 29, 2022 10:11 pm
pgershon offline
Posts: 506
Joined: Jul 10, 2004

Re: Having trouble getting started

Thanks for the tip about the MQTT broker returning to plugin store. I have it loaded and running.

Trying the Shelly MQTT beta for the Shelly plus One. I am stuck trying to create the first device. Model and MQTT broker come up properly, but I don't know what to enter for "Base MQTT Topic" and "Message Type".

Posted on
Thu Jun 30, 2022 5:57 am
cuhouse offline
Posts: 144
Joined: Feb 21, 2007
Location: Virginia, USA

Re: Having trouble getting started

pgershon,

Take a look at Aaron's initial thread on the new Shelly NG Beta.
https://forums.indigodomo.com/viewtopic.php?f=330&t=25855#p209817

There are some posts in this same thread that may help get you going.

Jody

Indigo 2022.1.2, Big Sur v11.7.1, Dedicated late 2014 Mac Mini, PowerLinc 2413U.

Posted on
Thu Jun 30, 2022 6:42 am
tazswe offline
Posts: 211
Joined: Mar 13, 2017
Location: Sweden

Re: Having trouble getting started

You can use the wiki for the first version of the plugin.

[URL]

https://github.com/AaronLionsheep/ShellyMQTT/wiki

[/URL]


Sent from my iPad with Tapatalk

Posted on
Thu Jun 30, 2022 9:09 am
pgershon offline
Posts: 506
Joined: Jul 10, 2004

Re: Having trouble getting started

Apologize in advance for being inept...

I have loaded the MQTT Broker and I think its correct. And I created the trigger following the instructions on Aaron's Wiki. But I get stuck on the step in creating devices #4 "Click the "Discovered Devices" dropdown to see if your new device has already been discovered by the plugin. Selecting a device in this list will populate data for the Broker device and MQTT Topic Root that is outline in steps 5 and 6. Steps 5 and 6 can be skipped after selecting a device from this list."

What or where is the Discovered Devices" dropdown? I cannot find it. I have 6 active Shelly Plus One devices and I dont see any of them. Either I am looking in the wrong place, or I missed a step in trying to establish the broker.

Posted on
Thu Jun 30, 2022 10:30 am
tazswe offline
Posts: 211
Joined: Mar 13, 2017
Location: Sweden

Re: Having trouble getting started

Skip that step, it only valid for the old plugin and go directly to next step.

Select Shelly model. For example Shelly Plus 1 PM

Select the appropriate Broker device that you created earlier (The broker that your Shelly is connected to)
Select the Base MQTT Topic as discovered for your device. For example "shellies-ng/shellyplus1pm-a8032abe2af4"

Sellect message types . For example "shellies-ng"

Posted on
Thu Jun 30, 2022 10:32 am
FlyingDiver offline
User avatar
Posts: 7189
Joined: Jun 07, 2014
Location: Southwest Florida, USA

Re: Having trouble getting started

Use https://apps.apple.com/us/app/mqtt-expl ... 4828?mt=12 or https://apps.apple.com/us/app/mqttx/id1514074565?mt=12 to test the Broker and see if you're getting messages from the Shelly devices.

Don't forget you need to use the web interface on the Shelly devices to configure the Broker for them.

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

Posted on
Thu Jun 30, 2022 7:16 pm
pgershon offline
Posts: 506
Joined: Jul 10, 2004

Re: Having trouble getting started

Thanks. I will play with it more over the weekend. At least I have the device showing up on the MQTT Explorer now. That is a start. I needed to activate MQTT on the device itself through the web interface.

Posted on
Thu Jun 30, 2022 7:44 pm
aaronlionsheep offline
Posts: 260
Joined: Feb 24, 2019
Location: Virginia, USA

Re: Having trouble getting started

pgershon wrote:
Apologize in advance for being inept...

I have loaded the MQTT Broker and I think its correct. And I created the trigger following the instructions on Aaron's Wiki. But I get stuck on the step in creating devices #4 "Click the "Discovered Devices" dropdown to see if your new device has already been discovered by the plugin. Selecting a device in this list will populate data for the Broker device and MQTT Topic Root that is outline in steps 5 and 6. Steps 5 and 6 can be skipped after selecting a device from this list."

What or where is the Discovered Devices" dropdown? I cannot find it. I have 6 active Shelly Plus One devices and I dont see any of them. Either I am looking in the wrong place, or I missed a step in trying to establish the broker.


Sorry for the lack of guidance on setting up the new shelly devices.

1. The first thing to do is configure your shelly device to connect to your broker. This is done by going into the Network settings of the device though the web interface. Here is an example of how one of my devices is configured.

Note that I modified my MQTT Prefix field to be "shellies-ng/shellypro1-30c6f7847b68". It was "shellypro1-30c6f7847b68" by default, but I prepended the "shellies-ng/" to ALL of my new shelly devices. This makes the trigger creation easier.

Screen Shot 2022-06-30 at 9.10.18 PM.png
Screen Shot 2022-06-30 at 9.10.18 PM.png (523.46 KiB) Viewed 2529 times


2. Confirm the device is publishing information over MQTT using one of the MQTT applications mention in other posts. MQTT Explorer seems to be pretty popular. You can proceed if you have confirmed the device and brokerage communicating successfully.

3. Now you need to connect Indigo to the broker. This is done using FlyingDiver's MQTT Connector plugin (https://www.indigodomo.com/pluginstore/211/). Create a new MQTT Broker device in Indigo and fill in your connection details. You should see the status bulb go green to indicate that communication has been established.

Screen Shot 2022-06-30 at 9.18.44 PM.png
Screen Shot 2022-06-30 at 9.18.44 PM.png (124.64 KiB) Viewed 2529 times


4. Now we will subscribe Indigo to the topics that your devices will communicate on. I prepended my MQTT prefix with "shellies-ng/", back in step 1, and this comes into play. This allows us to create a single MQTT subscription using wildcards. It will be "shellies-ng/#", and this will subscribe to any topic beginning with "shellies-ng". The # symbol is a multi-level wildcard, so it captures topics that are multiple levels deep, such as "shellies-ng/shellypro1-30c6f7847b68/relay/0".

In the broker device you should have created previously in Indigo, go to the "Topic Subscriptions" config section. Enter "shellies-ng/#" into the "Topic to subscribe" field with a QoS level of 0. Click "Add Topic", and you should see the topic subscribed in the list at the bottom.

Screen Shot 2022-06-30 at 9.24.45 PM.png
topic subscriptions
Screen Shot 2022-06-30 at 9.24.45 PM.png (113.25 KiB) Viewed 2529 times


5. The next step is to create a trigger that will send the topic payloads to my plugin. Create a new trigger of type "MQTT Connector Event" with event "Topic Component Match". Select your broker device from the broker drop-down.
a. From the match type menu, choose "Match". Then type "shellies-ng" in the Match String text field below it. Click the Add Match button.
b. From the match type menu, choose "Any (wildcard)". Ensure the Match String field is empty. Click the Add Match button.

Check the "Queue message" check box near the bottom. Enter "shellies-ng" in the Message Type field at the bottom.

Screen Shot 2022-06-30 at 9.31.09 PM.png
trigger config
Screen Shot 2022-06-30 at 9.31.09 PM.png (169.89 KiB) Viewed 2529 times


You do not need to specify anything else in the Condition or Actions tabs of the trigger. I do suggest checking "Hide trigger executions in Event log" as the shelly devices will be very chatty and will clutter the log.

Everything you just did was a one-time thing. None of that needs to be repeated when adding new devices.

6. Create a new device with type "ShellyNGMQTT". A popup will appear where you can select the Shelly Model, MQTT Broker, Base MQTT Topic, and Message type. Select the model of the device you have and choose your broker from the broker menu. The Base MQTT topic is the MQTT prefix you entered in the device web interface. Message Type will be "shellies-ng" because all our MQTT traffic will come from the trigger we previously created.

Screen Shot 2022-06-30 at 9.37.16 PM.png
example device config
Screen Shot 2022-06-30 at 9.37.16 PM.png (94.55 KiB) Viewed 2529 times


A handful of Indigo devices will be created that represent the different components of the Shelly device (multiple inputs/outputs). The plugin currently creates devices for ALL components, but this will be configurable in the future if you do not need all components represented in Indigo.

You may have completed some of these steps already, but I figured it might help to explain the entire process.

Who is online

Users browsing this forum: No registered users and 0 guests