New: the AI firewall watches the whole platform and explains each incident in plain words. See how it works

Reply To: Dimming BLE dimmers from a dashboard slider through an ESP32 bridge

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:

  1. Added the light.set command to the dimmers’ profile (not the gateway’s), Basic tier, parameter level (Number, 0-100).
  2. 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.
  3. Bound the Current value slot to the level telemetry of the same child, so the card shows the dimmer’s real value.
  4. 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ı

Accepted solution♥ 5