Você está no 3DFinder
Buscamos em Thingiverse, MakerWorld e Printables ao mesmo tempo para te dar o melhor de cada uma.
Descrição
All smart home enthusiasts will know the issue - you have visitors and they are helplessly looking for a light switch, instead of admiring the level of automation that you have acomplished!
Nevermind, here is my solution.
I am running Home Assistant and the easiest way to set up a custom smart device is using ESPHome.
Add the provided code below to the bare configuration code of your connected ESP32 D1-Mini and upload it.
Solder the push button between GND pin, the resistor and pin IO27 or whichever pin you decided on using. Just remember to update your code accordingly.
What I used:
[https://amzn.eu/d/0c0x6rg0](https://amzn.eu/d/0c0x6rg0)
[https://amzn.eu/d/0c2IX5pa](https://amzn.eu/d/0c2IX5pa)
For the look I have spray-painted the parts. Then, insert the pre-soldered ESP32, the switch and glue the two halves of the case together.
This switch ads a little fun to switching!
Here the code, just copy/paste:
switch:
- platform: template
name: "Toggle State"
id: toggle_state
optimistic: true
restore_mode: RESTORE_DEFAULT_OFF
binary_sensor:
- platform: gpio
pin:
number: GPIO27
mode:
input: true
pullup: true
inverted: true # gedrückt = ON
name: "Taster"
id: taster
filters:
- delayed_on: 20ms # Entprellung
on_press:
then:
- switch.toggle: toggle_state
# Optional: langer Druck als separate Aktion
on_click:
- min_length: 1000ms
max_length: 3000ms
then:
- logger.log: "Langer Druck erkannt"
Gostou deste modelo? Crie uma conta grátis para salvar seus favoritos e voltar a eles depois.
Criar conta