"I made lighting controlled by a ESP32, then put it inside the brush and connected the button to it."
But reading the twitter replies further down the chain, it seems the toothbrush sends data to the charging base, and the ESP resides there and analyzes the signals sent to the base? Much more interesting. Twitter's character limit really killed this post.
Unrelated, all the hashtags and @s make Twitter quite hard to read. The @ and # characters should be hidden for readers.
Just bad EMI immunity.
The espresso machine has no low voltage electronics, it is basically just switches, thermostats, a heater, a pump and and a valve. It has two inductive components, a pump and a solenoid valve with no protection. This is a recipe for huge amount of EMI when the devices are turned off (when inductive component is turned off at a right time the voltage rises and can cause spark and high voltage that is applied to the outlet).
Since the grinder is connected to an outlet close by it is subject to EMI. I have not looked inside the grinder but there there are components like thyristors and triacs which are used to keep a device turned on until it decides otherwise, that can get turned on by EMI. Generating enough voltage can cause a thyristor or triac to turn on by itself which is then enough to keep it turned on and cause the device to wake itself up without the user pressing the button.
I will also add that I have two versions of the grinder. Only the older one is affected by the problem. I find it likely somebody spotted and fixed the problem (it is extremely easy to fix just as it is extremely easy to overlook).
0. https://www.ebay.com/itm/262809348271 It's probably not the best or cheapest available.
I was expecting something silly like Siri Shortcuts... tbh
For most peoeple the act of brushing their teeth marks waking up or going to bed.
With such data exposed and combined with timing data you could trigger morning or night time routines. For example, the toothbrush transitioning from running -> idle after 8pm and before 4am could cause the bedroom to go into sleep lighting (gold at 40% fading out over 15 minutes), all other lights to be turned off, all smart plugs turned off, house alarm set to armed, heating turned off and so on..... or I could just continue to be silly and turn it into a TV controller https://twitter.com/imduffy15/status/1256954852996939777
The setup of "automatically adjusts lighting based on finishing brushing teeth before bed" could easily be "the bedroom lights do random and frustrating things when I'm trying to get ready for bed". The problem is complex interactions are hard to see, like what happens when someone does something out of order, or adjusts the lights to their liking before brushing teeth, or is brushing early after a late dinner or garlicky snack but not going to bed yet.
That said, if you can do it without annoying others, go nuts! It's super fun, and it's a great learning experience to spend weeks interacting with your software from the real (physical) world. You'll find tons of edge cases, and figure out how to deal with race conditions, less than 100% reliable signals, etc.
Some of my most useful automations are very subtle, like turning on a couple inside lights as it's starting to get dark outside but only if there aren't any lights already turned on. If we're home (and have manually adjusted lights), nothing happens. Yet we never come home to a dark house (There's a similar automation for front outside lights too). This is quite a bit more complicated than a simple timer, yet is so intuitive that you don't even realize you're interacting with it.
It’s sort of like a management consultant: The bluetooth allows my phone to tell me when I’m brushing my teeth. So I paid big bucks to find out something I already know.
― George Bernard Shaw