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

Reply To: Servo dampers driven from wall buttons and a dashboard slider get out of sync

Keep the buttons. The slider can only show what the device tells Hermetry, so the ESP32 has to report the position after every move, from a button or from a command.

I’d bet the jump-back is your Current value binding. Check what the slider’s Current value slot points at. If it reads something that only changes when you send (or nothing), it snaps back to that. Bind it to a telemetry key the ESP32 sends itself, for example damper1_pos.

On the ESP32, after any move:

void moveTo(int ch, int angle) {
  angle = constrain(angle, 0, 90);
  servo[ch].write(angle);
  pos[ch] = angle;
  char buf[48];
  snprintf(buf, sizeof buf, "{"damper%d_pos":%d}", ch + 1, angle);
  mqtt.publish("v1/telemetry", buf);
}
// button handler: moveTo(ch, pos[ch] + 15);
// command handler for damper.set: moveTo(ch, params["angle"]); then answer ok

Slider settings that worked for us: Minimum 0, Maximum 90, Step 15 so it matches the button steps. The slider sends once when you let go, not while dragging, so the servo isn’t spammed. For a damper you can turn Ask before running off, otherwise reception gets a confirm dialog on every move. Leave the command Basic tier, a board won’t send anything higher.

There’s also “Disable the control when the reading is old” on by default. If the ESP32 only reports on change and nobody touched it for hours, the slider may grey out. Have it repeat the position every few minutes with the other readings.

Setup steps are on Control cards.

Timestamps in UTC or it didn't happen.
Accepted solution♥ 1