I’m looking for sensors which could measure and report distance.
I can think of several use-cases, for example measuring the available space in my dust bins or the water-level in a rainwater barrel or in a cistern.
Would prefer Zigbee, because I got no WiFi-signal at the location yet. But I couldn’t find anything in this direction, perhaps someone knows some manufacturer which produces such sensors?
Otherwise I would try to use WiFi instead, are there any recommendations?
I don’t believe the protocols cover this. Zigbee, for example, does signal strength. That is determined by more than distance. It also has to do with obstructions.
To get real distance, each device would have to have GPS abilities.
Not sure about dust bins. But, water barrels could be handled by float switches. Not sure if there are any Zigbee float switches, but that would be a good search I believe.
are you looking for an already built sensor or just ideas?
what range are you looking for?
i’m using a VL53L0X to check the level of cat food in my custome made feeder, it should sense up to 2 meters… but you need to build a device for it to work
are you looking for an already built sensor or just ideas?
An already built sensor would be fine. I think a distance from 0m to 2m or 3m would be fine for most cases.
A long time ago I built something similar to this;… But it uses a D1 Mini and therefore is connected to my WiFi.
Yea, something like this would be fine. So perhaps I’m trying to find a solution with ESPHome somehow, if there is really no “buy and use” sensor available.
I was just wondering why no manufacturer seems to offer such a sensor - it seems to me very usefull.
As it was a cold & rainy day today, I finally converted the Tasmota sensor to an ESPHome one; the instructions in the above link worked fine in general, but had to make a few adjustments due to error messages and incorrect results.
This is what I ended up adding at the end of the code that was auto-generated by ESPHome after I added the Wemos D1 Mini to it:
The original code used the D-numbers for the pins, I had to change them to the GPIO numbers and add a multiplication filter to actually get result in cm.
The original update_interval of 1s worked but I don’t need it updated that often.
Another thing I noticed was that when using Tasmota the distance sensor seemed to easily recognize distances above 2m (up to 4m, I think), now it seems to show ‘unknown’ as soon as I get close to 1.8m.
As the sensor is installed higher than that, it will show ‘unknown’ when the car is removed from underneath it, so I had to change the ‘standard’ float(0) I used to use to this in the template sensor:
- sensor:
- name: Garage Status
unique_id: 'garage_status'
state: >
{% if states('sensor.garage_distance_meter') | float(999) > 100 %}
Garage Empty
{% else %}
Car in Garage
{% endif %}
icon: >
{% if states('sensor.garage_distance_meter') | float(999) > 100 %}
mdi:garage-alert
{% else %}
mdi:garage-variant
{% endif %}