Help with MQTT

MarcoGT
Posts: 1148
Joined: Thu Sep 11, 2014 1:06 pm
Location: Germany

Re: Help with MQTT

Post by MarcoGT »

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 1661 times
User avatar
FlyingDiver
Posts: 7830
Joined: Sat Jun 07, 2014 10:36 am
Location: Southwest Florida, USA

Re: Help with MQTT

Post by FlyingDiver »

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
MarcoGT
Posts: 1148
Joined: Thu Sep 11, 2014 1:06 pm
Location: Germany

Re: Help with MQTT

Post by MarcoGT »

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
User avatar
FlyingDiver
Posts: 7830
Joined: Sat Jun 07, 2014 10:36 am
Location: Southwest Florida, USA

Re: Help with MQTT

Post by FlyingDiver »

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
User avatar
FlyingDiver
Posts: 7830
Joined: Sat Jun 07, 2014 10:36 am
Location: Southwest Florida, USA

Re: Help with MQTT

Post by FlyingDiver »

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
Post Reply

Return to “MQTT”