Configuring NG relays

Posted on
Tue Mar 28, 2023 2:05 pm
SMUSEBY offline
Posts: 511
Joined: Sep 16, 2009
Location: California

Configuring NG relays

I'm afraid I need some help. So far,
- I created the device with the access point and configured it with the LAN connection, and failed to make it work with the ShellyMQTT plugin
- I've installed the shellyngmqtt plug-in from GitHub (v 0.4.0)
- I did a factory reset of the device, and using the access point connection, obtained the LAN IP address and rebooted the device
- Created a device in Indigo - see screen shot
- Created a trigger for ShellyNGMQTT Event (but since I'm not connecting a switch, I don't think this is necessary)
- The existing trigger, using the Shelly Broker, is matching both shellies and shellies-ng topics
- The broker is subscribe to shellies-ng/# and shellies/#
I can't operate the relay. the device "46 MQTT) does not display a state, and the 46 MQTT 2 (switch) and 46 MQTT 3 (input) seem irrelevant since I don't intend to attach a switch.
I'm stuck - what am I missing?
Attachments
Screenshot 2023-03-28 at 12.56.10.png
Screenshot 2023-03-28 at 12.56.10.png (172.11 KiB) Viewed 34776 times

Posted on
Tue Mar 28, 2023 7:15 pm
aaronlionsheep offline
Posts: 260
Joined: Feb 24, 2019
Location: Virginia, USA

Re: Configuring NG relays

These devices are a little different, so their setup also deviates from the 1st gen devices.

The first difference is the devices don't publish to shellies/<device> or shellies-ng/<device> by default. They publish directly to the root topic using their device name. For organizational purposes, I manually configure my gen2 devices with a custom MQTT prefix (found in MQTT settings). I mimic the gen1 pattern and make all my gen2 devices publish under the topic of shellies-ng and it's device name.

Screen Shot 2023-03-28 at 9.06.26 PM.png
Screen Shot 2023-03-28 at 9.06.26 PM.png (56.62 KiB) Viewed 34753 times


I then create a separate trigger and message type for all "shellies-ng/#" messages (like what we do for the "shellies/#" messages.

Right now, all gen2 devices will expose all their components as devices in Indigo, even if you don't use them all. I am working on letting the user configure which components they want exposed in Indigo. In your screenshot, "46 MQTT" is the main device and it will contain all the state information for the device. "46 MQTT 2" is the switch component (the relay). "46 MQTT 3" is the input component.

Posted on
Tue Mar 28, 2023 7:54 pm
SMUSEBY offline
Posts: 511
Joined: Sep 16, 2009
Location: California

Re: Configuring NG relays

Thank you - but regrettably I need more guidance.
Device settings
Basic question: for the gen1, I made the settings using the assigned IP address. Reading the forum, I think you mentioned that the settings can me made within Indigo. I took that to mean, use the 33.1 address to assign the Mac address, get the IP address, and do the rest in Indigo.
So when I attempted to follow the screenshot and use the IP address, and rebooted, does that update Indigo? - or should I do everything with the IP address as I did for the first gen products?
The MQTT Prefix in the screenshot includes 'shellyplugus' - is that a general heading for the US - i.e., is it no longer necessary to enter the product type?
Triggers:
What is the type? MQTT Connector Event, ShellyMQTT Event, or ShellyNGMQTT Event? Both of the Event types relate to switches, so I used the first,
Two screenshots attached showing my two triggers. Notice that for the gen 1 trigger, I don't have "/#" after the shellies. - but it works.
As in my original screenshot, the device is not reporting a state, which I'm guessing has to do with the device, and not the trigger. - but I probably have the trigger wrong as well...
Attachments
Screenshot 2023-03-28 at 18.51.23.png
Screenshot 2023-03-28 at 18.51.23.png (190.42 KiB) Viewed 34748 times
Screenshot 2023-03-28 at 18.50.59.png
Screenshot 2023-03-28 at 18.50.59.png (208.16 KiB) Viewed 34748 times

Posted on
Thu Mar 30, 2023 3:56 pm
SMUSEBY offline
Posts: 511
Joined: Sep 16, 2009
Location: California

Re: Configuring NG relays

At this point, I've exhausted the information I can find. I think the problem may be identified by the device settings indigo -on the configuration / system, the Mac address and firmware fields are not being populated, suggesting to me that the connector can't hear them. I've attached both the Indigo and System pages for my device. For product name, I've tried shelly1, shellyplus1, shelly1ng, and probably a few others. The Mac address is correct.
I'm still stuck.
Attachments
Screenshot 2023-03-30 at 14.50.15.png
Screenshot 2023-03-30 at 14.50.15.png (357.66 KiB) Viewed 34716 times
Screenshot 2023-03-30 at 14.49.47.png
Screenshot 2023-03-30 at 14.49.47.png (304.58 KiB) Viewed 34716 times

Posted on
Thu Mar 30, 2023 4:27 pm
cuhouse offline
Posts: 144
Joined: Feb 21, 2007
Location: Virginia, USA

Re: Configuring NG relays

Log into your ShellyPlus1 device from your browser. Update the firmware to the latest version. Once it reboots, send screen captures of the Networks/WiFi and Networks/MQTT configuration windows.

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

Posted on
Thu Mar 30, 2023 4:33 pm
SMUSEBY offline
Posts: 511
Joined: Sep 16, 2009
Location: California

Re: Configuring NG relays

Hopefully, you're about to embarrass me. (I've tried various product names here as well. )
Thanks for taking a look at this.
Attachments
Screenshot 2023-03-30 at 15.30.31.png
Screenshot 2023-03-30 at 15.30.31.png (210.71 KiB) Viewed 34705 times
Screenshot 2023-03-30 at 15.29.56.png
Screenshot 2023-03-30 at 15.29.56.png (163.16 KiB) Viewed 34705 times

Posted on
Thu Mar 30, 2023 4:54 pm
cuhouse offline
Posts: 144
Joined: Feb 21, 2007
Location: Virginia, USA

Re: Configuring NG relays

I updated my fw on my ShellyPlus1 too just to compare. The display has changed quite a bit but my ShellyPlus1 still works as it did.

First thing I see is in your MQTT settings, I don’t see the port number? Mine is SERVER field: ip addresss of MQTT server xxx.xxx.x.x:1883

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

Posted on
Thu Mar 30, 2023 4:59 pm
cuhouse offline
Posts: 144
Joined: Feb 21, 2007
Location: Virginia, USA

Re: Configuring NG relays

Also the MQTT PREFIX field is missing the plus.

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

Posted on
Thu Mar 30, 2023 5:57 pm
SMUSEBY offline
Posts: 511
Joined: Sep 16, 2009
Location: California

Re: Configuring NG relays

Thank you - I've made the two changes you suggested:
I've changed the MQTT Prefix field to shellies-ng/shelly1plus-b8d61a885b6c. Is shelly1plus in the correct format?
Good catch on the port. I've added ';1883' to the IP for my Indigo server. No idea how it disappeared. (cockpit error, no doubt).
The device is still not connected in Indigo.
Here's another potential clue: in the Indigo Edit Device Settings, I am unable to make both the System and WiFi settings stick.
- In system, I enter the Device Name (same as in the LAN device configuration),
- or the WiFi page, I only complete the SSID, Password fields only for WiFi 1, and tick the Enable box for 'if the network is enable for use'.
- For both pages, I press 'Write Configuration' and 'Save', but when I reopen them, the fields are bland, and the MAC address: and Firmware: fields are grayed out (and blank).
Access Point is not enabled - my guess that the Access Point is only useful when using the 192.168.33.1 address, and only needs to be enabled for the initial setup.
Any more ideas?

Posted on
Thu Mar 30, 2023 6:03 pm
FlyingDiver offline
User avatar
Posts: 7216
Joined: Jun 07, 2014
Location: Southwest Florida, USA

Re: Configuring NG relays

Port should have colon ":" before the number, not semi-colon ";"

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

Posted on
Thu Mar 30, 2023 6:05 pm
SMUSEBY offline
Posts: 511
Joined: Sep 16, 2009
Location: California

Re: Configuring NG relays

I know - sloppy on the forum, correct on the device - 192.168.3.20:1883
That's not it.

Posted on
Thu Mar 30, 2023 6:14 pm
cuhouse offline
Posts: 144
Joined: Feb 21, 2007
Location: Virginia, USA

Re: Configuring NG relays

shellyplus1.png
shellyplus1.png (88.67 KiB) Viewed 34691 times

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

Posted on
Thu Mar 30, 2023 6:29 pm
SMUSEBY offline
Posts: 511
Joined: Sep 16, 2009
Location: California

Re: Configuring NG relays

Another good catch - I corrected the MQTT prefix from shelly1plus to shellyplus1 - and now, in Indigo I'm happy to report some progress: the Indigo edit device settings are sticking for both system and wifi, but the device is not connected in Indigo.
Update - I just checked again, and the System & Wifi fields are once again blank. How can that be?
This is torture.

Posted on
Thu Mar 30, 2023 6:39 pm
aaronlionsheep offline
Posts: 260
Joined: Feb 24, 2019
Location: Virginia, USA

Re: Configuring NG relays

SMUSEBY wrote:
Thank you - but regrettably I need more guidance.
Basic question: for the gen1, I made the settings using the assigned IP address. Reading the forum, I think you mentioned that the settings can me made within Indigo. I took that to mean, use the 33.1 address to assign the Mac address, get the IP address, and do the rest in Indigo.


That is the goal. almost all the shelly settings can be updated via the MQTT protocol, so as long as the device and Indigo are talking over MQTT, the config setting should be configurable from Indigo.

SMUSEBY wrote:
So when I attempted to follow the screenshot and use the IP address, and rebooted, does that update Indigo? - or should I do everything with the IP address as I did for the first gen products?


I'm not really following 100% here. When I get a new device, I power it on, connect to it's WiFi AP (go to the 192.168.33.1), and do the initial wifi and mqtt configuration from the browser.

SMUSEBY wrote:
The MQTT Prefix in the screenshot includes 'shellyplugus' - is that a general heading for the US - i.e., is it no longer necessary to enter the product type?


That's because it is a screenshot of one of my devices - a Shelly Plus Plus (US). Your value will be different.

SMUSEBY wrote:
What is the type? MQTT Connector Event, ShellyMQTT Event, or ShellyNGMQTT Event? Both of the Event types relate to switches, so I used the first,


-- Begin Action Item --

The only trigger we are about right now is the MQTT Connector Event type. It is what listens to all MQTT traffic and determines which messages are put into the message queue to be processed by the Shelly Plugin.

You have a trigger named "MQTT Connector Event", and you have it configured to match on "shellies" and then "ANY". Therefore, this trigger will be executed any time a message comes across under the "shellies/<some_topic_path_here>" topic path. This is sufficient to match on ALL gen1 shelly device traffic. So we configured the trigger to then queue ALL these messages into a queued with a message type of "shellies". This works ONLY for the ShellyMQTT plugin.

Gen2 devices have basically no overlap in how they communicate with MQTT. Hence the need for this different plugin. This means we use a 2nd queue of messages (a different message type) and therefore a second trigger. I recommend you delete your existing trigger named "MQTTNG Connector Event" and make a new one. You need to configure it with:
Code: Select all
Match: shellies-ng
Any:

and queue the message with a message type of "shellies-ng". This will result in all MQTT messages in topics under the "shellies-ng/<ANY_TOPIC_NAME_HERE>" to be put into a queue named "shellies-ng". This works because you correctly set the MQTT Prefix in the Web UI to be "shellies-ng/shelly1plus-b8d61a885b6c". It will match this new trigger's topic pattern because it is using the "shellies-ng/<SOMETHING>" topic pattern.

-- End Action Item --

SMUSEBY wrote:
Two screenshots attached showing my two triggers. Notice that for the gen 1 trigger, I don't have "/#" after the shellies. - but it works.


Please don't touch that gen1 trigger - we have it working :lol:

SMUSEBY wrote:
As in my original screenshot, the device is not reporting a state, which I'm guessing has to do with the device, and not the trigger. - but I probably have the trigger wrong as well...


The device in Indigo has no state because it is not getting any data from MQTT. This is because your current trigger is wrong and isn't sending the MQTT messages to the plugin to therefore update the Indigo states.

SMUSEBY wrote:
Here's another potential clue: in the Indigo Edit Device Settings, I am unable to make both the System and WiFi settings stick.
- In system, I enter the Device Name (same as in the LAN device configuration),
- or the WiFi page, I only complete the SSID, Password fields only for WiFi 1, and tick the Enable box for 'if the network is enable for use'.
- For both pages, I press 'Write Configuration' and 'Save', but when I reopen them, the fields are bland, and the MAC address: and Firmware: fields are grayed out (and blank).
Access Point is not enabled - my guess that the Access Point is only useful when using the 192.168.33.1 address, and only needs to be enabled for the initial setup.
Any more ideas?

--merged--

Another good catch - I corrected the MQTT prefix from shelly1plus to shellyplus1 - and now, in Indigo I'm happy to report some progress: the Indigo edit device settings are sticking for both system and wifi, but the device is not connected in Indigo.
Update - I just checked again, and the System & Wifi fields are once again blank. How can that be?
This is torture.


None of that works because this all relies on Indigo talking to the device over MQTT, which we have established is not working yet.

Posted on
Thu Mar 30, 2023 6:45 pm
SMUSEBY offline
Posts: 511
Joined: Sep 16, 2009
Location: California

Re: Configuring NG relays

That's interesting, but I thought Indigo could manage the NG devices.
Does that mean that the NG devices don't work at all in Indigo, or are you referring to only the MQTT configuration of the Indigo settings? Hopefully, the latter, in which case something(s) is/are still wrong. - in Indigo, there the State field is blank.

Who is online

Users browsing this forum: No registered users and 1 guest