I’ve got a very custom high current/voltage lighting system for a tropical environment that houses a lot of reptiles. I built my own controller for that side and it works great. I take a PWM input so that I can feed it control signal from basically anything. So I started to look at porting the logic over to ESPHome because it gives me such a convenient way to manage it all and everything I’ve done already has been 8266/32 based. Ok. so here is where I am:
# Main terrarium lights
output:
- platform: ledc
pin: GPIO23
id: terrarium_light_output
frequency: "1000Hz"
light:
- platform: monochromatic
name: "Terrarium Lights - Fade"
id: terrarium_lights_fade
output: terrarium_light_output
default_transition_length: 1800s
- platform: monochromatic
name: "Terrarium Lights - Fast"
id: terrarium_lights_fast
output: terrarium_light_output
default_transition_length: 1s
# AC controlled basking lights TODO
## Override Buttons for terrarium lights##
binary_sensor:
# Lights On
- platform: gpio
pin:
number: 22
mode: INPUT_PULLUP
inverted: True
name: "swFASTON"
filters:
- delayed_on: 10ms
on_press:
then:
- light.turn_on: terrarium_lights_fast
The long fade is to emulate dusk and dawn and that works pretty good. But I need a series of buttons that will allow me to override the state. The obvious two at the moment are ON and OFF. On immediately setting the lights to full brightness and OFF turning them all off immediately. I’ve been experimenting with binary switches because they seem like the obvious choice. But what I get is on button push, the light immediately turns on. But as soon as I release the button it turns off. And I can see that in my logs:
** push the button **
[20:37:01][D][binary_sensor:036]: 'swFASTON': Sending state ON
[20:37:01][D][light:036]: 'Terrarium Lights - Fast' Setting:
[20:37:01][D][light:047]: State: ON
[20:37:01][D][light:085]: Transition length: 1.0s
** release the button **
[20:37:01][D][binary_sensor:036]: 'swFASTON': Sending state OFF
Could anyone guide me in the right direction?