ADONNO https://adonno.com Join me in my journey into the Home Assistant rabbit hole Thu, 21 May 2020 19:16:44 +0000 en-US hourly 1 https://wordpress.org/?v=6.8.5 https://adonno.com/wp-content/uploads/2019/08/cropped-youtube-32x32.png ADONNO https://adonno.com 32 32 166165396 The quest to the perfect doorbell https://adonno.com/the-perfect-doorbell/ https://adonno.com/the-perfect-doorbell/#comments Tue, 12 May 2020 23:32:23 +0000 https://adonno.com/?p=360 or how I ended up paying twice the price due to good advertisement

Introduction

In this article i will tell a really bad experience that cost me twice the price. This will be a story about bad support and false promises. From a renown company in the Smart Home business that sells a product that shouldn’t be sold.

The conditions

Let’s go back in time around 2014 when I bought this house I am now living in. I knew from the start that I wanted a smart home and I wanted to do anything right … (but ended up making some big mistakes) . I was searching for a doorbell and which had to fulfill some conditions.

  • It had to be smart and I had to be able to connect remotely to it (VPN would be fine)
  • I had to be able to see the feed from a mobile device
  • I didn’t want a gong/bell inside the house
  • It should be cheaper than some comparable solutions
  • I had to be able to open the door without a key
  • It had to have SIP protocol

I had some time since i wouldn’t move in until 2017 and I preferred to take my time and find the perfect solution.

The contenders

Siedle

The first device was a Siedle intercom. It was in my electricians quote and the full setup would set me back around 1600€ (starting price) back at that time. The Device just looks amazing and would fit perfectly on my black house facade. Siedle are a renown company in that domian. However too expensive and i had to look elswhere

Gira

Next up was the Gira door station at first sight quite cheap and since i was doing a KNX installation this would be perfectly compatible with the rest of the house but as soon as I started configuring it to meet my needs, the price just climbed and i stopped at around 2000€

GIRA Türstation Video AP 1-fach 126967 | Adalbert Zajadacz GmbH ...

The Fibaro Intercom

FIBARO Intercom on Student Show

The numbers would light up blue and upon validation all the number would turn green and a relay would get triggered. I had Bluetooth recognition when you cam close you would get a notification. And since this was Fibaro this had to be a great device . At 800€ this was also the cheapest one from all the contenders. I was in love. Well I would learn my lesson…the hard way.

This device just looks amazing and so futuristic. It give you a Spy movie flair. You could insert a code bu turning the silver ring like you would for a safe. To validate the number you hat do push the ring in.

The initial joys and installation

So around February 2018 I ordered it off eBay and was just amazed. I opened the box and it felt like I was unboxing a nice product. Unfortunately, I didn’t take any pictures but there weren’t many parts. The intercom itself with its in wall mount.

Installation

The installation was quite finicky since even though it was an Ethernet-capable device, there was no Ethernet plug and there wasn’t any room for any spare length of wire. I really had to be precise. I damaged the facade a bit but since it had to get finishing touche that didn’t matter. But wow did it look cool. If you would like to see the manual, as well as a video, follow this link.

The issues

Lets go through some issues I faced during the period I used the intercom

Networking

The was quite unreliable at first and it took some time to disable the WiFi on the device only then it decided to work over the better wired network interface. I never understood why I had to disable WiFi in first place. The time it took to answer calls was what felt like an eternity.

SIP Calls

The specs clearly said that there was SIP Video calling , however I was never able to connect it to my phone server. Even after getting an access to an API after 2 years the Advertised SIP video calls I guess would only work with devices having the app Installed. so my wish to have my house phone ring when someone was at the door was never fulfilled

Overheating

This was the worst issue of all. The Front of my house pointed south-east and the sun would shine at full blast on the device on nice days. Starting 10AM until 4PM the device would go offline because of overheating. I mean what use is a doorbell that doesn’t work. At first i though my device was faulty but I wasn’t the only one experiencing the issues. This was the deal-breaker. But changing the device for another hurt since it was expensive. I would change my mind at some point, however.

The chime and the volume

It was so annoying. You just could not change it. There have been complaints on their forum but in vain. Whenever I had guests my neighbors would hear it. There was no way to stop it except by picking up the App. If I wanted to lower the volume of that thing it would automatically lower the volume of the speaker which would result in my guests or the postman not being able to hear me (I live on a main road).

The app

The app in itself was ok-ish. Except they didn’t have an android app until the end of 2019. And if one of the owners picked up the “call” the phone of the other one would still ring until they opened the app. Sometimes we wouldn’t get any notifications at all.

The support…

I felt like there was none at all. I was really disappointed and expected better communication for a device that is so expensive.

Doorbird

Some day I stumbled upon a YouTube video review of a device called Doorbird D2101V. I had never heard of them and I was quite surprised. I looked really nice. Not as spy movie like the Fibaro but still I just liked it. The price felt a bit on the higher side with around 700€ again and since I felt like I burned myself on the Fibaro intercom I decided I wouldn’t rake any risks. I took my time and started watching some videos. The videos I watched to convince myself I didn’t need it the more I wanted it. It had just a nice API it was a cloud device but would allow the use of a local API. support SIP and most importantly would integrate into Home-Assistant. So I did what any reasonable adult would do and coughed up the money…

Door intercom and video intercom system for safety and comfort ...

This device is amazing. It has all I was looking for. It was so easy to set up and the finishing is really sleek. And it looks a lot better on my house. That thing is flush mounted and perfectly fits the color of my facade (tons of colors available). My guests are a lot happier as well since first they don’t need to hear that stupid music anymore and second, they don’t have to wait outside. They have a nice SIP integration and a great RFID reader. You can retrofit almost every house with this device (additional parts might be required).

They now also have a smaller,cheaper version the D1101V

D1101V
D2101V

Last Words

So what did I learn in the end I should maybe have gone with the Siedle that would have spared me a lot of trouble. I might have regretted it upon seeing the Doorbird anyway it was an expensive experience. And I will never buy anything from Fibaro again they released a product on the market that wasn’t working as it should and didn’t provide any reasonable support for it. If you want a really cheap doorbell, there is Frenck’s here

Useful Information

In case of any question, find me on Discord or on Twitter.

If you liked this article, do not hesitate to share it

I run mostly on coffee so, if you enjoy my work, and if you would like to support me you can buy me a coffee

Buy Me A Coffee

]]>
https://adonno.com/the-perfect-doorbell/feed/ 2 360
Smarter Diaper trash bin https://adonno.com/smarter-diaper-trash-bin/ https://adonno.com/smarter-diaper-trash-bin/#comments Sun, 10 May 2020 17:15:01 +0000 https://adonno.com/?p=344 Introduction

We have a baby diaper trash bin and we can’t see when it’s full. Based on that id’ like to get a notification to let me know before it’s full so I don’t have to stick up my head in it 💩

How to count

First I had to identify how to count the baby diapers.
I used an Aqara open/close sensor and stuck it to the axle, I had to find a spot where it could easily be mounted and it would not be in the way of the mechanism. I am Using DeConz on Home-Assistant Bit you can also use ZHA. In order to connect the Zigbee devices do Home-Assistant, I used a ConBee II stick provided by Phoscon. You can find a Tutorial on how to install Deconz and pair zigebee devices here

original aqara zigbee version window door sensor smart home kit ...

Count diapers

I created a counter in Home-assistant to keep track of the diapers. and then an automation to increment it on every state change that is either close and open
(do not track EVERY state change since a disconnection or a battery update would increment the counter)

Counter & Automation

Resetting the counter

Whenever the bin is emptied the counter needs to be reset. I’ve thought about automating it but found no effective way to do it, so I just added an Aqara button which on a button press resets the counter via an automation

Notifcations

Whenever a defined threshold (15) has been reached a notification should be sent to our phones as well as on each additional item until the counter has been reset

This is done via NodeRed

Threshold Reached

image

Counter Reset

image


Display diaper count on switch

This one is a bit more tricky to explain. The bin stands next to one of our KNX light switches. These have a screen to display additional information like time, temperature or whatever additional data one would like to display.
here you can see a demo video

I won’t explain how KNX works but basically you have to set up a group address like “4/2/30” and the specific function of that switch will be added to that group. I then exposed the value of the “counter” to KNX into the specific group

I had to use percent since the switch wouldn't allow for a plain text field

Flash red light on the wall switch when threshold reached

As explained in the previous comment these switches can display some nice information. You can also define the LEDs.

Here I used Node-Red again since I had it already set up for my mobile notifications and I didn’t want to create an additional entity in HA. (see here)
In Node-Red I used a Plugin called UltimateKnx. Used a switch node to change the value “15” to “true” and value 0 to “false”

Useful Information

In case of any question, find me on Discord or on Twitter.
You can find a dedicated Discord Server for any ESPHome related question or if you have questions about the drivers for the D1 mini
If you have issues with the community add-ons, you might find help on their discord server.

If you liked this article, do not hesitate to share it

I run mostly on coffee so, if you enjoy my work, and if you would like to support me you can buy me a coffee

Buy Me A Coffee
]]>
https://adonno.com/smarter-diaper-trash-bin/feed/ 1 344
Mailbox monitor with Zigbee https://adonno.com/mailbox-monitor-with-zigbee/ https://adonno.com/mailbox-monitor-with-zigbee/#comments Fri, 13 Sep 2019 20:28:08 +0000 https://adonno.com/?p=288 Introduction

In this article, I will explain how I monitor my mailbox to get notified when the postman came.

This is currently a work in progress since I am missing another sensor. to detect when the mailbox has been emptied

I am using a ZigBee door/window sensor to monitor if the postbox slit has been opened. The challenge here is to have a stable ZigBee network up to the front roadside since only the devices connected to mains act as a router/repeater (since battery-powered devices don’t help to maintain the mesh). So in order to have a stable network across the house, I had to buy some additional components. (Across the house because I have other battery-powered ZigBee devices). The good thing though is the more devices you have the more stable your mesh is. So if you should replace all your “dumb” light bulbs by smart ones well that would create a nice mesh.

My setup

For my setup I used 6 OSRAM smart+ Plugs and 2 Ikea TRÅDFRI Signal repeaters in order to have a stable mesh, a Phoscon Conbee II stick as main gateway and deConz add-on running on Home Assistant. This setup is specific to my home and you might need fewer devices. You can also use Ikea smart bulbs, they also act as a repeater.

Installing deConz

Since I am using Hass.io the install is straightforward. DeConz can be found among the community add-ons and you will be able to find instructions here: https://github.com/home-assistant/hassio-addons/tree/master/deconz. You should enable VNC access in order to see how well your connections are and how healthy your mesh is. You can download VNC here: https://www.realvnc.com/en/connect/download/viewer

VNC View with all my current zigbee devices

Once the add-on is up and running open the web UI and start adding your devices. I used the fairly cheap Xiaomi Door/window sensors for my mailbox which should retail around 11$

Adding devices in deConz

In order to add a device you have to set the conbee gateway in pairing mode. To do so, go to your add-on and open the web-UI, connect to the gateway, open the menu, go to devices > sensors an click on “add new sensor”

setting the Conbee gateway in pairing mode

The gateway will be in pairing mode for 3 minutes. That should give you enough time to add your sensor. Grab your Window sensor, find the hole and use a paperclip to push the button inside. Keep it pushed for around 3-5 seconds until the light blinks. Release the button. The sensor will now try to pair with the gateway (this should be quite fast). If your gateway is unable to find your sensor, you might have to get closer to it. Here is where the vnc access might come in handy.

Adding the Integration in Home Assitant

In order to get the state of the sensor in Home Assistant, you have to add the deConz integration. In Home Assistant go to Configuration > Integrations, deConz should appear on top among the discovered integrations. Configure it and you are good to go. The gateway should now appear on the list of configured integrations. Click on the gateway. The sensor will be listed among other devices you have previously added in deConz. Here you can configure the area the name

The entity_id will be binary_sensor.openclose_8
Name override and area selection
last states as well as current states and battery level

Getting the notifications

I will show 3 ways how to implement notification automations, YAML mode, GUI and finally Node-Red In my case, I currently notify 2 phones and add a persistent notification in Home Assistant whenever the mailbox slot is opened. In a second phase, I will add another sensor in order to check whether the mailbox has been emptied and if so dismiss the notification.

YAML mode

If you are using yaml mode, I assume you know your way around those files, Add this to the automaton.yaml and change the devices you want to notify.

GUI Mode

This only works if you don’t use split configurations, since it will save the created automation in /config/automations.yaml

In Home Assistant, go to Configuration > Automation > an click on the yellow plus sign. A “new automation” window will open.

Node-RED

I’ve added this bit for the one amongst you who prefer to work with Node-RED. (looking at you mister Bonani 😉 ) This is also a good opportunity for me to try to understand that stuff and learn something new.

Last words

So now you know how to create a nice notification when your mailman comes by. As I already mentioned this is a work in progress and I will have to buy a second sensor and add it in order to view when the mailbox has been emptied. Regarding the Zigbee sensors, I am not sure, but I’ve had issues when I set them up in my office and then moved them on location. So now I go on location with my laptop, set the gateway in pairing mode and then add the Zigbee device to ensure it will have the right connection. This might seem a bit of a hassle but it works for me and it allows me to make sure the connection works form the start.

One thing I personally don’t like is that deConz recognizes Smart plugs as lights. This might not be a big issue but I have a “goodnight” script that switches off the light domain in Home Assistant (all the lights get switched off). This means I cannot connect critical devices to these plugs. I hope there will be an update at some point that fixes this.

Disclaimer

I use affiliate links in this article, that will earn me a small affiliate commission for any purchase you make when you’ve used any of those links. Please note, that the price of those products and services do not change because of this and are exactly the same as if you haven’t used these links.

If you liked this article, do not hesitate to share it

I run mostly on coffee so, if you enjoy my work, and if you would like to support me you can buy me a coffee

Buy Me A Coffee



]]>
https://adonno.com/mailbox-monitor-with-zigbee/feed/ 1 288
Salt level sensor for water softener in Home Assistant with ESPHome https://adonno.com/salt-level-sensor/ https://adonno.com/salt-level-sensor/#comments Fri, 06 Sep 2019 22:16:10 +0000 https://adonno.com/?p=196 Introduction

In this article I will explain how I quickly created a salt level sensor for my water softener using an HC-SR04 Ultrasonic Distance Sensor and a Wemos D1 mini . The inspiration was provided by DrZzs during one of his live streams. Since I wanted a smart device and upgrading mine would cost me around 150€ I decided I would try to do it myself. I will illustrate two examples on how to display the data. One in the actual height of salt left in the container and another in percentage.

Material list

So what do you actually need? 
First of all, a water softener, a Wemos D1 mini, a HC-SR04 and a 4 wire cable to connect the HC-SR04 to the D1 and a mini USB power supply

Main Components

HC-SR04 Ultrasonic Distance Sensor

The ultrasonic sensor determines distance by using sonar, which means no direct contact is required for measurements

Additionally you will need

  • a 4 wire cable (as long as required)
  • A 5V power supply for the D1 mini. (A mini usb phone charger is more than enough)
  • a mini USB cable (for flashing)

Additional tools and hardware

For this project soldering is required, here is a list of some additional tools you could find handy

Soldering iron

A soldering iron is a must for every DIYer

IMG_4454

(optional) shrink-tube

Shrink tubes aren’t required but they will help you to avoid short-circuits and will make your project look a lot tidier … bonus: they will hide soldering defects.

1

Wire stripper & Wire cutters

Depending where you will place your D1 a case might come in handy. I’ve hidden mine in the garage motor. If you would like to place it somewhere else this is the way to make it look tidy

Software

I’ve used the following software to complete the project:

Flashing the firmware on the D1 mini

As mentioned above I used ESPhome. If you do not know ESPHome and have no clue what I’m talking about, well, head up to their website. They have it well explained. So please do take the time to read the guide.

For the rest of this guide, I’m going to assume you are running Hass.io. However, the ESPHome getting started guide for non-Hass.io users is extremely detailed, and you should be able to adapt easily.

Preparing the firmware

This part is pretty straightforward I have prepared the code you will only have to adapt the value we will subtract from ( it is the height from the salt container from where the sensor will be placed to the bottom )

Things to take into account:

Since we are going to measure from the top down the measured value will increase as the salt drops. In order to have a decreasing value we will take the distance from the sensor to the bottom, of the salt container and subtract the (by the sensor) measured distance from the previously measured container height.

Another thing I have done, and that is up to you, is to convert the measured distance in meters to centimeters since my salt container is only 46 cm high.
You can also convert from metric to imperial.

As some people prefer to have percentage values, I also added an example for percentages where you take the total distance(t), subtract the measured distance(x), multiply it by 100 and divide it by the total

((Measured) * 100) / (Total Dsitance)
in my case: ((0.42-x)*100)* (100 / (0.42 * 100)) = 24.28%
or
(0.42 -x) * (100/0.42) = 24.28%

The actual code

DO NOT USE PIN D4 !!! the D1 mini won’t boot!

Create a file called salt_level_sensor.yaml; for Hass.io users, create the file in the /config/esphomefolder, so you end up with the file: /config/esphome/ salt_level_sensor.yaml.

Next, add the following contents to the file:

The above snippet shows an ESPHome project file in the YAML format.

On lines 9 & 10, make sure to set your WiFi details or else you might end up with failure. Save the file and open up the ESPHome web interface; The Car_position_sensor project should appear!

Save the file and open up the ESPHome web interface; The Car_position_sensor project should appear!
Now validate and Downlaod the bin as shownin the example below.

Uploading the firmware to the D1 mini

I won’t explain how to flash the firmware to the D1 mini since you can find all you need in the following article:

https://adonno.com/car-presence-position-detection/#10-uploading-the-firmware-to-the-d1-mini

Wiring up the D1 mini and the sensor

Make sure your D1 mini is disconnected from any power source during this step! 

The wiring is pretty straight Forward we’ll use D1 and D2 for trigger and echo. The HC-SR04 needs to be power so we’ll give it 5V (VCC) and GND

Soldering done? Good let’s carry on

Now that you have soldered all the sensors and have verified there is no short-circuit, it’s time to test if all is working right and you have wired the pin-outs correctly.

Connect your D1 mini to a power source and verify it is online in ESPHome.

Installing the sensor in the salt/brine tank.

This part is totally up to you. I chose to place my sensor inside the thank and hold it in place with some hot glue the D1 mini is in my rack since I’ve added temperature sensors as well (which i haven’t explained here). DrZzs drilled a hole into the lid and placed it atop. You can then place the D1 mini on top of the lid and cover it so that it’s protected from outside factors like dust etc.

Integrating the sensor in Home Assistant

Now this is really easy thank to the efforts the Home Assistant dev team has done. In Home Assistant, go to: Configuration > Integrations > the sensor should appear at the top. Follow the steps below to integrate it in Home Assistant

This is a simple example on how to add the sensor and not the actual sensor

Lovelace-UI

In order to have this view you will need the gauge card

copy the following code in your view

And you are done

Useful Information

In case of any question, find me on Discord or on Twitter.
You can find a dedicated Discord Server for any ESPHome related question or if you have questions about the drivers for the D1 mini
If you have issues with the community add-ons, you might find help on their discord server.

If you liked this article, do not hesitate to share it

I run mostly on coffee so, if you enjoy my work, and if you would like to support me you can buy me a coffee

Buy Me A Coffee
]]>
https://adonno.com/salt-level-sensor/feed/ 25 196
Cheap car presence & position detection in Home Assistant with ESPHome https://adonno.com/car-presence-position-detection/ https://adonno.com/car-presence-position-detection/#comments Fri, 30 Aug 2019 20:55:19 +0000 https://adonno.com/?p=71

This is my first article please do not hesitate to leave any feedback positive or negative. It will help me improve over time.

Wouldn’t it be nice to instantly see if you forgot your car outside when going to bed or check if there is space in the garage to fit your car? Well in my case having a garage where 2 cars go one behind another, brings an issue since I would like to know if there is room to fit the car of maybe I have to leave the car outside while arriving home for cheap?

That is how my journey with this project began.
Inspired by the salt-level sensor project I have on another post, I used the HC-SR04 Ultrasonic Distance Sensor. Actually 4 of them, combined with a Wemos D1 mini running ESPHome.

Materials List

So what do you actually need?
Depending on your garage configuration your needs may vary . In this case let’s focus first on my configuration. I used one Wemos D1 mini, 4 HC-SR04 and 6 meters of cat5 cable

Main Components

HC-SR04 Ultrasonic Distance Sensor

The ultrasonic sensor determines distance by using sonar, which means no direct contact is required for measurements

Additionally you will need

  • Some wires to connect the sensor to the D1 mini. I preferred using a cat5 cable and splicing it into it but that is up to you. You can also use a 4 wire cable for every sensor.
  • A 5V power supply for the D1 mini. (A mini usb phone charger is more than enough)
  • a mini USB cable (for flashing)

Additional tools and hardware

For this project soldering is required, here is a list of some additional tools you could find handy

Soldering iron

A soldering iron is a must for every DIYer.

IMG_4454

(optional) shrink-tube

Shrink tubes aren’t required but they will help you to avoid short-circuits and will make your project look a lot tidier … bonus: they will hide soldering defects.

Depending where you will place your D1 a case might come in handy. I’ve hidden mine in the garage motor. If you would like to place it somewhere else this is the way to make it look tidy

Software

I’ve used the following software to complete the project:

Since this is a Home Assistant based site you would come to the obvious conclusion that Home Assistant is required. ESPHome is my firmware to run on my boards, you can also use tasmota but I have not tried that as of yet.

Alright then, let’s get started

Can the D1 mini cope with 4 sensors ?

That was the question I asked myself. There was only one way to know for sure: test it.
I pulled out a breadboard, some Dupont wires and quickly slapped it all together to get to this beauty :

Wemos D1 mini connected with several Dupont wires to the HC-SR04

I connected each sensor one by one and added them to the esophome.yaml until they were all connected and checked they were reporting the correct values. So let’s get serious now

Flashing the firmware on the D1 mini

As mentioned above I used ESPhome. If you do not know ESPHome and have no clue what I’m talking about, well, head up to their website. They have it well explained. So please do take the time to read the guide.

For the rest of this guide, I’m going to assume you are running Hass.io. However, the ESPHome getting started guide for non-Hass.io users is extremely detailed, and you should be able to adapt easily.

Preparing the firmware

This part will depend a lot of how you are going to setup and install your sensors. This example is based on my setup and you can modify it as you see fit.

Things to take into account:

The sensors are supposed to be precise up to 4 meters. However I’ve found their best working distance is from 0 to 200 cm. Any further and you might get false values. I for my hand can work with these false values and will explain that a little bit further.

Since I wanted to measure the car’s height I had to subtract the measured value to the overall distance from the floor to the distance

how the height is calculated

Let’s assume we have a ceiling height of 250 cm and we would like to know the height of the car:

height of the car = 250cm – x

So if h2 would be 100 cm we would get :

h = 250cm – 100cm
h = 150cm

In ESPHome there are so called filters that allow you to modify the calculated value before it gets sent to Home Assistant

The actual code

DO NOT USE PIN D4 !!! the D1 mini won’t boot!

Create a file called car_position_sensor.yaml; for Hass.io users, create the file in the /config/esphomefolder, so you end up with the file: /config/esphome/car_position_sensor.yaml.

Next, add the following contents to the file:

The above snippet shows an ESPHome project file in the YAML format.

The pins D0 to D8 may vary depending on how you will solder your sensors.
You will also have to measure the distance between the sensor and the floor for each sensor in order to input the correct value for their correct lambda calculations.

On lines 9 & 10, make sure to set your WiFi details or else you might end up with failure. Save the file and open up the ESPHome web interface; The Car_position_sensor project should appear!

car_presence_sensor ESPHome: validate, compile and download

Uploading the firmware to the D1 mini

In order to upload the firmware to the D1 mini, we will make use of the usb port provided on the device.

You will need the driver for the USB to serial controller to be recognized. For which most of the chip-sets it can be downloaded via the link below

https://wiki.wemos.cc/downloads

Should your D1 not work with provided drivers please refer to the useful information section.

Plug the USB cable into your PC and the mini USB into the D1 mini. Now start the ESPHome flasher tool. Select the available serial port, and load the car_position_sensor.bin file by clicking the “Browse” button. Start the flash procedure by clicking the “Flash ESP” button. The console shows you the progress and tells you when it finishes.

successfully flashed the D1 mini with the configuration file

Wiring up the D1 mini and the sensors

Make sure your D1 mini is disconnected from any power source during this step!

DO NOT USE PIN D4 !!! the D1 mini won’t boot!

Next we will start wiring up the devices. I have them separated 1.80 m of each other. That is enough so that a car is always below 2 sensors at least and in my case that is required (I’ll explain that later).

Since I used a cat 5 cable I had 3 sensors settled. I used the Red-Redwhite wire pair for VCC and GND and then used another wire pair for each sensor. The front one is so close that I just connected it directly with a 4-wire cable.

The most important part, and where patience is required, is the soldering. Please verify multiple times that there is no short-circuit on one of your sensors or your D1 mini will die. The pictures below show what happens if you are sloppy. Anyway, let’s avoid calling it a failure since I have learned my lesson.

Image
Dead D1 mini. So long my friend. Sacrifices where made
If you look closely, you’ll see the shielding wires shorting all the 4 contacts. It happend on 2 sensors out of 4.

Soldering done? Good let’s carry on

Now that you have soldered all the sensors and have verified there is no short-circuit, it’s time to test if all is working right and you have wired the pin-outs correctly.

Connect your D1 mini to a power source and verify it is online in ESPHome.

online car position sensor in esphome

If the sensor isn’t online, verify your config and try flashing it again. If it should still fail please revert to the “useful information” section

Installing the sensors in the garage

So now that the sensor is working in ESPHome, it is time to install it in your garage. Now this is totally up to you, however since i wanted to avoid false positives, and identify what car is turned in which direction. This meant, I have to have the car under 2 sensors at all time at least. Try to keep them centered as well

Integrating the sensor in Home Assistant

Now this is really easy thank to the efforts the Home Assistant dev team has done. In Home Assistant, go to: Configuration > Integrations > the sensor should appear at the top. Follow the steps below to integrate it in Home Assistant

Integrarting ESPhome in Home-Assitant

Prepping for lovelace-UI

In this section we will look into the data provide by the sensors try to understand it and act accordingly.

Disclaimer
This part is still work in progress. In the end it should be possible to identify specific cars and also know what direction they are turned.

This part of the Article will mainly apply to my situation, you will have to adjust accordingly.

Getting the sensors in grafana will help us visualize what these values will look like

visualazing the sensors in grafana

Installing InfluxDB / Grafana and reading data

In order to get nice graphs in grafana you need to have the data stored in a database. Here is where InfluxDB comes into play. We will get the values sent from ESPHome to Home Assistant , send them in InfluxDb and then pull them from in grafana.

I won’t explain that part since there is a nice video by frenck on how to do it. He’s doing it in a “speedrun” so you might consider slowing the video down by 0.75 or even 0.5. Grab some popcorn, sit back, relax and enjoy this nice little video.

The mastermind Frenck demonstrating how to install InfluxDB /Grafana /Ide in 15 minutes

Viewing the graphs

Now that the steps above are completed; I’ve prepared a json download that you can import in grafana in order to get the same view as provided in the image above.

You do need to keep the names like the ones in the example or you won’t get the data. You can easily fix that in case you aren’t getting value

Download the Json file to import in grafana

DOWNLOAD

Understanding the data and creating sensors in Home Assistant

Now comes the tricky part, understanding what you see and coming up with scenarios. For now i just want to know if a car is present under 2 sensors at once. Since each of my cars is higher than 50 cm I will create 3 template sensors based on that information.

creating 3 sensors for car state based on their position

Like mentioned above, right now we are only monitoring if there is a car or not. Withe the help of grafana and over time we will be able to exactly identify the cars and their orientation and adapt accordingly. For instance soon as I can work with the data I will be able to add different states than “on” and “off”. here is an example what it could look like for one sensor

The Lovelace Thing

Getting an animation in lovelace will require a little bit of tinkering from your part.
First of all you will need HACS (Home Assistant Community Store and you will have to install card-mod (can be installed via HACS)

In order to Have a views in lovelace, you will need to use the picture-elements card.
The following gist will illustrate an example of how this can look like in lovelace

like already explained at the beginning this applies mostly to my case and i am currently only detecting if there is a car or not. In future i will add more information as I go on.

Useful Information

In case of any question, find me on Discord or on Twitter.
You can find a dedicated Discord Server For any ESPHome related question or if you have questions about the drivers for the D1 mini
If you have issues with the community add-ons, you might find help on their discord server.

If you liked this article, do not hesitate to share it

I run mostly on coffee so, if you enjoy my work, and if you would like to support me you can buy me a coffee

Buy Me A Coffee

]]>
https://adonno.com/car-presence-position-detection/feed/ 23 71