I am new to WLED and I would like to build a cabinet light.
My WLED version 0.12.0 “Hikari”, build 2104020 runs on a Wemos D1 mini and a WS2812E, connected to GPIO2.
Everything is running as desired.
Now I want to switch WLED on and off via a reed relay (contact) as follows:
Door will be opened, reed contact will be opened → light should be switched on.
Door will be closed, reed contact will be closed → light should be switched off.
The reed contact is connected to GPIO0(zero) with a 10K pull-up resistor, as described in the Wiki under Macros and Buttons.
The wiki describes that 2 presets should be created, which are activated by Switch Low2High or Switch High2Low.
Preset 1 contains T=1
Preset 2 contains T=0
However, I do not know how to correctly assign the button states to the presets so that the light is switched as described above!
I have already tried to assign the presets Long and Short Clicks, but I can only switch on the light when closing the reed contact. Nothing happens when I open it.
Maybe someone can help me by posting a small tutorial.
Unfortunately I have already tested this, but it does not lead to any solution.
I think the problem is that you can’t set button actions specifically for a static switch, as described in the wiki:
“For switch buttons you can only assign 2 presets, one for the switch transition from LOW to HIGH and the second for the reverse transition from HIGH to LOW. If you select 0 for the preset, the default action will be set. If you find that the default action for the switch is inverted, please create presets for the On and Off actions and assign them accordingly.”
For Alexa, yes, presets exist in the Time and Macro settings On/Off, but for buttons, only input options exist for Short Press, Long Press, and Double Press.
So the question is, where do you have to enter the presets for for ON (High2Low) and Off (Low2High) in the Time and Macros settings if you use a static switch (reed contact)???
I just took the wrong firmware from WLED-wemos-shield: wemos_shield_esp8266.bin
Thera is no possiblity to define a GPIO Pin for the switch and configuer the Presets in Time&Macros.