For the HC-SR04 ultrasonic sensor - would it be possible to make an option in the code, that the ESP would send a MQTT message 1 if object besides the sensor was present (for example car in a garage) and 0 if the object wasn't present.
So basically send MQTT message 1 (or something else) if object is present and 0 if object is not present within the range of the sensor.
Ultrasonic sensor question
Moderators: grovkillen, Stuntteam, TD-er
Re: Ultrasonic sensor question
This is really a job for an external application, like nodered or mqttwarn. If you use some kind of home automation system, it might also be able to it, but it's trivial to implement in mqttwarn, and it's only a matter of time, before you need to other things with your MQTT messagesmsev wrote:For the HC-SR04 ultrasonic sensor - would it be possible to make an option in the code, that the ESP would send a MQTT message 1 if object besides the sensor was present (for example car in a garage) and 0 if the object wasn't present.
So basically send MQTT message 1 (or something else) if object is present and 0 if object is not present within the range of the sensor.
- Jan
Jan Chrillesen, Denmark
Re: Ultrasonic sensor question
Well dunno, I think it could be used that way too...It could be an option, since probably the main use case of an ultrasonic sensor would be detection of an object infront of it .
But I would still like to know how you would do it in mqttwarn, it looks interesting , can you explain a bit more on the specifics. Also do you use any dashboard for your sensors, if so which one?
But I would still like to know how you would do it in mqttwarn, it looks interesting , can you explain a bit more on the specifics. Also do you use any dashboard for your sensors, if so which one?
Re: Ultrasonic sensor question
I think that it should already work this way if you select "state" mode in the settings and enter some threshold. Check the wiki page settings.msev wrote:For the HC-SR04 ultrasonic sensor - would it be possible to make an option in the code, that the ESP would send a MQTT message 1 if object besides the sensor was present (for example car in a garage) and 0 if the object wasn't present.
So basically send MQTT message 1 (or something else) if object is present and 0 if object is not present within the range of the sensor.
Re: Ultrasonic sensor question
Awesome, gonna try that...By the looks of the wiki it should work
Who is online
Users browsing this forum: No registered users and 52 guests