@po3mah@mastodon.social
@po3mah@mastodon.social avatar

po3mah

@po3mah@mastodon.social

I fix things that are not worth fixing because I can't fix people.
Hiking, travels, guitars, tech/IT tinkering, science, mgmt, DIY, books, homeassistant, 3d printing, anti anti-intellectualism,
3 kids, 1 wife, some animals, garden, 4 composts.

Language: ENG/SLO

All posts are CC BY-NC-SA 4.0 + AI scraping etc. by corporates is not allowed.

Tomislav Rozman

This profile is from a federated server and may be incomplete. Browse more on the original instance.

tomi, to homeassistant

Link to the original blog post with a nice text/pictures layout.

The problem:

  • kids keep forgetting to carry the key to unlock the front door. They never forget to carry their phones though.

The solution:

  • unlocking the front door using a mobile phone

HW parts:

SW:

The process:

  1. I installed a wall box near the front door, under a nearby electrical socket (see below)
  2. When the company installed the front door, I asked them to install a UTP cable from the door lock mechanism to the socket.
  3. Bought the materials above (Aliexpress for the boards, Conrad for the power suppy).
  4. Connected the mains to the breaker (for emergency switch-off)
  5. Connected the cables from the breaker to the 24V power supply
  6. Connected the cables from the power supply to the ESP32 board, door solenoid relay and ESP32’s relay. Luckily, I didn’t need to install 5V power supply for the ESP board, because it also works with 24V.

Here’s the doodle of the connecting scheme:

doodle of the electrical schemeHere’s the original connecting scheme from Innotherm (door manufacturer), in Slovenian: It was useful because it reveals which power supply is appropriate (Meanwell MW HDR 30-24).

the electrical scheme for wiring the door unlocking mechanism7. Fitted everything in the wall box. It was too shallow! I couldn’t hide all the junk with the flat cover that came with a box.

Before fitting:

circuit breaker, power suppy and esp32 board hanging out of the wall boxEverything nicely fit in a box:

circuit breaker, power suppy and esp32 board nicely ft in the the wall box8. I designed and 3D printed a new cover in TinkerCad:

3d model of the wall box cover10. After a 3rd try (of 3D design and printing), all measures were finally correct and I could cover the box (Mastodon post):

wall box cover mounted11. Flashed ESP32 board with ESPHome*, added it to Home Assistant.

(*Actually it wasn’t that simple. The board doesn’t have a data USB connector. I had to buy USB2TTL adapter. I was bitching about it here.)

esp32 board with usb2ttl adapter connectedNevertheless, after the firmware update, I edited .yaml for the board so it exposes:

Main entity:

  • Switch (for controlling relay), connected to GPIO16

Misc. entities:

  • LED light (connected to GPIO 23, to signal when the door is opened)
  • Wifi sensor (for checking the power of Wifi signal, because the esp board is located in a wall box)
  • Uptime (to see the time since the last esp board reset)
  • Restart switch (to remotely restart the board if needed – but until now it wasn’t needed)

.yaml code for ESPHome (gathered from various websites, mainly from ESPHome):

... skipping the first part, wifi connectivity, substitutions etc.light:  - platform: status_led    name: "ESP32-rele01-vrata Led"    restore_mode: ALWAYS_OFF    pin:      number: GPIO23      inverted: Falseswitch:  - platform: gpio    pin: GPIO16    name: "Door lock switch"    inverted: False  # The following can be omitted  - platform: restart    name: ${devicename} restartsensor:  - platform: wifi_signal    name: ${devicename} wifi signal    update_interval: 600s  # human readable uptime sensor output to the text sensor above  - platform: uptime    name: ${devicename} Uptime in Days    id: uptime_sensor_days    update_interval: 60s    on_raw_value:      then:        - text_sensor.template.publish:            id: uptime_human            state: !lambda |-              int seconds = round(id(uptime_sensor_days).raw_state);              int days = seconds / (24 * 3600);              seconds = seconds % (24 * 3600);              int hours = seconds / 3600;              seconds = seconds % 3600;              int minutes = seconds /  60;              seconds = seconds % 60;              return (                (days ? String(days) + "d " : "") +                (hours ? String(hours) + "h " : "") +                (minutes ? String(minutes) + "m " : "") +                (String(seconds) + "s")              ).c_str();time:  - platform: homeassistant    id: homeassistant_time# Text sensors with general information.text_sensor:  # Expose ESPHome version as sensor.  - platform: version    name: $devicename Version  # Expose WiFi information as sensors.  - platform: wifi_info    ip_address:      name: $devicename IP    bssid:      name: $devicename BSSID  # human readable update text sensor from sensor:uptime  - platform: template    name: Uptime Human Readable    id: uptime_human    icon: mdi:clock-start    
  1. I’ve put an NFC sticker on the door.

  2. Wrote 2 simple automations that open a relay when the phone touches the NFC sticker and closes it after 1 second:

screenshot of the door unlock automation2nd automation switches the relay off after 1 second (also blinks the red status led on the ESP board):

screenshot of the door lock automation14. Added Aqara Door sensor to the door and connected it my existing Zigbee network using Zigbee2MQTT. It’s for logging when the door is open and for turning on the red status LED on the ESP32 board when the door is opened.

aqara door sensor mounted at the edge of the door15. Added a new control dashboard in Home Assistant for tracking what’s going on with the door:

dashboard in home assistant with various door statusesConclusion

After 6 months, it works great. Kids are satisfied and me too, because this is one of the first usable HomeAssistant projects that involve some electronics and physical devices. It works in 99% of cases.

There are some issues with it though:

  • The ESP32 board sometimes reboots after unlocking. It seems that the door solenoid relay draws too much current and the voltage from the power supply drops momentarily. Probably I need to add a capacitor to the board power input to smooth the voltage. This is not a big issue, because the board starts working normally after 3 or 4 seconds after the reboot.
  • Once or twice it happened the esp board relay got stuck in an OFF state. I had to hit it gently with a screwdriver to unstuck it. After that, I reduced the time the door solenoid is opened from 2 to 1 sec. Not sure if it will help. Maybe it’s just a bad relay.
  • Several times the wifi was down and the board couldn’t communicate with the Home Assistant. It looks like my telco provider’s router is not the best one and it freezes sometimes. Probably I need to buy a better wifi router.

TODO

I have several ideas on how to upgrade the unlocking mechanism:

  • unlocking with a fingerprint
  • unlocking with facial recognition

Disclaimer

The links to the products are not affiliate links and I don’t receive any compensation for linking.

The code and the ideas are mostly from HomeAssistant and ESPHome community forums.

https://blog.rozman.info/unlocking-the-front-door-using-the-mobile-phone-and-home-assistant/

doodle of the electrical scheme
the electrical scheme for wiring the door unlocking mechanism

po3mah,
@po3mah@mastodon.social avatar

@jkmcnk @tomi Hm, kateri končni navor?

po3mah,
@po3mah@mastodon.social avatar

@jkmcnk @tomi
User v HA.

po3mah,
@po3mah@mastodon.social avatar

@linjari @tomi Thanks! I have no idea how to calculate the correct values for the cap, will try to find out how...
The power supply is rated as 24V 1.5A max.

po3mah,
@po3mah@mastodon.social avatar

@jkmcnk @tomi O, pa res, sploh nisem opazil. Bom uveljavljal reklamacijo, ker herezije pa ne bom podpiral.

po3mah,
@po3mah@mastodon.social avatar

@linjari @tomi Great, thanks!
Will try to put one 1N4001 in a series with a relay.
https://en.m.wikipedia.org/wiki/1N400x_rectifier_diode

po3mah,
@po3mah@mastodon.social avatar

@jkmcnk @tomi Ti se kar hecaj, nekoč v zgodovini se je nekdo tudi hecal in so ga resno vzeli in zapisali. Sedaj pa imamo enote, kot so "large boulder in the size of a small boulder" in podobne. :)

bagder, to random
@bagder@mastodon.social avatar

“I could rewrite

Here's my collection of some less cheerful quotes to keep me firmly grounded. Blogged three years ago today:

https://daniel.haxx.se/blog/2021/05/20/i-could-rewrite-curl/

po3mah,
@po3mah@mastodon.social avatar

@bagder The ultimate art is to make complex things look simple.
These comments are pure flattery.

thomholwerda, to random
@thomholwerda@exquisite.social avatar

LADIES, GENTLEMEN, AND LUNA'S

IT'S HAPPENING

STOP EVERYTHING YOU'RE DOING

YES, YOU TOO GREG

NEW MÜNECAT VIDEO

https://www.youtube.com/watch?v=31e0RcImReY

po3mah,
@po3mah@mastodon.social avatar

@thomholwerda This will make a lot of men angry and I giggle for that:)

po3mah, to random
@po3mah@mastodon.social avatar

Now that #musicassistant indexed my mp3 archive I'm keeping and growing since 96' I found out there are 2000 albums and 24000 songs.
Looks like I'm ready for the apocalypse.

phocks, to random
@phocks@bne.social avatar

Book 2 of 100. Just finished this one. Sharp Objects by Gillian Flynn. From the reviews it seems this one wasn't as well received as her other novels, but I actually really enjoyed it. I don't read too much modern fiction, but I wanted to give this one a try, and I'm glad I did. I love her writing style. I don't know why. There's just something about it. Maybe I'll give Gone Girl or Dark Places a go sometime.

po3mah,
@po3mah@mastodon.social avatar

@phocks same happened to me: when I exported everything from Goodreads, I found books in my list that I never read.

jkmcnk, to random
@jkmcnk@mastodon.social avatar

what a time to be alive. 😜 https://www.tomazgorec.si/knjiga/

po3mah,
@po3mah@mastodon.social avatar

@jkmcnk pa kje ti to najdeš?

po3mah,
@po3mah@mastodon.social avatar

@jkmcnk preletel sem kazalo in ... :shut up and take my money

EUCommission, to random
@EUCommission@ec.social-network.europa.eu avatar

Our commitment to the fediverse is here to stay.

Today, we launched our new Mastodon instance. It will ensure a privacy-focused space to engage with and get the latest from our Commissioners, departments, and the official voices of the Commission.

We want to thank @Mastodon for stewarding us and helping us make this possible.

Fostering European digital players is vital to our strategy for a stronger .

This is a unique opportunity to grow the community even more. Let's get there!

po3mah,
@po3mah@mastodon.social avatar

@EUCommission @Mastodon I see you managed to transfer old posts and accounts. Good!

bedast, to homeassistant
@bedast@squirrelmob.com avatar

Ugh, having issues with my Zigbee network after some updates. Not sure if issues with Zigbee2mqtt or issues with the coordinator.

Since ZHA has had such big advancements recently, I'm now getting tempted to migrate back, and maybe see if it does a bit better.

po3mah,
@po3mah@mastodon.social avatar

@bedast z2m 1.37 and sonoff dongle?

po3mah,
@po3mah@mastodon.social avatar

@bedast I had similar errors, then I updated dongle's firmware, which resolved all issues.
I was pretty desperate.

po3mah,
@po3mah@mastodon.social avatar

@bedast I know it's obvious, but have you restarted router devices?
When I updated fw, it was even worse. Then I pulled out of sockets all smart plugs (routers), plugged them back and then the mesh started to behave as it should.

po3mah,
@po3mah@mastodon.social avatar

@bedast Yeah, it's weird. I had no problems for 2 years, this was the first time.

po3mah, to random
@po3mah@mastodon.social avatar

Nobody prepared me (or talked about) the phase of life when everything changes.
I'm approaching my 50s and I feel the biggest changes since puberty. Mental more than physical.
Less and less things are relevant.
People are tiring.
Hobbies are everything. I could garden all the time.
I don't care if I live 1 or 30 years more. Both is fine.
Books are everything. People who read can approach me, others can fuckoff.
Visits? No thanks, I have more important things to do. Like - nothing.

po3mah,
@po3mah@mastodon.social avatar

@Ermin I'm all ears :)

po3mah,
@po3mah@mastodon.social avatar

@d Vleče se mi že ene 15 let, samo sedaj je strmina exp() funkcije bolj opazna :)

po3mah,
@po3mah@mastodon.social avatar

@jkmcnk @rantanlan @primozi @Ermin
I knew it, Masto is the last resort of grumpy old people :)

po3mah, to random
@po3mah@mastodon.social avatar

Can we please fast forward to social tipping point?

po3mah, to ai
@po3mah@mastodon.social avatar

I've just noticed Cults3D's license: NO AI.
Good.
#ai
#cults3d
#3dprinting

po3mah,
@po3mah@mastodon.social avatar

@kravemir I know that CC doesn't prevent AI, because 'fair use'.
For others, not sure.

steely_glint, to random
@steely_glint@chaos.social avatar

Thanks to @saghul for the perfect illustration of the problems with chatGPT:

po3mah,
@po3mah@mastodon.social avatar

@steely_glint @saghul
Yeah, it keeps giving. While it can answer correctly if the question is copy-pasted from the first picture, it shits itself if the question is modified slightly.
It looks like developers are fixing it on the fly.

  • All
  • Subscribed
  • Moderated
  • Favorites
  • anitta
  • khanakhh
  • mdbf
  • InstantRegret
  • Durango
  • Youngstown
  • rosin
  • slotface
  • thenastyranch
  • osvaldo12
  • ngwrru68w68
  • kavyap
  • cisconetworking
  • DreamBathrooms
  • megavids
  • magazineikmin
  • cubers
  • vwfavf
  • modclub
  • everett
  • ethstaker
  • normalnudes
  • tacticalgear
  • tester
  • provamag3
  • GTA5RPClips
  • Leos
  • JUstTest
  • All magazines