I felt my diffuser’s timer was too basic - needing to be manually turned on, then manually turned off by repeatedly pressing a button. So I connected an ESP8266 to the momentary switch, added some very simple ESPHome code, and now I have a diffuser that can operate for a few minutes at a time, or from any automation in Home Assistant that can be dreamed of.
I love that it’s so easy to do this even to quite dumb devices. It turns something that was staying in a drawer and not being used into something that is now genuinely useful in providing a nicer space for my family.
EDIT: Sorry, seems the link didn’t make it into the subject, so here’s the full step by step https://digdilem.org/home-automation/smarter-diffuser/


It’s just using the ESP to close a NO (normally open) circuit to closed, effectively shorting those two in the same way the momentary switch would. The code causes the ESP to create that short between its GND and the GPIO D5, thus closing the switch.
If this was using any significant amount of current, you’d add a relay in there as the ESP can only handle a tiny amount in this configuration - but for small PCB loads like this, it’s normally fine.
Oops - looks like I missed a file extension off. Fixed now, thanks.