Hi, I’m a beginner with ESP and I’m making an automatic irrigation system on ESP32 and I have a problem with the control of the solenoid valve. When I turn on the power on the relay (OKY3030 OKYSTAR), the red LED (power) turns on and the green +SW is on all the time. I found a simple code and use it in Home Assistant:
switch:
- platform: gpio
name: "Solenoid valve"
pin: GPIO26
restore_mode: ALWAYS_OFF
A button has been created in the HA panel that I should control the valve with, but the valve is on all the time. When I use this button, the green LED dims slightly. The 5V power supply is from the ESP (USB-C cable connected), and the solenoid valve is powered by 12V DC. In the attachment I add a wiring diagram. Please help me to solve the problem.