Nouveau : le pare-feu IA surveille toute la plateforme et explique chaque incident en termes simples. Découvrez comment ça marche

Reply To: Pump relay on an ESP32 clicks at boot and the board switch says On when it isn’t

I did the same pump setup for a uni project, both issues bit me.

Relay: move it to GPIO 26 or 27, they stay quiet through boot. Most of these blue modules are active LOW, so set the level before switching the pin to output, otherwise you get a short pulse anyway:

digitalWrite(26, HIGH);   // relay off for an active-low module
pinMode(26, OUTPUT);

Also take the JD-VCC jumper off and feed the relay coil from its own 5 V, keep only VCC/IN/GND from the ESP. A coil on the ESP’s USB 5 V can brown it out when it pulls in.

Board: the switch shows what you bind as its current state. Have the firmware report {"pump_state": 1} after it actually switched, and bind the Switch card’s Current state slot to pump_state. The card then shows the device’s reported state once it arrives, not what was clicked. Leave « Disable the control when The reading is old » on (it’s the default), and also tick « The state is unknown », so nobody can flip it while the ESP is offline. Keep « Ask before running » on for a pump, that’s the default too. Card settings: Control cards

Timestamps in UTC or it didn't happen.
Solution acceptée♥ 6