text_sensor:
- platform: libretiny
version:
name: LibreTiny Version
output:
- platform: gpio
id: output_led_1
pin:
number: P14
inverted: true
- platform: libretiny_pwm
id: output_led_2
pin:
number: P26
inverted: true
- platform: gpio
id: output_led_3
pin:
number: P11
inverted: true
light:
- platform: binary
id: light_switch_1
output: output_led_1
- platform: monochromatic
id: light_switch_2
output: output_led_2
- platform: binary
id: light_switch_3
output: output_led_3
binary_sensor:
- platform: gpio
id: binary_switch_1
pin:
number: P24
inverted: true
mode: INPUT_PULLUP
on_press:
then:
- switch.toggle: switch_1
- platform: gpio
id: binary_switch_2
pin:
number: P20
inverted: true
mode: INPUT_PULLUP
on_press:
then:
- switch.toggle: switch_2
- platform: gpio
id: binary_switch_3
pin:
number: P7
inverted: true
mode: INPUT_PULLUP
on_press:
then:
- switch.toggle: switch_3
switch:
- platform: gpio
id: switch_1
name: Relay 1
pin: P6
on_turn_on:
- light.turn_on: light_switch_1
on_turn_off:
- light.turn_off: light_switch_1
- platform: gpio
id: switch_2
name: Relay 2
pin: P8
on_turn_on:
- light.turn_on: light_switch_2
on_turn_off:
- light.turn_off: light_switch_2
- platform: gpio
id: switch_3
name: Relay 3
pin: P9
on_turn_on:
- light.turn_on: light_switch_3
on_turn_off:
- light.turn_off: light_switch_3
status_led:
pin:
number: P22
inverted: true
Current
- Above works fine
- When lights are off, switch LED is red
- When lights are on, switch LED is blue
Desired
- When lights are off, switch LED is off (no red/blue)
- When lights are on, switch LED is blue
I believe it is possible because I tried changing output.platform
to libretiny_pwm
for output_led_1
and 3
, I was still able to toggle switches 1 and 3 but their LED becomes always off.
Can help? Thank you!