Simple "led on" when a relay is activated

I want a different led to light up when a relay (switch) is on.
can’t seem to find this, I’m sure it’s dead simple.

I have 3 leds and 3 x1k resistors and 3 relays i want the led to react to.
led 1 relay 1 etc…

thanks

Are your relay and led strip integrated into home assistant ?

You will need to give some more information.
I see 1k resistors, so probably a DIY project. Are your leds connected to an esp2866, an esp32, an arduino ? How did you try to integrate them in HA ?

this is for an automated garden beds irrigation automation system

  1. 4ch relay hooked to 3 x 12v solenoid valves: DONE
  2. 4ch relay hooked to esp32s board: DONE
  3. integrated in HA: DONE

I want to add 3 led lights on the “weatherproof box” containing the psu + board + relay.
so that I can see which solenoid is on and if its on at all… so i’d prefer led that get their “triggerl” from the actual switch rather than a programmed automation from HA.
Also I would like to add a physical “killswitch” since these are water valves
I have the button, the soldering and wiring ain’t done yet. so is the programming, that’s mainly the part I need help

do you need more info, just let me know

not a led strip, 3 single led, I want this as a visual to see which switch is activated.

im not sure how you have the relays integrated but you could add the leds to the same esp device with your resistors and then use EspHome.

I’m not sure to understand exactly what you mean.
here is part of my esphome .yaml for this:

switch:
  - platform: gpio
    pin: 25
    inverted: yes
    name: "relay1"
  - platform: gpio
    pin: 26
    inverted: yes
    name: "relay2"
  - platform: gpio
    pin: 27
    inverted: yes
    name: "relay3"
    
output:
  - platform: ledc
    pin: GPIO33
    id: gpio_33
  - platform: ledc
    pin: GPIO32
    id: gpio_32
  - platform: ledc
    pin: GPIO14
    id: gpio_14
light:
  - platform: monochromatic
    output: gpio_33
    id: LED1
    name: "LED1"
  - platform: monochromatic
    output: gpio_32
    id: LED2
    name: "LED2"
  - platform: monochromatic
    output: gpio_14
    id: LED3
    name: "LED3"

Could you clarify what you mean, i’m quite new to coding in general

thanks

They already are on the same esp, the thing is that I dont want to use an automation to light therm up, I want them to be “physically connected” to the switch or so that they could work without code at all. Like a status LED for that pin, when theres current on the pin, the LED light’s up type thing…

Hope it’s more clear what im looking for

Ah I think I know what you mean now.
I’m not great with that also but I’m guessing you could connect the LEDs directly to the relay but you’d need to work out the resistor size to use to drop the voltage down from what the relays running at.
If that doesn’t work you could do the automation side within the Esphome code and then it’s all local code so no worrying about the WiFi etc

Hi,
If I understand you right, you want the LED to be on when the solenoid has it’s relay on as well. You should be able to put the LED + resistor in parallel to the solenoid.
But I am a bit rusty on how to calculate the correct resistor values.

For the Kill Switch again I assume the solenoid needs 12V to be active. You could just use the Kill Switch to cut the power to all the solenoids.

edit: something like this …
image

disclaimer: I have not done this stuff in a while, please make sure you check this carefully. maybe someone else can add some comment here.