Messages for one user
Public and private channels reach groups of users. Sometimes you want a message to reach exactly one person, for example a "your job is done" ping for whoever started the job. For that, the hub routes messages by a user's topic id.
The topic id belongs to a hub user, and the phone learns its own topic id from the hub when it signs in. Phones that sign in through LemmeKnow Server never learn a topic id, so they can't receive messages for one user.
The topic id
Each hub user has a topic id: a long random value, separate from their username and access key, used only to address messages to them. The hub can rotate it, which cuts off anything still listening on the old value without changing the user's access key.
A script gets a user's topic id from the hub's API: the topic_id field returned by /api/users/me when called with that user's access key. See REST API.
Treat the topic id like an address, not a password. The broker only lets the matching user read messages sent to it.
Sending a ping to one user
Pass the topic id to ping() as user_topic_id:
import log_client
log_client.SOURCE = "build"
log_client.ping("200", "Your build finished", user_topic_id="0f6c2a9e-1b3d-4c8e-9a7f-2d5e6b1c4a90")
The ping goes to lemmeknow/<server_id>/ping/<topic_id> and only that user's phone receives it. user_topic_id overrides public, and the public and private permissions for the code don't apply, because the message is already addressed to one person.
The code still needs a label in the hub's ping_messages that the user can see, like any other ping. See Pings.
To send the same ping without the helper, publish to that topic with the usual ping payload (code, source, msg, ts). See MQTT topics.
Logs for one user
Only pings can be sent to one user. The app doesn't receive log lines addressed to one user, so log lines always go to the public or private channel.