Translated from Türkçe by AI ·
The child gets the command, and the spot you’re stuck on is the ESP32 side. A command sent to a device behind the gateway comes down to the gateway over v1/gw/rpc, and shared attribute changes come over v1/gw/attributes. Your code most likely only listens on v1/rpc/req/+, which is for the gateway’s own commands. That’s why the command stays in Sent. I got stuck in the same place with the water stations too.Here’s what I did:
- Added the light.set command to the dimmers’ profile (not the gateway’s), Basic tier, parameter level (Number, 0-100).
- On the slider card: Run a command: Device = atolye-3 child, Command = light.set, for level The control’s value. I convert the 0-100 slider to 0-255 on the ESP32 side.
- Bound the Current value slot to the level telemetry of the same child, so the card shows the dimmer’s real value.
- For the light I turned off Ask before running, so it doesn’t ask for confirmation on every slide.
On the ESP32 side, after every connection, subscribe to v1/gw/rpc. Print the incoming message to the serial port first and look at its structure, then work out which child it’s for from there and do the BLE write:
mqtt.subscribe("v1/gw/rpc", 1);
void onMsg(char* topic, byte* payload, unsigned int len) {
if (strcmp(topic, "v1/gw/rpc") == 0) {
Serial.write(payload, len); // önce yapıya bak
Serial.println();
// child adını ve level'ı çöz:
// bleSetLevel(name, map(level, 0, 100, 0, 255));
}
}
The control card rules are here: Kontrol kartları
Child’a komut gidiyor, takıldığın yer ESP32 tarafı. Gateway arkasındaki bir cihaza gönderilen komut gateway’e v1/gw/rpc üzerinden iniyor, shared attribute değişiklikleri de v1/gw/attributes üzerinden. Senin kod büyük ihtimalle sadece v1/rpc/req/+ dinliyor, o da gateway’in kendi komutları için. Komut o yüzden Sent’te kalıyor. Ben de su istasyonlarında aynı yerde takılmıştım.
Yaptığım şey şöyle:
- light.set komutunu dimmer’ların profiline ekle (gateway’inkine değil), Basic tier, parametre level (Number, 0-100).
- Slider kartında Run a command: Device = atolye-3 child’ı, Command = light.set, level için The control’s value. 0-100 slider’ı ESP32 tarafında 0-255’e çeviriyorum.
- Current value slot’unu aynı child’ın level telemetrisine bağla, kart dimmer’ın gerçek değerini göstersin.
- Işık için Ask before running’i kapattım, her kaydırmada onay sormasın.
ESP32 tarafında her bağlantıdan sonra v1/gw/rpc‘ye abone ol. Gelen mesajı önce seri porta bastırıp yapısına bak, hangi child için geldiğini oradan çözüp BLE yazmasını yaparsın:
mqtt.subscribe("v1/gw/rpc", 1);
void onMsg(char* topic, byte* payload, unsigned int len) {
if (strcmp(topic, "v1/gw/rpc") == 0) {
Serial.write(payload, len); // önce yapıya bak
Serial.println();
// child adını ve level'ı çöz:
// bleSetLevel(name, map(level, 0, 100, 0, 255));
}
}
Kontrol kartlarının kuralları burada: Kontrol kartları

