Privacy friendly ESP32 smart doorbell with Home Assistant local integration
tristam.ie
tristam.ie
You can also slap a reed switch (e.g. a normal door open/close sensor) near your dumb doorbell's magnetic coils that do the ringer and have it send the info to home assistant.
I hooked a $0.50 reed switch up to my dumb doorbell and ran it to a digital IO port on a ESP that's powered from the same power source as the doorbell coils. When it senses a doorbell press, it sends me an email snapshot from my local-only front door cam and plays a recording of the doorbell chime on my upstairs stereo (where otherwise I can't really hear the chime). Very convenient and fun.
Originally, I tried monitoring voltage on the coils with the analog input, but it was way too unreliable. The simpler reed switch method of detecting current is rock solid.
Beautiful thinking. I wonder what other obscure sources for voltage in a house could be used? The HVAC head unit, analog telephone, ...
The POTS [(Plain Old Telephone Service)] phone line, with all phones on-hook, should measure around 48 volts DC. This drops down to the 3 to 9 volt range when a telephone on the line goes off-hook. An off-hook telephone typically draws about 20 milliamps of DC current to operate, at a DC resistance around 180 ohms. The remaining voltage drop occurs over the copper wire path and over the telephone company circuits where there is usually 200 to 400 ohms of series resistance to protect from short circuits and decouple the audiocircuits.
Gigabit Ethernet uses all 4 pairs for data, so Gigabit PoE and faster must have data+power on one or more pairs.
From https://en.m.wikipedia.org/wiki/Power_over_Ethernet :
> In addition to standardizing existing practice for spare-pair (Alternative B), common-mode data pair power (Alternative A) and 4-pair transmission (4PPoE), the IEEE PoE standards provide for signaling between the power sourcing equipment (PSE) and powered device (PD). This signaling allows the presence of a conformant device to be detected by the power source, and allows the device and source to negotiate the amount of power required or available while avoiding damage to non-compatible devices.
> The simpler reed switch method of detecting current is rock solid.
That's really clever! I'm gonna try that. Thanks for sharing.
I have used them in a similar way stuck to the top case of relays to detect when the coil is energized without probing directly into the control or load circuits.
More seriously, would there be any electrical or interference issues with running usb-c power delivery cables everywhere?
PoE, of course, can go as far as the ethernet (usually) and so any future low-voltage system in homes will probably be based on it (it's already used in some commercial setups).
So to carry the same power, a lower voltage wire has to be thicker.
There are no 12V standards for wiring buildings, because effectivity-wise, it make no sense. Even the above-mentioned PoE is 48-56V (56V, so it can be 48V at the other end of up to the 100m long cable). The 5-12-20V USB PD is for relatively short cables, not for something that goes around your house.
Is it straightforward to step down the voltage from PoE to something that USB-C can use? My Forest M Mims Electronics book sits unread and dusty in a box somewhere so I'm not really able to interpret the schematics google is showing me :/ (apologies for extra questions)
For DYI, there are dc-to-dc convertors available. Or do you intent to build your own?
The idea is: pull in a quick 3D sketch of a home. Place (USB-C via PoE-power?) ESP32/Pi/Other devices at specific points with very precise measurements between them. Use them to determine the exact position in 3D house-space of Bluetooth low energy beacons. Use that info to help my very ADD wife find the things she loses. (because Tiles often fail)
A lot of the code to calculate position from timings already seems to be out there so I can cargo-cult things over.
In a far-too-roundabout way, that sorta kinda answers your question.
But people who are uncomfortable running mains will often be fine running "low voltage" lines like ethernet.
The lower the current, the lower the losses. Resistance doesn't change. I^2*R is what decreases with current.
All they care about is that you can't run more current down a wire than it's rated for.
Each leg of 240 is only 120, so it'd probably work.
Don't do it! But if you do it make sure it's breakered correctly and use a AFCI/GFCI combo breaker.
[0] https://getneocharge.com/products/neocharge-smart-splitter
We have some IEC 60309 outlets for IT/AV equipment cabinets wired as 2P+E with both phases presented for 240V (no neutral). You can get PDUs which are happy with 200-250V, and the PSUs in a lot of servers and switches are happy with 100-250V 50-60Hz.
https://www.leviton.com/en/products/residential/usb-charger-...
Move the USB-C PD inverters to be integrated into the outlets, instead of plugged in on top. I already did this upgrade for all counter-height outlets in my kitchen, and it's great!
The holy grail, of course, would be ethernet/data as well, but that is far more cost prohibitive
I never thought about converting POE to USBC-PD but that would be a great thing to add to the “office” and locations where someone may very occasionally want power for a laptop (eg near couch, beds)
I’m exclusively using “normal” 120v outlets that also have a 5v usb port on it, and placing extra where I can, which is less crazy but still practical.
We have separate lighting circuit that we could switch, but that's about it. And at that point it would be easier just to allow for thimmer 22AWG 120v 0.8A lines or something.
But electric codes assume people might want incandescents, that's not possible with just PoE.
I'd love it if we had wall outlets for USB that look like network adapters to the PC though. Why do we still use RJ45 when consumer stuff doesn't get past 1gbps?
The real killer is when you want to "do something physical" in the real world on batteries, like unlock a door, etc.
That nobody has come up with a powered doorjamb instead of powered deadbolts is annoying; I'll have to build one myself using something like https://www.americanlocksets.com/hes-1006cdb-electric-smart-...
That said, I'd love an ESP32 for Zigbee. I bought an H2, but the documentation hasn't been good enough that I could make it work.
Non-isolated: https://www.olimex.com/Products/IoT/ESP32/ESP32-POE/open-sou...
Isolated: https://www.olimex.com/Products/IoT/ESP32/ESP32-POE-ISO/open...
Granted, they fit different use cases as the wESP has more I/O exposed but is quite a bit larger.
We have one in an OpenEVSE, it's been ticking along no problems for a couple years now. In that scenario, in theory the PoE allows the ESP32 to detect if the EVSE breaker pops - I've not had that happen, but it seemed like a worthwhile feature to consider ;).
If it's running off PoE it's not like you have to worry about battery budget or efficiency so much.
Not sure if there are insulating materials available that provide good thermal insulation but not acoustic insulation?
When I get my own place I'll get KNX.
I know it's a longshot, but has anyone here created a home positioning system for home that can use Bluetooth low energy beacons to locate objects to within a couple of centimetres in 3D space?
More ontopic: ESP32s are pretty amazing. Although I've not been able to keep mine stable and connected to wifi with MicroPython or CircuitPython, the range of stuff that's possible is astonishing. Mine is fairly old, I probably should get a newer one to see if it makes a difference.
The maker of the wESP32 also recently released a neat RP2040 based PoE solution you may be interested in: the RP2040-Shim [3] to match the already-existing PoE-FeatherWing [4]. Together, they're a small, neat solution.
(Not involved with those products, just found them well-designed/interesting.)
[1] https://wesp32.com/ [2] https://www.olimex.com/Products/IoT/ESP32/ESP32-POE/open-sou... [3] https://silicognition.com/Products/rp2040-shim/ [4] https://silicognition.com/Products/poe-featherwing/
Well, what do you expect? These are verboten for any kind of reliable embedded system.
I've used it extensively and it is great. With ESP32 peripherals you can even get extremely tight timings depending on what specifically you need. And of course any specific performance critical code can be written in C and everything else can be micropython.
It's great, definitely worth exploring.
I have no doorbell. If a visitor does not know how to get hold of me or the other inhabitants of my property, then they probably have no business being there in the first place.
I am not alone in this. Most people in my street are the same (based on my very unscientific study last week while out on a walk), and probably most of my city is like this (again, based on my own unscientific study)
Doorbells feel anachronistic. Barely anyone on my street has one!
Sounds pretty cold. I've had neighbors come over to introduce themselves, some even with welcoming gifts when we bought the house and moved in. I'd hate to just shut myself out of the society like that.
"Society" has done this to us.
> I've had neighbors come over to introduce themselves, some even with welcoming gifts when we bought the house and moved in.
It's not like we have a moat and drawbridge. Not answering the door is a generalization, that admits of exceptions.
I have a postbox at my local post office. My official mailing address points there. My tax authorty and (and all other governmental or official correspondence for that matter) is sent via email. I get almost no paper mail these days, and most of what I do get is junk.
Plus generally having a recording of your front porch area is useful for security. I've been able to pull video recordings of stuff to prove/disprove things happened, for instance when the mailman ran over a bunch of stuff in my front yard and drove off.
The above mentioned Reolink doorbell will happily run with any NVR from any other vendor that supports relevant standards (ONVIF). Or even without NVR (it has microsd slot for local storage on device).
They have released a standalone POE product, separate from the WiFi offering which has the USB-C to POE cable.
The console can be self-hosted on any device.
AQ monitor. I work indoors a lot and I think the migraines I've been getting might be caused by dust, VOCs, or pollutants. So will be good to back that with some data.
Robots. Lots and lots of robots. Some roll. Some walk. None of them do anything useful. :-)
It would be nice to see some example videos or pictures. I’ve played with ESP32 Cams in the past and, while they are impressive for what they are, they weren’t at the quality I, personally, would want. Granted, my smart doorbell use case is more security focused than just general “is someone there”.
I really love the ability to listen for ONVIF events; it expands the flexibility of products like this because you can essentially do whatever you want if you consume the events. There are even ways to create custom events (for example, if someone covers the camera lens with their hands, etc).
Home Assistant has excellent ONVIF support - I'd like to create a wrapper of sorts around scripts (Boolean door open, door close stuff) in order to get the native ONVIF events
That said the ESP32 is far more powerful than you need for the vast majority of home automation type devices, it's only a handful of more intensive tasks like streaming video or ML where you start to run into issues. Even then you can often still do quite a lot if you're clever.
Keep meaning to get around to Frigate for smarter alerts as well, for people detection.
pin:
number: GPIO14
mode: INPUT_PULLDOWN
This is a suggestion based purely on two minutes of web search, not on experience, though.[0] https://github.com/thatguy-za/esp32-cam-doorbell/blob/main/e...
If you have an "old fashioned" 24VAC line, you could add a rectifier and buck/step-down power module to drop that to 5VDC. Or just unhook the 24VAC transformer and install a 5VDC one.
It would have been neat to see how much the RGB ring lighting up white helps in no/low light cases. All in all, nice writeup!
Local cameras have been a thing forever, as is local access control and thermostats, but video doorbells surprisingly have primarily been cloud based in their history.
I haven’t gone super deep into home assistant yet, but my plan is to use a mix of direct control and HomeKit commercial offerings.
Time was, if a neighbour insisted on daily filming a family entering and leaving their own home, they would have been given a smack in the mouth for being a nosy bastard.
Quite how recording your neighbours has become socially acceptable I will never understand.
I refuse to have cloud connected cameras, but I understand why my neighbors have made the choices they have.
I wonder if a remotely openable porch-side "mail box" would find a market.
Usually they give you the choice of what to do.
Though having said that, I live in the UK and do occasionally just get parcels left on my very public doorstep. It's the exception though.
I'm cynical, but I imagine it goes like this:
"Hello, this is 911, how can we help you?"
"I'd like to report a 39.99 board game stolen off my porch, license plate ZXX-1234"
"Sir, this line is for emergencies. Have you filed a claim with Amazon?"
Porch cameras drive mass paranoia. If you're not prepared to act on the information yourself, you're just feeding your own fear.
Our package got nabbed, a person noticed the empty box tossed on a nearby street and called the cops. Cops got video from a near by house an image of a unique car; month later they saw the car, arrested him.
He paid for the package and got community service.
The police took the report, but obviously they weren't interested in coming out to take the details of the thief or help me recover the package.
The doorbells also notify you of packages that have been left outside and let you answer the door remotely, which are both useful even if you can't go Blade Runner.
Of course, Rings are essentially worthless for vehicle identification. You would need LPC (License Plate Capture) cameras set up in two directions just for that. They aren't even particularly good for facial identification.
Really, if you wanted something actionable, you would do what I had seen someone else done, which was capture plates and have the right cameras and ... as the secret sauce, an IMEI catcher, filtering out the usuals and highlighting who just blasted past.
If it is one of the Kia Boys around here, they just get out and re-offend.
I'm starting to think it's all a giant "bullshit" test to see how far they can push people's obedience. Or they end up conveniently filtering out the people they don't act obedient to the level of filter they've set with their stupid laws and non-enforcement of existing ones like theft.
It's not like people want to put up telescope cams into your bathroom, I think most people would be very against that.
Meanwhile they try to take encryption and anonymity tech away from citizens, in those same exact places.
It isnt - I consider it a blank cheque for 100k whenever I want to cash it.
In most U.S. jurisdictions, including WA (which has some of the more stringent law regulating recording), if you’re stood on their property or even on the street, surveillance of you is legal. About the only obligation you may have is to post signage.
Recording audio conversations is a bit trickier. In WA, they have RCW 9.73.110 [1] which does make provision for any cameras “within [the] building” recording audio — it’s therefore generally best for exterior cameras to *not* record audio given WA is a two-party consent state (with a few exceptions).
Edit: Looks like the person making this ESP32-based solution is in Ireland, which has its own peculiarities but with a bit of effort, it seems like you’d have no issues there either [2].
[1] https://app.leg.wa.gov/RCW/default.aspx?cite=9.73.110
[2] https://smartzone.ie/are-home-cctv-systems-legal-in-ireland-...
UK: https://www.brettwilson.co.uk/blog/neighbour-cctv-harassment...
https://www.judiciary.uk/wp-content/uploads/2022/07/Fairhurs...
Previously - Scotland: https://www.lexology.com/library/detail.aspx?g=854e9b90-2dab...
Daily Mail on the issue: Could EVERY doorbell camera owner face £100,000 fine after landmark ruling? How inadvertently filming neighbours and storing footage breaches their privacy under new data protection laws https://www.dailymail.co.uk/news/article-10087671/EVERY-Ring...
Depending on the specific circumstances, the domestic use of CCTV could be challenged if its use amounted to harassment under the Protection from Harassment Act 1997.
Some of the analysis away from the front pages has been interesting [1] though:
“During the hearing, some of the main issues under investigation related to:
the field and depth of view of each camera, in particular whether they couldn't ‘see’ Dr Fairhurst or her visitors entering and leaving her property, her car, or the car park;
the sensitivity of their microphones;
the extent to which the devices activated themselves automatically, or were triggered, to capture, transmit or record video images and/or associated audio from the field of view;
whether Mr Woodard consulted neighbours sufficiently before installation or provided adequate notices or warnings after installation of the equipment; and
how and for what purpose Mr Woodard stored and processed the data produced by his devices.”
It looks like neighbor tried to solve this without a court case and he was perhaps not receptive to that approach.
[1] https://www.traverssmith.com/knowledge/knowledge-container/f...
This is exactly why I mostly like privacy laws but think they go slightly too far.
The problem becomes when a corporation begins filming most neighborhoods and then handing it over to the cops w/o a warrant.
As for the smacking of mouths, I'm glad certain norms have changed.
I guess the author found the ease of use of an ESP32 to be an acceptable tradeoff (or didn't consider its firmware to be a problem). Others may feel differently, and can modify their build accordingly.
Their SDK is Apache licensed but does include some compiled radio-frequency stuff: https://github.com/espressif/esp32-wifi-lib/tree/master/esp3...
That said, there are some who flash Pi Zeroes as "bare metal" or no operating system:
So that you are not relying on WiFi?
I'm not aware of any ESP32 boards with a camera and ethernet though, but I haven't gone looking on AliExpress either. It's a reasonable combination, so I'd be surprised if it didn't exist.
[0] https://smartlight.me/smart-home-devices/zigbee-devices/smli...