Clarification of my MQTT plugins understanding

Posted on
Tue Oct 25, 2022 12:31 pm
berkinet offline
User avatar
Posts: 3290
Joined: Nov 18, 2008
Location: Berkeley, CA, USA & Mougins, France

Clarification of my MQTT plugins understanding

This is probably obvious to others. But, as a complete newbie to MQTT, and Flying Diver's MQTT plugins, I have been doing a bit of learning. So, I thought I'd share something I figured out today in the hope it will help someone else, or that at least someone will tell me what I got wrong.

The situation is the path MQTT messages take between the broker (I am using MQTT Broker, but it doesn't matter) and the "shim devices" created with the MQTT Shims plugin. I am exchanging messages with a LinkTap sprinkler controller. The MQTT topic has a root of a/b/c . Then, the specific sprinkler valve controller is appended as a 4th element (topic field 3 in the MQTT Connector) subscription entry. I initially had a separate subscribed topic for each controller. However, I found I can use MQTT wildcards to slim that down to just one subscription. The form is a/b/c/# and will match any 4 element topic starting with a/b/c/ . However, I still had separate Message Types for each controller. But, I was able to get by with just one message type ###foo### (set in the MQTT trigger). I made this work by using the shim configuration Unique ID Location test. I choose Topic Component, and set the Topic Field to 3: the 4th field of the Topic. I then set the Unique ID Value to the ID of the respective sprinkler. So, one Connector and one trigger can catch and properly route all of my controller valves. Of course, I did have to have a separate shim for each valve.

The only downside I can see here is that every shim sees every message. But, I doubt that will be an issue.

Anyway, I hope someone finds this useful, and if not, at least I now have a record of what I did that I will on some future date find with a google search.

Page 1 of 1

Who is online

Users browsing this forum: No registered users and 1 guest