An MQTT config example to Newbies from a Newbie...

ppespepe
Posts: 51
Joined: Wed May 27, 2020 5:06 pm

An MQTT config example to Newbies from a Newbie...

Post by ppespepe »

Hi there,

I'm very new to Indigo and it took me a little while to learn to use the MQTT/Shims combo. If you are newbie and lazy to read like me, perhaps this example would help a little bit.

First, I'm using a version of BKHobby's Kube. It is based on the Kube 1 but using the boards of the Kube 2. here you can find some info if you want to give it a try: https://www.pcbway.com/project/sharepro ... Board.html & https://www.thingiverse.com/thing:2539897 I think is a really cool project.

Anyway, I'm using this testbed with the BME680 and MH-Z19 sensors:
Device.jpg
Device.jpg (42.44 KiB) Viewed 20424 times
Let's start from the beginning... the combo plugin combo I mentioned before is:
Step1.jpg
Step1.jpg (79.56 KiB) Viewed 20424 times
Then:
Step2.jpg
Step2.jpg (33.36 KiB) Viewed 20424 times
Step3.jpg
Step3.jpg (36.6 KiB) Viewed 20424 times
Step4.jpg
Step4.jpg (70.44 KiB) Viewed 20424 times
Step5.jpg
Step5.jpg (36.49 KiB) Viewed 20424 times
Step6.jpg
Step6.jpg (82.83 KiB) Viewed 20424 times
Step7.jpg
Step7.jpg (30.98 KiB) Viewed 20424 times
Step8.jpg
Step8.jpg (64.65 KiB) Viewed 20424 times
Step9.jpg
Step9.jpg (80.85 KiB) Viewed 20424 times
Can't put more than 10 attachments so I'll continue in another post.....

To be continued.... :P
ppespepe
Posts: 51
Joined: Wed May 27, 2020 5:06 pm

Re: An MQTT config example to Newbies from a Newbie...

Post by ppespepe »

Continuing the previous post:
Step10.jpg
Step10.jpg (26.91 KiB) Viewed 20420 times
Step11.jpg
Step11.jpg (63.48 KiB) Viewed 20420 times
Step12.jpg
Step12.jpg (84.04 KiB) Viewed 20420 times
Step13.jpg
Step13.jpg (57.17 KiB) Viewed 20420 times
Step14.jpg
Step14.jpg (46.72 KiB) Viewed 20420 times
Step16.jpg
Step16.jpg (82.03 KiB) Viewed 20420 times
And to be continued to Part III... :P
Attachments
Step15.jpg
Step15.jpg (26.06 KiB) Viewed 20420 times
ppespepe
Posts: 51
Joined: Wed May 27, 2020 5:06 pm

Re: An MQTT config example to Newbies from a Newbie...

Post by ppespepe »

And third and last part:
Step17.jpg
Step17.jpg (55.65 KiB) Viewed 20419 times
Step18.jpg
Step18.jpg (26.67 KiB) Viewed 20419 times
Step19.jpg
Step19.jpg (47.05 KiB) Viewed 20419 times
Step20.jpg
Step20.jpg (78.54 KiB) Viewed 20419 times
Hopefully this sill help someone!!!

Enjoy...
User avatar
mundmc
Posts: 1068
Joined: Fri Sep 14, 2012 4:34 pm

Re: An MQTT config example to Newbies from a Newbie...

Post by mundmc »

We need a gigantic LIKE button.

Thank you for this! I got a couple more rudimentary ESP8266’s up witj MQTT Connector, but i got into the weeds with Shims. I very well may print this out on paper to guide me!
User avatar
FlyingDiver
Posts: 7830
Joined: Sat Jun 07, 2014 10:36 am
Location: Southwest Florida, USA

Re: An MQTT config example to Newbies from a Newbie...

Post by FlyingDiver »

Very nice writeup. The only recommendation I would make at this point is that it's not necessary to list that many subscriptions. You could just subscribe to "home/#" and be done with it. ;)
joe (aka FlyingDiver)
my plugins: http://forums.indigodomo.com/viewforum.php?f=177
User avatar
cesarvog
Posts: 155
Joined: Sat Aug 13, 2016 9:54 am
Location: Brazil

Re: An MQTT config example to Newbies from a Newbie...

Post by cesarvog »

Many, many thanks for this tutorial. I'm totally new to MQTT and this will help a lot.
User avatar
cesarvog
Posts: 155
Joined: Sat Aug 13, 2016 9:54 am
Location: Brazil

Re: An MQTT config example to Newbies from a Newbie...

Post by cesarvog »

On a side note, can anyone care to clarify the meaning of the three "Match Type" choices ("Match", "Any", "End") in the "Topic Configuration Match" screen?

My understanding of the "Match" and "Any" is the former indicates the string you want to match to, while the latter acts as an anything goes (wildcard type of thing).

Joe has kindly helped me yesterday on the correct creation of a trigger. His suggestion used all three choices, but I'm still not quite sure about the meaning of the "End" choice...

TIA
Cesar
Last edited by cesarvog on Wed Dec 23, 2020 8:42 am, edited 2 times in total.
User avatar
FlyingDiver
Posts: 7830
Joined: Sat Jun 07, 2014 10:36 am
Location: Southwest Florida, USA

Re: An MQTT config example to Newbies from a Newbie...

Post by FlyingDiver »

It's there to terminate the matching process. When developing the plugin, I found a few examples of devices that sent multiple topics, some of which were extended versions (more terms) then other ones. I needed a way to complete the match without looking at more terms. I can't recall the specific example right now.
joe (aka FlyingDiver)
my plugins: http://forums.indigodomo.com/viewforum.php?f=177
User avatar
cesarvog
Posts: 155
Joined: Sat Aug 13, 2016 9:54 am
Location: Brazil

Re: An MQTT config example to Newbies from a Newbie...

Post by cesarvog »

Thanks Joe, always super fast on your replies.
Ah, so I figure that ALL triggers must include an End choice, correct?
User avatar
FlyingDiver
Posts: 7830
Joined: Sat Jun 07, 2014 10:36 am
Location: Southwest Florida, USA

Re: An MQTT config example to Newbies from a Newbie...

Post by FlyingDiver »

I wouldn't say "must". It doesn't hurt to have it, and I usually include it when I do a trigger, but it's only really needed for those edge cases where you don't want to match on a topic that has more terms than the one you do want to match on. I wish I could remember what device I ran into that caused me to include it...
joe (aka FlyingDiver)
my plugins: http://forums.indigodomo.com/viewforum.php?f=177
User avatar
cesarvog
Posts: 155
Joined: Sat Aug 13, 2016 9:54 am
Location: Brazil

Re: An MQTT config example to Newbies from a Newbie...

Post by cesarvog »

No need to search for that. I think your explanation above clarifies it perfectly.

I decided to ask because I have followed the Wiki Basic Setup Guide (https://github.com/FlyingDiver/Indigo-S ... asic-Setup) and found some minor inconsistencies between the screenshots there and the actual screen in the current incarnation of the plugins (which also means the "End" choice is never mentioned there)

I believe this exchange of posts between us may help other fellow users in the future, so it's nice to have it clarified.

Best regards,
Cesar
User avatar
FlyingDiver
Posts: 7830
Joined: Sat Jun 07, 2014 10:36 am
Location: Southwest Florida, USA

Re: An MQTT config example to Newbies from a Newbie...

Post by FlyingDiver »

Yeah, those screen shots are from before I added the End term.
joe (aka FlyingDiver)
my plugins: http://forums.indigodomo.com/viewforum.php?f=177
DirkWe
Posts: 22
Joined: Mon Jun 22, 2015 10:52 am

Re: An MQTT config example to Newbies from a Newbie...

Post by DirkWe »

Fantastic, with your tutorial i made it in a few minutes and get all mey relevant values from my Photo-Voltaic into indigo ! Thanks from Germany
Dirk :D
User avatar
mundmc
Posts: 1068
Joined: Fri Sep 14, 2012 4:34 pm

Re: An MQTT config example to Newbies from a Newbie...

Post by mundmc »

(Like)
(placeholder until M&J give us a “Like” button)
Seeker
Posts: 441
Joined: Mon Aug 05, 2013 5:08 am

Re: An MQTT config example to Newbies from a Newbie...

Post by Seeker »

I am less than newbie on this. but this is helpful. still struggling to get started.

it does not seem to include setting up brew/mosquitto, but says enter the IP of your broker (mosquitto?) in config.

in the plugin configure broker, do i use the IP of my mac running indigo and mosquitto? i have tried that, but get failed to connect in indigo on that device. and i cannot connect from MQTT explorer.

my indigo mac is 192,168.1.101. on this mac where i installed brew/mosquitto, i can do this:

ow you can test the installation and ensure the server is running successfully. Open a new command window and start a listener.

mosquitto_sub -t topic/state

In another window, send a message to the listener.

mosquitto_pub -t topic/state -m "Hello World"

and i see hellow world in the other window as expected.

what am i missing? is the ip of my broker device supposed to be 192,168.1.101?

thanks for any pointers
Locked

Return to “MQTT”