Search models, users, collections, and posts

smart switch for guests

GIF

Print Profile(1)

All
P1S
H2S
P2S
X1E
P1P
X2D
A1 mini
H2D
X1 Carbon
X1
A1
H2C
H2D Pro
A2L

0.2mm layer, 2 walls, 20% infill
0.2mm layer, 2 walls, 20% infill
Designer
55 min
1 plate

Open in Bambu Studio
Boost
16
29
0
0
1
0
Released 

Bill of Materials

List other parts
  • 2k - 10k Ohm THT resistor x 1:
  • push button x 1: for 12mm thru hole
  • glue x 1:
  • self-adhesive rubber pads x 4: for better surface friction
  • ESP32 D1-Mini x 1: ...or similar footprint

Description

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/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"

 

Membership

Consider supporting me with a membership - this will give me the boost and motivation to upload even more designs! Every single supporter matters to me - and makes me invest even more time, sweat and filament, to bring you the designs you are waiting for. Also, as a member you are able to request changes to my models for your very own purpose and needs!

Join

Comment & Rating (0)

(0/1000)

License

If you want to use this model commercially, please join my membership.
Join Now
This user content is licensed under the MakerWorld Exclusive License.

You may create derivative works based on this object, provided that all such derivative works are published exclusively on the MakerWorld platform and include proper attribution to the original creator. You may not share, upload, host, distribute, or publish this object—or any derivative work of this object—on any other digital platform, marketplace, or distribution channel. Commercial use of this object and any derivative works is strictly prohibited. This includes, but is not limited to, selling, renting, sublicensing, or using the object in any context in which you receive monetary compensation or other financial benefits.