I've been banging my head against a wall trying to get 2 US sensors working right. I have second esp running with 2 and it's been fine but i made another with 2 more US sensors in a different position and I cannot get solid readings from them.
But I think I finally figured it out. Most of the time these 2 sensors will not pick anything up. In other words, they'll be trying to measure a distance that is beyond 400CM.
When they're in this state I get some crazy numbers out of them like:
547285 : SR04 : Distance: 9435517.00
or it says something else..unknown distance or something. I can't remember right now.
Is there a way to report the distance as out of bounds (like 1000 or 0 or something) when there is nothing within range?
HC-SR04 default value for over max distance
Moderators: grovkillen, Stuntteam, TD-er
- grovkillen
- Core team member
- Posts: 3621
- Joined: 19 Jan 2017, 12:56
- Location: Hudiksvall, Sweden
- Contact:
Re: HC-SR04 default value for over max distance
With rules and dummy device you can do this.
ESP Easy Flasher [flash tool and wifi setup at flash time]
ESP Easy Webdumper [easy screendumping of your units]
ESP Easy Netscan [find units]
Official shop: https://firstbyte.shop/
Sponsor ESP Easy, we need you

ESP Easy Webdumper [easy screendumping of your units]
ESP Easy Netscan [find units]
Official shop: https://firstbyte.shop/
Sponsor ESP Easy, we need you



Re: HC-SR04 default value for over max distance
Yes I am using that exactly, works perfectly
You check the value for "sanity", then you write it into a dummy device. Further reactions only when the dummy is rewritten.
Code: Select all
On dist#scr4<400 do
Taskvalueset,7,1,[dist#scr4]
Taskrun,7
Endon
On distance#dummy do
whatever
Endon
Domoticz on Raspi 2 -- 14 ESP units (hacked Sonoff,NodeMCUs, Wemos, self-built units) running with RC140- Mega 2.0.0 dev8
Who is online
Users browsing this forum: No registered users and 21 guests