Feeds and group name/structure confusion

Moderators: adafruit_support_bill, adafruit

Forum rules
If you're posting code, please make sure your code does not include your Adafruit IO Active Key or WiFi network credentials.
Locked
User avatar
movsesk
 
Posts: 7
Joined: Tue Nov 22, 2022 4:49 pm

Feeds and group name/structure confusion

Post by movsesk »

Hello,

This may be a silly question, but I can't seem to get this going correctly.

I have an ESP32 device manually publishing to the following, which works great:
myusername/feeds/temperature_f

But there are multiple of these devices and what I ultimately want is the following:
myusername/feeds/clock/neonixie/1234/temperature_f

I can publish to a different MQTT server and all is well, but IO does not seem to like the nested names. I tried creating a "clock/neonixie/1234/" group and later a "clock/neonixie/1234/temperature_f" feed, and many variations of similar... but I could not get it to work. I'm likely not doing something correctly. Maybe I have to nest multiple groups? Like create a "clock" then a "neonixie" then a "1234" ? or ?

I guess the "groups" and "feeds" are a bit foreign to me. Can someone explain in simple terms what I would need to get IO to property store... "myusername/feeds/clock/neonixie/1234/temperature_f" ?

Thank you!

Regards,
-Moses

User avatar
brubell
Learn User Page
 
Posts: 2010
Joined: Fri Jul 17, 2015 10:33 pm

Re: Feeds and group name/structure confusion

Post by brubell »

myusername/feeds/clock/neonixie/1234/temperature_f
Something like this is a standard MQTT topic. As you've realized, Adafruit IO is like an MQTT broker, but we've got some extra guidelines.

To highlight the difference a bit better,
The full MQTT topic used to describe a Feed in Adafruit IO is in the form, username/feeds/identifier where username should be replaced with the username of the account that owns the Feed and identifier should be replaced with the Name or Key that uniquely identifies the Feed you're talking about.

So, MQTT considers the whole topic test_username/feeds/identifier when validating names but for the purposes of describing Feeds, Adafruit IO is only considering the identifier portion.
(via https://learn.adafruit.com/naming-thing ... gs-in-mqtt)


myusername/feeds/clock/neonixie/1234/temperature_f
You'd want to:
1) Create a new Adafruit IO group named clock (or clock1, since you have multiple)
2) Add a feed, temperature_f, to the group.
3) Access that feed (in your new group) via the API. The API structure should look like this:
and the MQTT structure should look like this:
myusername/feeds/clock.temperature-f

User avatar
movsesk
 
Posts: 7
Joined: Tue Nov 22, 2022 4:49 pm

Re: Feeds and group name/structure confusion

Post by movsesk »

Brubell,

Thank you for the info.

I got it working with all the topics published to the root username/feeds/, but topics, sub topics, groups and feeds.. got a little confusing. Not sure why it wants a "." in the topic, as that is new to me as well. Guess it's the way it was designed. The basic service is free and that is cool, can't complain too much :)

Thanks again!

Regards,
-Moses

Locked
Forum rules
If you're posting code, please make sure your code does not include your Adafruit IO Active Key or WiFi network credentials.

Return to “Internet of Things: Adafruit IO and Wippersnapper”