Help with MQTT

Posted on
Thu Dec 15, 2022 3:36 pm
MarcoGT offline
Posts: 1091
Joined: Sep 11, 2014
Location: Germany

Re: Help with MQTT

I have the famous MQTT tree (see image).
I would like to have the value of "id" ("ced....") into a variable or state device (variable would be better), how can I do it?

Thanks
Marco
Attachments
Screenshot 2022-12-15 alle 22.35.33.png
Screenshot 2022-12-15 alle 22.35.33.png (132.91 KiB) Viewed 1031 times

Posted on
Thu Dec 15, 2022 3:44 pm
FlyingDiver offline
User avatar
Posts: 7220
Joined: Jun 07, 2014
Location: Southwest Florida, USA

Re: Help with MQTT

You need to set up a trigger and Generic JSON device for the topic "espresense/rooms/bagno_og". Because there are other topics with more components after that, you need to use the End term as follows:
Code: Select all
Match: espresense
Match: rooms
Any:
End:

Once you do that, you set the "multi-states key" to "." per the instructions in the config dialog. Then all of the items in that dict (id, idType, etc) will be states for that device.

If you really want them in a variable (why?) you would need to set up a trigger that fires whenever that state changes to copy the value to the variable.

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

Posted on
Thu Dec 15, 2022 3:49 pm
MarcoGT offline
Posts: 1091
Joined: Sep 11, 2014
Location: Germany

Re: Help with MQTT

Ok, thanks, but I do not understand how I have to setup the device.
What shall I put into "Unique ID Location"? And then?

Sorry for the silly questions.

Thanks

Posted on
Thu Dec 15, 2022 4:05 pm
FlyingDiver offline
User avatar
Posts: 7220
Joined: Jun 07, 2014
Location: Southwest Florida, USA

Re: Help with MQTT

Full disclosure - there's a way to get ALL of the data from the multiple topics into ONE Indigo device. That might be easier since you're looking at so many topics. The downside is it's not any kind of sensor device, and all the data ends up in custom states with very long and convoluted names.

I never wrote up any documentation on how it works, so I'd have to do that.

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

Posted on
Thu Dec 15, 2022 4:06 pm
FlyingDiver offline
User avatar
Posts: 7220
Joined: Jun 07, 2014
Location: Southwest Florida, USA

Re: Help with MQTT

MarcoGT wrote:
Ok, thanks, but I do not understand how I have to setup the device.
What shall I put into "Unique ID Location"? And then?


Same as all your other devices. "bagno_og". The string that's in the "Any" slot in the trigger.

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

Who is online

Users browsing this forum: No registered users and 2 guests