UL sensor hc-sr04 in HA

Hi all
Is there a way to add ul-sensor (hc-sr04) to measure distance and present measured value in the UI?

Generic answer but any ESP8266 with some basic code can read US sensors and publish the distance via MQTT that could be displayed as a sensor. Would be a good Esp8266 / Arduino learning project even.

My 2.5 cents…

Google is your friend:

Thanks for the answers.
But my thougt was that i can reuse my wiring since i have it all hooked up from another SD card i was running before i started playing with HA.
The thing is that i build my own “Dashboard” in python and php to read alot of temperatures in the house and olso measured the distance in my “pellets box” i use pellets to heat up my house. and when pellets lvl goes under 10% i get a push notification thru pushsafer.

This measure is already done in my pythonscript, is there away to use my python script i HA or can i have it running in the background and HA reading the recorded value from SQL DB?

Maby i can have my pytonscript running in tha background and deliver data to IoT and then my HA read from IoT? But it would be nice to have it inside my system from start without any workarounds.

If you already have a hardware/software setup there are many ways to get the data into HA, you already got some of them:

  1. Command line sensor calling a python script https://home-assistant.io/components/sensor.command_line/
  2. (if you plan to add other MQTT coponents) have your python script publish to MQTT and use MQTT sensor https://home-assistant.io/components/sensor.mqtt/
  3. get the data from the DB with the SQL sensor https://home-assistant.io/components/sensor.sql/
  4. if you are skilled in python build your own custom component https://home-assistant.io/developers/platform_example_sensor/

Thank you, this is what im looking for :slight_smile:

ESPHome for HA. Here https://esphome.io/components/sensor/ultrasonic.html?highlight=sr04