Help creating Shim devices for Pool Controller

jltnol
Posts: 1162
Joined: Tue Oct 15, 2013 11:11 pm

Help creating Shim devices for Pool Controller

Post by jltnol »

So as one of the previous posters said, I'm new to MQTT as well. I've gotten much farther along than I thought possible, basically getting mosquito installed on my Pi, which is running some pool Control software.

I'm also using MQTT Explorer, and my device does show up(see pic), but in my case, the values aren't updating... mainly water and air temps. There is a web dashboard for the control software, and it reflects the right temps, but MQTT Explorer values haven't changed/updated. So for the moment, my first question is should values in MQTT Explorer update as they change? And if they should what might be causing them not to update?

And while I'm here, as far as Topics to Subscribe to in the MQTT Plugin Device, from the pic I've attached I've got
0:easytouch2-4/state#
This should give me the option to gather info on any parameters available, yes? And FWIW, the IP address where the pool control software and mosquito are running is not the same as the Indigo Server..
Attachments
Screen Shot 2022-05-15 at 9.08.56 PM.png
Screen Shot 2022-05-15 at 9.08.56 PM.png (185.86 KiB) Viewed 7074 times
jltnol
Posts: 1162
Joined: Tue Oct 15, 2013 11:11 pm

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

Post by jltnol »

So I'm down to this error message:

Code: Select all

MQTT Connector Debug            Received PUBLISH (d0, q0, r0, m0), 'easytouch2-4/state/temps/waterSensor1', ...  (11 bytes)
   MQTT Connector Debug            MQTT Connector to PI: processReceivedMessage: easytouch2-4/state/temps/waterSensor1, payload: {"temp":80}
   Trigger                         M QTT
   MQTT Shims Error                Pool Temp: error getting uid value from payload, aborting

The odd thing is the value I'm looking for is there in the Connection Debug log, but does not show up in the Shims device.

My topics are all heavily nested, so not at all sure what to use for both the Unique ID Location, and Topic Field, and Unique ID Value, (see pic from previous post...), but this info is clearly what I have wrong in this setup. Since all my topics ARE so heavily nested, I tried going the Payload Filed route, using the superseding topic as the key, but that didn't work either.. :(

I've tried any number of combination of things for the fields in the Shims device, from Payload Field to Topic Component, and back again, but to no avail.

Hoping someone can take a look and point out my probably obvious mistake.
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 »

You’ll need to post a screenshot of your Shim device. From what I can see right now, your Unique ID location is topic component 0 (zero), and a value of easytouch2-4.

I would subscribe to

Code: Select all

 easytouch2-4/#
Also payload type is JSON
joe (aka FlyingDiver)
my plugins: http://forums.indigodomo.com/viewforum.php?f=177
jltnol
Posts: 1162
Joined: Tue Oct 15, 2013 11:11 pm

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

Post by jltnol »

So I feel like I've tried any number of combination of entries into the Shims device, but just haven't found the right combination yet.. :( Back at the main MQTT device, I've tried any number of combinations of Topics Subscriptions, but read your earlier post about only the uppermost topic can be subscribed to which will make all of the underlying topics available, so my lone topic is "easytouch2-4/#"

For the Trigger, I am matching on the following topics: "easytouch2-4", "state", "temps", "waterSensor1", although I"m guessing all I really need is the very first one, as any changes from EasyTouch will fire the trigger.

The original post here doesn't have any 'nesting' so that has thrown me off completely. I look at all the nested topics available, and see them kind of like Directories.... and assume I need to define the proper "directory" in the Unique ID Location in the Shims device, but again, haven't stumbled on the right one yet. I'm also assuming that both the Unique ID Location and the State Value Location should be the same type (but have tried different combinations of both...) And while I've tried changing the Value Location from Payload to Topic and back again, I'm not sure what should go int he Payload Key field. Just looking at the prompts in that field, I've tired a few different combinations of defining the "directory" that the field I want to access is in, but again, haven't found the right combination. And as I've made the many changes, I've manually fired off the trigger just to be sure I'm in between MQTT updates...

As always, I more than appreciate your help and assistance.
Attachments
Screen Shot 2022-05-18 at 9.33.00 AM.png
Screen Shot 2022-05-18 at 9.33.00 AM.png (222.77 KiB) Viewed 7018 times
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 just got off a 12 hr flight from the Middle East and I need to get up early for a connecting flight home, so I can’t give a complete explanation right now.

You’re confusing unique Id and state key. The unique ID identifies the device, not the value you want. So in your case it’s ‘easytouch2-4’.

There’s no such thing as nested topics. Where the config dialog refers to nesting, it’s for json payloads which can have nested dicts which requires a series of keys.

When I get home and am at a computer with the Indigo client on it I’ll mock up,what your shim device should look like, what values do you really want to get into indigo as shim devices? Just the air and water temps?
joe (aka FlyingDiver)
my plugins: http://forums.indigodomo.com/viewforum.php?f=177
cuhouse
Posts: 151
Joined: Wed Feb 21, 2007 4:10 pm
Location: Virginia, USA

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

Post by cuhouse »

jltnol,

I was looking at this and see that Joe has responded. I will send this anyway but I have no doubt Joe will get you going when he gets some sleep. :)

I am not sure on the Payload Key: value

No loss to try it,

Jody
Attachments
Screen%20Shot%202022-05-18%20at%209.33.00%20AM (1).jpg
Screen%20Shot%202022-05-18%20at%209.33.00%20AM (1).jpg (57.19 KiB) Viewed 6998 times
Indigo 2024.1, Monterey v12.7.6, Dedicated late 2014 Mac Mini, PowerLinc 2413U, Shelly/ShellyNG, Lutron Caséta Smart Bridge PRO (L-BDGPRO2-WH).
jltnol
Posts: 1162
Joined: Tue Oct 15, 2013 11:11 pm

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

Post by jltnol »

So I found this post viewtopic.php?f=316&t=25204 which is very similar to my setup. I've copied everything from the screen shots, but still have no data in the Shims device. I'm 99.9% I have the MQTT device setup correctly, and I am subscribing to easytouch2-4/# so I should be able to access all of the data for this device. For the trigger, I've got easytouch2-4, state, Any:, waterSensor1, End:, just as the original poster has..

I'm attaching a screen shot of my Shims device, which mirrors what the poster did with his setup, but I must have missed something.
Attachments
Screen Shot 2022-05-19 at 12.37.03 PM.png
Screen Shot 2022-05-19 at 12.37.03 PM.png (135.55 KiB) Viewed 6961 times
Screen Shot 2022-05-19 at 12.39.08 PM.png
Screen Shot 2022-05-19 at 12.39.08 PM.png (172.94 KiB) Viewed 6961 times
cuhouse
Posts: 151
Joined: Wed Feb 21, 2007 4:10 pm
Location: Virginia, USA

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

Post by cuhouse »

Your Payload Type: is not “Raw”, it is JSON per your MQTT Explorer window you provided. Try temp for the Payload Key.
Indigo 2024.1, Monterey v12.7.6, Dedicated late 2014 Mac Mini, PowerLinc 2413U, Shelly/ShellyNG, Lutron Caséta Smart Bridge PRO (L-BDGPRO2-WH).
jltnol
Posts: 1162
Joined: Tue Oct 15, 2013 11:11 pm

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

Post by jltnol »

Ok. so in the thread I was copying from, the water temperature value is simple listed as 86, where mine is listed as {"temp":78}, which makes my Payload Type JSON as opposed to his which is just Raw, right ?

I just don't understand how all this actually identifies the data I'm trying to get to. Does the Topic Field of "2" represent all the data under the temps listing?

If the Payload Key is "temp", where does that come from? Is it the part in brackets after waterSensor1? If so, there are 2 other "temp" (s)... one for air and one for solar. Does the "Precision" value of "2" represent the third topic listed? I'm attaching what I have listed now, but still don't have any data.

AND, since I've got State Value Locations set to Payload Field,, should the Unique ID Location also be Payload Field as opposed to Topic Component?

Thank you for your patience and your help.
Attachments
Screen Shot 2022-05-19 at 10.19.25 PM.png
Screen Shot 2022-05-19 at 10.19.25 PM.png (161.72 KiB) Viewed 6937 times
cuhouse
Posts: 151
Joined: Wed Feb 21, 2007 4:10 pm
Location: Virginia, USA

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

Post by cuhouse »

jltnol wrote:Ok. so in the thread I was copying from, the water temperature value is simple listed as 86, where mine is listed as {"temp":78}, which makes my Payload Type JSON as opposed to his which is just Raw, right ?
Yes
jltnol wrote:I just don't understand how all this actually identifies the data I'm trying to get to. Does the Topic Field of "2" represent all the data under the temps listing?
Yes and your trigger plays a role in this also. The trigger determines in this case from what you supplied in this thread as waterSensor1

easytouch2-4 (0), state (1), Any:(2), waterSensor1(3),

***Can you supply a screen shot of your trigger that is associated with this device?
jltnol wrote: the Payload Key is "temp", where does that come from? Is it the part in brackets after waterSensor1? If so, there are 2 other "temp" (s)... one for air and one for solar. Does the "Precision" value of "2" represent the third topic listed? I'm attaching what I have listed now, but still don't have any data.
temp is the part in brackets and not temps. temps is not same as temp. The trigger would determine the other two temps. Precision is just how many places after the decimal the value displays nothing to do with the topic
jltnol wrote:, since I've got State Value Locations set to Payload Field,, should the Unique ID Location also be Payload Field as opposed to Topic Component?
This part is right it has to be JSON I am just not positive 100% on the Payload Key being temp
jltnol wrote: Thank you for your patience and your help.
No problem but this may be beyond me. Joe, Aaron .....Help :(
Indigo 2024.1, Monterey v12.7.6, Dedicated late 2014 Mac Mini, PowerLinc 2413U, Shelly/ShellyNG, Lutron Caséta Smart Bridge PRO (L-BDGPRO2-WH).
cuhouse
Posts: 151
Joined: Wed Feb 21, 2007 4:10 pm
Location: Virginia, USA

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

Post by cuhouse »

I mocked this up on my system and it seems to work. I have to publish the data via MQTT Explorer since I don't have the device or a pool :lol:

Compare the screen shots with how you have it.
Attachments
4.jpg
4.jpg (53.7 KiB) Viewed 6935 times
1.jpg
1.jpg (103.27 KiB) Viewed 6935 times
2.jpg
2.jpg (131.36 KiB) Viewed 6935 times
3.jpg
3.jpg (15.49 KiB) Viewed 6935 times
Indigo 2024.1, Monterey v12.7.6, Dedicated late 2014 Mac Mini, PowerLinc 2413U, Shelly/ShellyNG, Lutron Caséta Smart Bridge PRO (L-BDGPRO2-WH).
User avatar
FlyingDiver
Posts: 7830
Joined: Sat Jun 07, 2014 10:36 am
Location: Southwest Florida, USA

Re: Help creating Shim devices for Pool Controller

Post by FlyingDiver »

cuhouse wrote:I mocked this up on my system and it seems to work. I have to publish the data via MQTT Explorer since I don't have the device or a pool.
I use the MQTT Connector "Publish Message" action for testing Shims, etc. And yes, an MQTT Broker will echo published messages back to the client that sent them.
Attachments
Screen Shot 2022-05-20 at 3.20.54 AM.png
Screen Shot 2022-05-20 at 3.20.54 AM.png (542.01 KiB) Viewed 6920 times
joe (aka FlyingDiver)
my plugins: http://forums.indigodomo.com/viewforum.php?f=177
User avatar
FlyingDiver
Posts: 7830
Joined: Sat Jun 07, 2014 10:36 am
Location: Southwest Florida, USA

Re: Help creating Shim devices for Pool Controller

Post by FlyingDiver »

Back to the OP's question. Your topic subscription is fine.

When working out how do build a Shim device, the first step is to break down the topic and see what the payloads are. Based on the MQTT Explorer screen shot you posted, the relevant topics and payloads are:

easytouch2-4/state/temps/air --> {"temp":83}
easytouch2-4/state/temps/waterSensor1 --> {"temp":86}

For both of these topics, the payload is in JSON format, consisting of a dict with a single key ("temp") and an integer value.

There's usually multiple ways to accomplish the trigger and shim definition, so I'll give you one that's as close as possible to your original attempts. Here's the trigger. It matches the first three topic components, and has a wildcard (any) match for the fourth.
Screen Shot 2022-05-20 at 4.00.16 AM.png
Screen Shot 2022-05-20 at 4.00.16 AM.png (592.42 KiB) Viewed 6895 times
Now here's the Shim device for the water temperature. The first couple of entries match the trigger. The next is for the Unique ID. In this case, we're using the sensor name from the topic, which is the 4th component (field 3 since it's zero based). Then the next section identifies where the actual value is, which is the "temp" key in the JSON payload.

The air sensor is exactly the same except for the Unique ID value is "air".

Screen Shot 2022-05-20 at 4.29.16 AM.png
Screen Shot 2022-05-20 at 4.29.16 AM.png (591.76 KiB) Viewed 6895 times
Screen Shot 2022-05-20 at 4.36.22 AM.png
Screen Shot 2022-05-20 at 4.36.22 AM.png (36.17 KiB) Viewed 6895 times
Time for me to try to get some sleep. I'm so jet lagged...
joe (aka FlyingDiver)
my plugins: http://forums.indigodomo.com/viewforum.php?f=177
cuhouse
Posts: 151
Joined: Wed Feb 21, 2007 4:10 pm
Location: Virginia, USA

Re: Help creating Shim devices for Pool Controller

Post by cuhouse »

jltnol,

Thanks for your post. It had been some time since doing this, so good review as I am not the MQTT expert like Joe. :)
FlyingDiver wrote:There's usually multiple ways to accomplish the trigger and shim definition, so I'll give you one that's as close as possible to your original attempts. Here's the trigger. It matches the first three topic components, and has a wildcard (any) match for the fourth.
jltnol,

You can see how the trigger plays a role in getting the data. Using your trigger scheme as we were doing with the wildcard (Any:) in the 2nd field (zero based), Topic Component 2 in your Shim device, you would need to add another trigger to get the remaining temperature data. Joe moved it one place and then only needs one trigger to accomplish the same. More streamlined.
FlyingDiver wrote:Time for me to try to get some sleep. I'm so jet lagged...
I figured you would be sleep deprived so I thought I would attempt to help jltnol. Thanks for the hint on using MQTT Connector to publish.

Jody
Indigo 2024.1, Monterey v12.7.6, Dedicated late 2014 Mac Mini, PowerLinc 2413U, Shelly/ShellyNG, Lutron Caséta Smart Bridge PRO (L-BDGPRO2-WH).
User avatar
FlyingDiver
Posts: 7830
Joined: Sat Jun 07, 2014 10:36 am
Location: Southwest Florida, USA

Re: Help creating Shim devices for Pool Controller

Post by FlyingDiver »

cuhouse wrote: I figured you would be sleep deprived so I thought I would attempt to help jltnol. Thanks for the hint on using MQTT Connector to publish.
Thanks for the help. When I tried to go to sleep at 11 last night, that was 6am Jordan time, which is when I had been getting up. Body was so confused. ;)

Didn't help that I found a small bug in the Shims plugin while doing the example, so I had to push an update in the middle of the night. Sigh.
joe (aka FlyingDiver)
my plugins: http://forums.indigodomo.com/viewforum.php?f=177
Locked

Return to “MQTT”