Traduit de English par IA ·
Les compteurs ne reçoivent jamais d’identifiants. Le Pi se connecte en tant qu’un seul appareil, et sur cet appareil vous activez Cet appareil est une passerelle. Son profil doit utiliser le schéma de topics v1/ par défaut. Il publie ensuite pour les enfants avec QoS 1, en envoyant la télémétrie indexée par le nom de l’enfant :
topic: v1/gw/telemetry
{
"Meter 1": {"values": {"kwh": 1203.4, "voltage": 229.8}},
"Meter 2": {"values": {"kwh": 88.1}}
}
Un enfant est créé la première fois que la passerelle le mentionne. Envoyez v1/gw/connect avec un type correspondant exactement au nom d’un de vos profils si vous voulez qu’il soit rattaché à ce profil ; sinon, il reçoit le « Profile of new children » du profil de passerelle. Les commandes destinées à un compteur parviennent au Pi sur v1/gw/rpc.
The meters never get credentials. The Pi logs in as one device, and on that device you turn on This device is a gateway. Its profile must use the default v1/ topic scheme. Then it publishes for the children with QoS 1, telemetry keyed by the child’s name:
topic: v1/gw/telemetry
{
"Meter 1": {"values": {"kwh": 1203.4, "voltage": 229.8}},
"Meter 2": {"values": {"kwh": 88.1}}
}
A child is created the first time the gateway mentions it. Send v1/gw/connect with a type that is exactly the name of one of your profiles if you want it to land on that profile; otherwise it gets the gateway profile’s Profile of new children. Commands for a meter reach the Pi on v1/gw/rpc.

