mirror of
https://github.com/esphome/esphome-docs.git
synced 2025-02-04 23:52:18 +01:00
Add MQTT Subscribe sensor (#50)
* Add MQTT Subscribe sensor * Update index.rst
This commit is contained in:
parent
8ca563cab1
commit
12edde2485
@ -32,6 +32,7 @@ See :cpp:func:`Application::register_sensor`.
|
||||
max6675
|
||||
mhz19
|
||||
mpu6050
|
||||
mqtt_subscribe
|
||||
ms5611
|
||||
pulse_counter
|
||||
rotary_encoder
|
||||
|
16
api/sensor/mqtt_subscribe.rst
Normal file
16
api/sensor/mqtt_subscribe.rst
Normal file
@ -0,0 +1,16 @@
|
||||
MQTT Subscribe Sensor
|
||||
=====================
|
||||
|
||||
.. cpp:namespace:: nullptr
|
||||
|
||||
See :cpp:func:`Application::make_mqtt_subscribe_sensor`.
|
||||
|
||||
API Reference
|
||||
-------------
|
||||
|
||||
.. cpp:namespace:: nullptr
|
||||
|
||||
.. doxygenclass:: sensor::MQTTSubscribeSensor
|
||||
:members:
|
||||
:protected-members:
|
||||
:undoc-members:
|
@ -345,6 +345,7 @@ See Also
|
||||
max6675
|
||||
mhz19
|
||||
mpu6050
|
||||
mqtt_subscribe
|
||||
ms5611
|
||||
pulse_counter
|
||||
rotary_encoder
|
||||
|
37
esphomeyaml/components/sensor/mqtt_subscribe.rst
Normal file
37
esphomeyaml/components/sensor/mqtt_subscribe.rst
Normal file
@ -0,0 +1,37 @@
|
||||
MQTT Subscribe Sensor
|
||||
=====================
|
||||
|
||||
The ``mqtt_subscribe`` sensor platform allows you to get external data into esphomelib.
|
||||
The sensor will subscribe to messages on the given MQTT topic and parse each message into
|
||||
a floating point number.
|
||||
|
||||
Please note this integration only works with MQTT topics that have numeric data! Each time
|
||||
a message that is not a number is published a warning will be shown. Please use the MQTT subscribe
|
||||
text sensor for importing arbitrary text into the esphomelib ecosystem.
|
||||
|
||||
.. code:: yaml
|
||||
|
||||
# Example configuration entry
|
||||
sensor:
|
||||
- platform: mqtt_subscribe
|
||||
name: "Data from topic"
|
||||
id: mysensor
|
||||
topic: the/topic
|
||||
|
||||
Configuration variables:
|
||||
------------------------
|
||||
|
||||
- **name** (**Required**, string): The name of the sensor.
|
||||
- **topic** (**Required**, string): The MQTT topic to listen for numeric messages.
|
||||
- **qos** (*Optional*, int): The MQTT QoS to subscribe with. Defaults to ``0``.
|
||||
- **id** (*Optional*, :ref:`config-id`): Manually specify the ID used for code generation.
|
||||
- All other options from :ref:`Sensor <config-sensor>` and :ref:`MQTT Component <config-mqtt-component>`.
|
||||
|
||||
See Also
|
||||
--------
|
||||
|
||||
- :ref:`sensor-filters`
|
||||
- :doc:`API Reference </api/sensor/mqtt_subscribe>`
|
||||
- `Edit this page on GitHub <https://github.com/OttoWinter/esphomedocs/blob/current/esphomeyaml/components/sensor/mqtt_subscribe.rst>`__
|
||||
|
||||
.. disqus::
|
@ -230,25 +230,25 @@ Sensor Components
|
||||
-------------------------------------------------- -------------------------------------------------- --------------------------------------------------
|
||||
`MAX6675`_ `MH-Z19`_ `MPU6050`_
|
||||
-------------------------------------------------- -------------------------------------------------- --------------------------------------------------
|
||||
|MS5611|_ |Pulse Counter|_ |Rotary Encoder|_
|
||||
|MQTT Subscribe|_ |MS5611|_ |Pulse Counter|_
|
||||
-------------------------------------------------- -------------------------------------------------- --------------------------------------------------
|
||||
`MS5611`_ `Pulse Counter`_ `Rotary Encoder`_
|
||||
`MQTT Subscribe`_ `MS5611`_ `Pulse Counter`_
|
||||
-------------------------------------------------- -------------------------------------------------- --------------------------------------------------
|
||||
|SHT3X-D|_ |TCS34725|_ |Template Sensor|_
|
||||
|Rotary Encoder|_ |SHT3X-D|_ |TCS34725|_
|
||||
-------------------------------------------------- -------------------------------------------------- --------------------------------------------------
|
||||
`SHT3X-D`_ `TCS34725`_ `Template Sensor`_
|
||||
`Rotary Encoder`_ `SHT3X-D`_ `TCS34725`_
|
||||
-------------------------------------------------- -------------------------------------------------- --------------------------------------------------
|
||||
|TSL2561|_ |Ultrasonic Sensor|_ |Uptime Sensor|_
|
||||
|Template Sensor|_ |TSL2561|_ |Ultrasonic Sensor|_
|
||||
-------------------------------------------------- -------------------------------------------------- --------------------------------------------------
|
||||
`TSL2561`_ `Ultrasonic Sensor`_ `Uptime Sensor`_
|
||||
`Template Sensor`_ `TSL2561`_ `Ultrasonic Sensor`_
|
||||
-------------------------------------------------- -------------------------------------------------- --------------------------------------------------
|
||||
|WiFi Signal Strength|_ |Xiaomi MiFlora|_ |Xiaomi MiJia|_
|
||||
|Uptime Sensor|_ |WiFi Signal Strength|_ |Xiaomi MiFlora|_
|
||||
-------------------------------------------------- -------------------------------------------------- --------------------------------------------------
|
||||
`WiFi Signal Strength`_ `Xiaomi MiFlora`_ `Xiaomi MiJia`_
|
||||
`Uptime Sensor`_ `WiFi Signal Strength`_ `Xiaomi MiFlora`_
|
||||
-------------------------------------------------- -------------------------------------------------- --------------------------------------------------
|
||||
|Custom Sensor|_
|
||||
|Xiaomi MiJia|_ |Custom Sensor|_
|
||||
-------------------------------------------------- -------------------------------------------------- --------------------------------------------------
|
||||
`Custom Sensor`_
|
||||
`Xiaomi MiJia`_ `Custom Sensor`_
|
||||
================================================== ================================================== ==================================================
|
||||
|
||||
.. |Sensor Core| image:: /esphomeyaml/images/folder-open.svg
|
||||
@ -323,6 +323,9 @@ Sensor Components
|
||||
.. |MPU6050| image:: /esphomeyaml/images/mpu6050.jpg
|
||||
:class: component-image
|
||||
.. _MPU6050: /esphomeyaml/components/sensor/mpu6050.html
|
||||
.. |MQTT Subscribe| image:: /esphomeyaml/images/mqtt.png
|
||||
:class: component-image
|
||||
.. _MQTT Subscribe: /esphomeyaml/components/sensor/mqtt_subscribe.html
|
||||
.. |MS5611| image:: /esphomeyaml/images/ms5611.jpg
|
||||
:class: component-image
|
||||
.. _MS5611: /esphomeyaml/components/sensor/ms5611.html
|
||||
|
@ -22,6 +22,7 @@ HTU21D, components/sensor/htu21d, htu21d.jpg
|
||||
MAX6675, components/sensor/max6675, max6675.jpg
|
||||
MH-Z19, components/sensor/mhz19, mhz19.jpg
|
||||
MPU6050, components/sensor/mpu6050, mpu6050.jpg
|
||||
MQTT Subscribe, components/sensor/mqtt_subscribe, mqtt.png
|
||||
MS5611, components/sensor/ms5611, ms5611.jpg
|
||||
Pulse Counter, components/sensor/pulse_counter, pulse.svg
|
||||
Rotary Encoder, components/sensor/rotary_encoder, rotary_encoder.jpg
|
||||
|
|
Loading…
Reference in New Issue
Block a user