Traducido del English por IA ·
Conserve los botones. El deslizador solo puede mostrar lo que el dispositivo le comunica a Hermetry, así que el ESP32 tiene que informar la posición después de cada movimiento, ya sea desde un botón o desde un comando.Apuesto a que el salto de vuelta se debe a su enlace de Current value. Revise a qué apunta la ranura Current value del deslizador. Si lee algo que solo cambia cuando envía (o nada), vuelve a ese valor. Enlácelo a una clave de telemetría que el propio ESP32 envíe, por ejemplo damper1_pos.En el ESP32, después de cualquier movimiento:
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
Ajustes del deslizador que nos funcionaron: Minimum 0, Maximum 90, Step 15 para que coincida con los pasos de los botones. El deslizador envía una vez al soltarlo, no mientras arrastra, así que el servo no recibe un bombardeo de órdenes. Para una compuerta puede activar Ask before running off; si no, recepción recibe un cuadro de confirmación en cada movimiento. Deje el comando en nivel Basic, una placa no envía nada superior.También está «Disable the control when the reading is old», activado por defecto. Si el ESP32 solo informa cuando hay cambios y nadie la ha tocado en horas, el deslizador puede aparecer en gris. Haga que repita la posición cada pocos minutos junto con las demás lecturas.Los pasos de configuración están en Control cards.
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.

