I’m having trouble getting my Sonoff Basic LED to turn on/off with the relay. I can turn the relay on/off and the LED on/off. What I want is for the LED to turn on when the relay is switched on, and off when the relay is switched off.
My sonoff config:
switch:
- platform: gpio
name: "Sonoff 1 Relay"
pin: GPIO12
id: relay
- platform: template
name: "Sonoff 1 relay"
optimistic: true
id: relayandled
turn_on_action:
- switch.turn_on: relay
- light.turn_on: led
turn_off_action:
- switch.turn_off: relay
- light.turn_off: led
output:
- platform: esp8266_pwm
id: sonoff_1_led
pin:
number: GPIO13
inverted: True
light:
- platform: monochromatic
name: "Sonoff 1 Green LED"
output: sonoff_1_led
id: led