From 4ab6e7053ddc7b980745964bcd5bd72b2cc007e6 Mon Sep 17 00:00:00 2001 From: Otto Winter Date: Fri, 8 Jun 2018 20:41:42 +0200 Subject: [PATCH] Add ultrasonic NAN value note --- esphomeyaml/components/sensor/ultrasonic.rst | 22 ++++++++++++++++++++ 1 file changed, 22 insertions(+) diff --git a/esphomeyaml/components/sensor/ultrasonic.rst b/esphomeyaml/components/sensor/ultrasonic.rst index 26a304cef..40ee6112b 100644 --- a/esphomeyaml/components/sensor/ultrasonic.rst +++ b/esphomeyaml/components/sensor/ultrasonic.rst @@ -54,6 +54,28 @@ Configuration variables: - **id** (*Optional*, :ref:`config-id`): Manually specify the ID used for code generation. - All other options from :ref:`Sensor ` and :ref:`MQTT Component `. +Ultrasonic Timeouts +~~~~~~~~~~~~~~~~~~~ + +The ultrasonic sensor works by sending a small ultrasonic pulse out and then waiting until +the pulse arrives back. However, there are cases where no such signal arrives back. This is most commonly caused +by either having the sensor pointed at a soft surface that muffles the incoming signal. The other case where this +can happen is when the the object is too far away and the timeout set by the ``timeout_meter`` or ``timeout_time`` +option kicks in. + +To remove ``NAN`` values from the sensor stream, use the ``filter_nan`` :ref:`sensor filter `: + +.. code:: yaml + + sensor: + - platform: ultrasonic + trigger_pin: D1 + echo_pin: D2 + name: "Ultrasonic Sensor" + filters: + - + + See Also ^^^^^^^^