Today I posted this topic MQTT know if a client is subscribed
I would like to try something, but I would like to know if is feasible, may be I'm complicating the things, so if you have another suggestion please feel free
let's suppose that we have the topic temperature/subscription
First
Client A subscribes to subscription (or in other words temperature/subscription) if he doesn't receive a payload (a retain message)
then
Client A publishes to subscription with a payload of 1 or "online" as a retain message
and subscribes to the temperature topic
Now, Client B
again, subscribes to subscription if he receives a payload = someone is already subscribed (Client A) So, he can't subscribe to temperature topic
I still need to add the LWT message, but first I want to start with something simple.
Is it feasible to do this? so I this way I can see if someone is subscribed or not to a topic