this post was submitted on 31 Oct 2025
9 points (100.0% liked)

homeassistant

19326 readers
11 users here now

Home Assistant is open source home automation that puts local control and privacy first.
Powered by a worldwide community of tinkerers and DIY enthusiasts.

Home Assistant can be self-installed on ProxMox, Raspberry Pi, or even purchased pre-installed: Home Assistant: Installation

Discussion of Home-Assistant adjacent topics is absolutely fine, within reason.
If you're not sure, DM @GreatAlbatross@feddit.uk

founded 2 years ago
MODERATORS
 

I've got a cheap salt lamp with a LED inside and it runs on a 5V wall wart. I think it originally had a USB plug but I cut that off and connected it to an old 5V power supply.

I've never used esp32, but I've been doing some reading and it seems like an esp32-c6 will allow me to do this with ZigBee.

Does this sound reasonable? Are there other options I should consider?

top 17 comments
sorted by: hot top controversial new old
[–] paf@jlai.lu 7 points 6 months ago (1 children)

You can also use a ZigBee smart plug and connect your 5v power supply to it

[–] GreatBlueHeron@piefed.ca 1 points 6 months ago (1 children)

I have a bit of an aversion to smart plugs - they seem like a bit of a kludge. I totally understand there are lots of cases where there's no other option, but I don't think this is one. I'm also looking to learn about esp32 and I'm just sanity checking that this is a reasonable thing to do with one.

[–] IsoKiero@sopuli.xyz 2 points 6 months ago

I’m also looking to learn about esp32 and I’m just sanity checking that this is a reasonable thing to do with one.

It sure can do what you're after. Most likely not on it's own, you'll need a mosfet or a transistor as esp32 likely can't handle the current your light uses. There's plenty of tutorials on how to do the electronics, but cat least you need a mosfet with gate voltage below 5V and a resistor, both are very cheap. Just be careful with the esp32, it's pretty easy to accidentally kill it with a short circuit or miswire.

And while you're at it, esp32 can manage a ton of stuff beyond just blinking an led. You can add light/temperature/movement/whatever sensors, a button to manually toggle the light and whatever else you might think is useful and/or fun to have. It's pretty much a generic purpose computer after all.

[–] klangcola@reddthat.com 5 points 6 months ago

You might need a transistor or relay between the esp32 and lamp, assuming the lamp draws more current than the esp32 can sink.

Easiest solution is probably a Zigbee or wifi switch for the wallwart, but that's not as elegant and a bit overkill :P

[–] Damage@feddit.it 4 points 6 months ago

just get a smart plug like these and put it in from of your wall wart

[–] Zwuzelmaus@feddit.org 2 points 6 months ago (2 children)

A fun little soldering project. I have built 2 of these:

A small ESP (16 is enough, no need for 32) to run Tasmota. Now you have WiFi and MQTT for free, to connect to your HA.

From the ESP you define one PWM output pin that controls a simple MOSFET dimmer circuit (google for the schematic, 4 resistors or so), that feeds your LED.

[–] spitfire@lemmy.world 1 points 6 months ago (1 children)

Did you mean esp8266 instead of 16?

[–] Zwuzelmaus@feddit.org 3 points 6 months ago

That's precisely correct.

[–] dream_weasel@sh.itjust.works 1 points 6 months ago (1 children)

Is there a set of keywords or tutorial video or something I could look at for this? It sounds like the right way to add smarts to dumb devices. I unfortunately don't know much about hardware and the only esp I've ever used is a 32 and I direct followed a tutorial for room assistant to set it up but I have 0 idea how it works.

[–] Godnroc@lemmy.world 1 points 6 months ago

I did a similar project with a raspberry pi pico w and a glitter lamp. I ended up destroying the surface mount LEDs trying to solder them in to the board and instead replaced them with my own. The stirring motor was good, and a button to control it from the outside was a nice addition. Put the whole thing together with ESP Home and it's fantastic. Also allowed me to switch from disposable batteries to a standard USB cable for power.

[–] Grimy@lemmy.world 1 points 6 months ago (1 children)

Look into the Shelly relays. You can put them inline I'm pretty sure if you don't want them in the socket.

[–] GreatBlueHeron@piefed.ca 1 points 6 months ago

I'm aware of Shelly and similar products. they are way overkill for this lamp - it's literally 1 LED and was powered from USB before I modified it to run from a 5V wall wart. I've ordered a few ESP32 boards to play with. I'm pretty confident I can power my lamp from one because one of the tutorials I found for new users was literally making a light switch. The tutorial used a LED for proof of concept and said to replace the LED with a relay to switch a real light.