Merge branch 'next' of https://github.com/esphome/esphome-docs into next
52
components/climate/yashima.rst
Normal file
@ -0,0 +1,52 @@
|
||||
Yashima Remote Climate
|
||||
======================
|
||||
|
||||
.. seo::
|
||||
:description: Controls a Yashima compatible Climate via IR
|
||||
:image: air-conditioner.png
|
||||
|
||||
The ``yashima`` climate platform allows you to control a Yashima compatible AC unit by sending IR signals
|
||||
as your remote unit would do.
|
||||
|
||||
This component requires that you have setup a :doc:`/components/remote_transmitter`.
|
||||
|
||||
Due to the unidirectional nature of IR remote controllers, this component cannot determine the
|
||||
actual state of the device, and will assume the state of the device is the latest state requested.
|
||||
|
||||
.. figure:: images/climate-ui.png
|
||||
:align: center
|
||||
:width: 60.0%
|
||||
|
||||
.. code-block:: yaml
|
||||
|
||||
# Example configuration entry
|
||||
remote_transmitter:
|
||||
pin: GPIO32
|
||||
carrier_duty_percent: 50%
|
||||
|
||||
climate:
|
||||
- platform: yashima
|
||||
name: "Living Room AC"
|
||||
|
||||
Configuration variables:
|
||||
------------------------
|
||||
|
||||
- **name** (**Required**, string): The name for the climate.
|
||||
- **supports_cool** (*Optional*, boolean): Enables setting cool mode for this climate device. Defaults to ``True``.
|
||||
- **supports_heat** (*Optional*, boolean): Enables setting cool heat for this climate device. Defaults to ``True``.
|
||||
- **sensor** (*Optional*, :ref:`config-id`): The sensor that is used to measure the ambient
|
||||
temperature. This is only for reporting the current temperature in the frontend.
|
||||
- All other options from :ref:`Climate <config-climate>`.
|
||||
|
||||
Advanced options:
|
||||
|
||||
- **id** (*Optional*, :ref:`config-id`): Manually specify the ID used for code generation.
|
||||
- **transmitter_id** (*Optional*, :ref:`config-id`): Manually specify the ID of the remote transmitter.
|
||||
|
||||
See Also
|
||||
--------
|
||||
|
||||
- :doc:`/components/climate/index`
|
||||
- :doc:`/components/remote_transmitter`
|
||||
- :apiref:`yashima/yashima.h`
|
||||
- :ghedit:`Edit`
|
@ -58,6 +58,11 @@ Configuration variables:
|
||||
- **assumed_state** (*Optional*, boolean): Whether the true state of the cover is not known.
|
||||
This will make the Home Assistant frontend show buttons for both OPEN and CLOSE actions, instead
|
||||
of hiding one of them. Defaults to ``false``.
|
||||
- **tilt_action** (*Optional*, :ref:`Action <config-action>`): The action that should
|
||||
be performed when the remote (like Home Assistant's frontend) requests the cover be set to a specific
|
||||
tilt position.
|
||||
- **tilt_lambda** (*Optional*, :ref:`lambda <config-lambda>`):
|
||||
Lambda to be evaluated repeatedly to get the current tilt position of the cover.
|
||||
- **id** (*Optional*, :ref:`config-id`): Manually specify the ID used for code generation.
|
||||
- All other options from :ref:`Cover <config-cover>`.
|
||||
|
||||
@ -94,7 +99,9 @@ Configuration options:
|
||||
- **state** (*Optional*, :ref:`templatable <config-templatable>`):
|
||||
The state to publish. One of ``OPEN``, ``CLOSED``. If using a lambda, use ``COVER_OPEN`` or ``COVER_CLOSED``.
|
||||
- **position** (*Optional*, :ref:`templatable <config-templatable>`, float):
|
||||
The position to publish, from 0.0 (CLOSED) to 1.0 (OPEN)
|
||||
The position to publish, from 0 (CLOSED) to 1.0 (OPEN)
|
||||
- **tilt** (*Optional*, :ref:`templatable <config-templatable>`, float):
|
||||
The tilt position to publish, from 0 (CLOSED) to 1.0 (OPEN)
|
||||
- **current_operation** (*Optional*, :ref:`templatable <config-templatable>`, string):
|
||||
The current operation mode to publish. One of ``IDLE``, ``OPENING`` and ``CLOSING``. If using a lambda, use ``COVER_OPERATION_IDLE``, ``COVER_OPERATION_OPENING``, and ``COVER_OPERATION_CLOSING``.
|
||||
|
||||
@ -105,6 +112,7 @@ Configuration options:
|
||||
.. code-block:: cpp
|
||||
|
||||
id(template_cov).position = COVER_OPEN;
|
||||
id(template_cov).tilt = 0.5;
|
||||
id(template_cov).publish_state();
|
||||
|
||||
See Also
|
||||
|
BIN
components/images/sim800l-full.jpg
Executable file
After Width: | Height: | Size: 32 KiB |
@ -14,7 +14,7 @@ handles setting the pin and some other settings, and individual
|
||||
:ref:`remote receiver binary sensors <remote-receiver-binary-sensor>`
|
||||
which will trigger when they hear their own configured signal.
|
||||
|
||||
**See :ref:`remote-setting-up-infrared` and :ref:`remote-setting-up-rf` for set up guides.**
|
||||
**See** :ref:`remote-setting-up-infrared` **and** :ref:`remote-setting-up-rf` **for set up guides.**
|
||||
|
||||
.. code-block:: yaml
|
||||
|
||||
@ -151,7 +151,8 @@ Remote code selection (exactly one of these has to be included):
|
||||
|
||||
- **rc_switch_raw**: Trigger on a decoded RC Switch raw remote code with the given data.
|
||||
|
||||
- **code** (**Required**, string): The remote code to listen for, copy this from the dumper output.
|
||||
- **code** (**Required**, string): The remote code to listen for, copy this from the dumper output. To ignore a bit
|
||||
in the received data, use ``x`` at that place in the **code**.
|
||||
- **protocol** (*Optional*): The RC Switch protocol to use, see :ref:`remote_transmitter-rc_switch-protocol` for more info.
|
||||
|
||||
- **rc_switch_type_a**: Trigger on a decoded RC Switch Type A remote code with the given data.
|
||||
|
@ -14,7 +14,7 @@ First, you need to setup a global hub that specifies which pin your remote
|
||||
sender is connected to. Then you can use the available actions to send encoded
|
||||
remote signals.
|
||||
|
||||
**See :ref:`remote-setting-up-infrared` and :ref:`remote-setting-up-rf` for set up guides.**
|
||||
**See** :ref:`remote-setting-up-infrared` **and** :ref:`remote-setting-up-rf` **for set up guides.**
|
||||
|
||||
.. note::
|
||||
|
||||
|
203
components/sensor/atm90e32.rst
Normal file
@ -0,0 +1,203 @@
|
||||
ATM90E32 Power Sensor
|
||||
=====================
|
||||
|
||||
.. seo::
|
||||
:description: Instructions for setting up ATM90E32 energy metering sensors
|
||||
:image: atm90e32.png
|
||||
:keywords: ATM90E32, CircuitSetup, Split Single Phase Real Time Whole House Energy Meter, Expandable 6 Channel ESP32 Energy Meter Main Board
|
||||
|
||||
The ``atm90e32`` sensor platform allows you to use your ATM90E32 voltage/current and power sensors
|
||||
(`datasheet <http://ww1.microchip.com/downloads/en/devicedoc/Atmel-46003-SE-M90E32AS-Datasheet.pdf>`__) sensors with
|
||||
ESPHome. This sensor is commonly found in CircuitSetup 2 and 6 channel energy meters.
|
||||
|
||||
Communication with the device is done via an :ref:`SPI bus <spi>`, so you need to have an ``spi:`` entry in your configuration
|
||||
with both ``mosi_pin`` and ``miso_pin`` set.
|
||||
|
||||
The atm90e32 IC can measure up to three AC voltages although typically only one
|
||||
voltage measurement would be used for the mains electricity phase of a
|
||||
household. Three current measurements are read via CT clamps.
|
||||
|
||||
The `CircuitSetup 2-Channel Energy Monitor <https://circuitsetup.us/index.php/product/split-single-phase-real-time-whole-house-energy-meter-v1-2/>`__ can read 2 current channels and one voltage channel.
|
||||
|
||||
.. figure:: images/atm90e32-cs-2chan-full.jpg
|
||||
:align: center
|
||||
:width: 50.0%
|
||||
|
||||
CircuitSetup Split Single Phase Real Time Whole House Energy Meter.
|
||||
|
||||
The `CircuitSetup 6-Channel Energy Monitor <https://circuitsetup.us/index.php/product/expandable-6-channel-esp32-energy-meter/>`__ can read 6 current channels and 2 voltage channels at a time, this board has two atm90e32 ICs and requires two sensors to be configured in ESPHome.
|
||||
|
||||
.. figure:: images/atm90e32-cs-6chan-full.jpg
|
||||
:align: center
|
||||
:width: 50.0%
|
||||
|
||||
CircuitSetup Expandable 6 Channel ESP32 Energy Meter Main Board.
|
||||
|
||||
.. code-block:: yaml
|
||||
|
||||
# Example configuration entry
|
||||
spi:
|
||||
clk_pin: 18
|
||||
miso_pin: 19
|
||||
mosi_pin: 23
|
||||
|
||||
sensor:
|
||||
- platform: atm90e32
|
||||
cs_pin: 5
|
||||
phase_a:
|
||||
voltage:
|
||||
name: "EMON Line Voltage A"
|
||||
current:
|
||||
name: "EMON CT1 Current"
|
||||
power:
|
||||
name: "EMON Active Power CT1"
|
||||
gain_voltage: 41820
|
||||
gain_ct: 25498
|
||||
phase_b:
|
||||
current:
|
||||
name: "EMON CT2 Current"
|
||||
power:
|
||||
name: "EMON Active Power CT2"
|
||||
gain_voltage: 41820
|
||||
gain_ct: 25498
|
||||
frequency:
|
||||
name: "EMON Line Frequency"
|
||||
line_frequency: 50Hz
|
||||
gain_pga: 2X
|
||||
update_interval: 60s
|
||||
|
||||
Configuration variables:
|
||||
------------------------
|
||||
|
||||
- **cs_pin** (**Required**, :ref:`Pin Schema <config-pin_schema>`): The pin CS is connected to.
|
||||
- **line_frequency** (**Required**, string): The AC line frequency of the supply voltage. One of ``50Hz``, ``60Hz``.
|
||||
- **phase_a** (*Optional*): The configuration options for the 1st phase.
|
||||
|
||||
- **voltage** (*Optional*): Use the voltage value of this phase in V (RMS).
|
||||
All options from :ref:`Sensor <config-sensor>`.
|
||||
- **current** (*Optional*): Use the current value of this phase in amperes. All options from
|
||||
:ref:`Sensor <config-sensor>`.
|
||||
- **power** (*Optional*): Use the power value on this phase in watts. All options from
|
||||
:ref:`Sensor <config-sensor>`.
|
||||
- **gain_voltage** (*Optional*, int): Voltage gain to scale the low voltage AC power pack to household mains feed.
|
||||
Defaults to ``41820``.
|
||||
- **gain_ct** (*Optional*, int): CT clamp calibration for this phase.
|
||||
Defaults to ``25498``.
|
||||
|
||||
- **phase_b** (*Optional*): The configuration options for the 2nd phase. Same options as 1st phase.
|
||||
- **phase_c** (*Optional*): The configuration options for the 3rd phase. Same options as 1st phase.
|
||||
- **gain_pga** (*Optional*, string): The gain for the CT clamp, ``2X`` for 100A, ``4X`` for 100A - 200A. One of ``1X``, ``2X``, ``4X``.
|
||||
Defaults to ``2X`` which is suitable for the popular SCT-013-000 clamp.
|
||||
- **update_interval** (*Optional*, :ref:`config-time`): The interval to check the sensor. Defaults to ``60s``.
|
||||
- **spi_id** (*Optional*, :ref:`config-id`): Manually specify the ID of the :ref:`SPI Component <spi>` if you want
|
||||
to use multiple SPI buses.
|
||||
|
||||
Calibration
|
||||
-----------
|
||||
|
||||
This sensor needs calibration to show correct values. The default gain configuration is set to use the `SCT-013-000 <https://amzn.to/2E0KVvo>`__
|
||||
current transformers, and the `Jameco Reliapro 9v AC transformer <https://amzn.to/2XcWJjI>`__.
|
||||
A load which uses a known amount of current can be used to calibrate. For for a more accurate calibration use a
|
||||
`Kill-A-Watt <https://amzn.to/2TXT7jx>`__ meter or similar, mains voltages can fluctuate depending on grid load.
|
||||
|
||||
Voltage
|
||||
^^^^^^^
|
||||
|
||||
Use the expected mains voltage for your region 110V/230V or plug in the Kill-A-Watt and select voltage. See what
|
||||
value the ATM90E32 sensor reports for voltage. To adjust the sensor use the calculation:
|
||||
|
||||
``New gain_voltage = (your voltage reading / ESPHome voltage reading) * existing gain_voltage value``
|
||||
|
||||
Update **gain_voltage** for all phases in your ESPHome yaml, recompile and upload. Repeat as necessary.
|
||||
|
||||
Current
|
||||
^^^^^^^
|
||||
|
||||
Switch on the current load and see what value the ATM90E32 sensor reports for
|
||||
current on the selected phase. Using the known or measured current adjust the
|
||||
sensor using calculation:
|
||||
|
||||
``New gain_ct = (your current reading / ESPHome current reading) * existing gain_ct value``
|
||||
|
||||
Update **gain_ct** for the phase in your ESPHome yaml, recompile and upload. Repeat as necessary.
|
||||
|
||||
It is possible that the two identical CT current sensors will have different
|
||||
**gain_ct** numbers due to variances in manufacturing although it will be
|
||||
small. The current calibration can be done once and used on all sensors or
|
||||
repeated for each one.
|
||||
|
||||
Additional Examples
|
||||
-------------------
|
||||
|
||||
.. code-block:: yaml
|
||||
|
||||
# Example CircuitSetup 6-channel entry
|
||||
spi:
|
||||
clk_pin: 18
|
||||
miso_pin: 19
|
||||
mosi_pin: 23
|
||||
sensor:
|
||||
- platform: atm90e32
|
||||
cs_pin: 5
|
||||
phase_a:
|
||||
voltage:
|
||||
name: "EMON Line Voltage A"
|
||||
current:
|
||||
name: "EMON CT1 Current"
|
||||
power:
|
||||
name: "EMON Active Power CT1"
|
||||
gain_voltage: 47660
|
||||
gain_ct: 12577
|
||||
phase_b:
|
||||
current:
|
||||
name: "EMON CT2 Current"
|
||||
power:
|
||||
name: "EMON Active Power CT2"
|
||||
gain_voltage: 47660
|
||||
gain_ct: 12577
|
||||
phase_c:
|
||||
current:
|
||||
name: "EMON CT3 Current"
|
||||
power:
|
||||
name: "EMON Active Power CT3"
|
||||
gain_voltage: 47660
|
||||
gain_ct: 12577
|
||||
frequency:
|
||||
name: "EMON Line Frequency"
|
||||
line_frequency: 50Hz
|
||||
gain_pga: 2X
|
||||
update_interval: 60s
|
||||
- platform: atm90e32
|
||||
cs_pin: 4
|
||||
phase_a:
|
||||
current:
|
||||
name: "EMON CT4 Current"
|
||||
power:
|
||||
name: "EMON Active Power CT4"
|
||||
gain_voltage: 47660
|
||||
gain_ct: 12577
|
||||
phase_b:
|
||||
current:
|
||||
name: "EMON CT5 Current"
|
||||
power:
|
||||
name: "EMON Active Power CT5"
|
||||
gain_voltage: 47660
|
||||
gain_ct: 12577
|
||||
phase_c:
|
||||
current:
|
||||
name: "EMON CT6 Current"
|
||||
power:
|
||||
name: "EMON Active Power CT6"
|
||||
gain_voltage: 47660
|
||||
gain_ct: 12577
|
||||
line_frequency: 50Hz
|
||||
gain_pga: 2X
|
||||
update_interval: 60s
|
||||
|
||||
|
||||
See Also
|
||||
--------
|
||||
|
||||
- :ref:`sensor-filters`
|
||||
- :apiref:`atm90e32/atm90e32.h`
|
||||
- :ghedit:`Edit`
|
BIN
components/sensor/images/atm90e32-cs-2chan-full.jpg
Normal file
After Width: | Height: | Size: 90 KiB |
BIN
components/sensor/images/atm90e32-cs-6chan-full.jpg
Normal file
After Width: | Height: | Size: 91 KiB |
BIN
components/sensor/images/tx20.jpg
Normal file
After Width: | Height: | Size: 102 KiB |
BIN
components/sensor/images/zgm053-connection.jpg
Normal file
After Width: | Height: | Size: 208 KiB |
BIN
components/sensor/images/zgm053-full.jpg
Normal file
After Width: | Height: | Size: 35 KiB |
86
components/sensor/tx20.rst
Normal file
@ -0,0 +1,86 @@
|
||||
Tx20/Tx23 Wind Speed/Direction Sensor
|
||||
=====================================
|
||||
|
||||
.. seo::
|
||||
:description: Instructions for setting up Tx20/Tx23 wind speed and direction sensors
|
||||
:image: images/tx20.jpg
|
||||
:keywords: Tx20
|
||||
|
||||
The ``tx20`` sensor platform allows you to use your Tx20/Tx23
|
||||
(`Amazon`_,
|
||||
`lacrosse_tx23`_)
|
||||
wind direction and speed sensors with ESPHome.
|
||||
The only required pin is the black or brown cable (which is used to transmit data.)
|
||||
The red cable should be connected to VCC (3.3V), green initiates the data transfer when connected to GND
|
||||
and should therefore be directly connected to GND and the yellow cable should be always connected to ground.
|
||||
The difference from the Tx20 to the Tx23 seems to be that the green cable does not matter anymore and the
|
||||
wind sensor is just sending a datagram every 2 seconds - pretty much the same as when the green cable was
|
||||
connected to GND in the Tx20.
|
||||
|
||||
.. figure:: images/tx20.jpg
|
||||
:align: center
|
||||
:width: 50.0%
|
||||
|
||||
Tx20 / Tx23 Wind Speed / Direction.
|
||||
|
||||
.. _Amazon: https://www.amazon.de/Technoline-Tx-20/dp/B01HXZ3KLA
|
||||
.. _lacrosse_tx23: https://www.lacrossetechnology.com/tx23-wind-sensor
|
||||
|
||||
.. code-block:: yaml
|
||||
|
||||
# Example configuration entry
|
||||
sensor:
|
||||
- platform: tx20
|
||||
wind_speed:
|
||||
name: "Windspeed"
|
||||
wind_direction_degrees:
|
||||
name: "Winddirection Degrees"
|
||||
pin:
|
||||
number: GPIO04
|
||||
|
||||
|
||||
Configuration variables:
|
||||
------------------------
|
||||
|
||||
- **wind_speed** (**Required**): The information for the wind speed sensor.
|
||||
|
||||
- **name** (**Required**, string): The name for the wind speed
|
||||
sensor.
|
||||
- **id** (*Optional*, :ref:`config-id`): Set the ID of this sensor for use in lambdas.
|
||||
- All other options from :ref:`Sensor <config-sensor>`.
|
||||
|
||||
- **wind_direction_degrees** (**Required**): The information for the direction
|
||||
in degrees sensor.
|
||||
|
||||
- **name** (**Required**, string): The name for the direction sensor.
|
||||
- **id** (*Optional*, :ref:`config-id`): Set the ID of this sensor for use in lambdas.
|
||||
- All other options from :ref:`Sensor <config-sensor>`.
|
||||
|
||||
- **pin** (**Required**, :ref:`config-pin`): The pin, where the black or brown
|
||||
cable are connected.
|
||||
|
||||
.. note::
|
||||
|
||||
In order to create a text sensor to show the textual representation of the wind direction
|
||||
the following config can be used. "tx20_id" needs to be replaced with the id of the Tx20 sensor.
|
||||
|
||||
.. code-block:: yaml
|
||||
|
||||
text_sensor:
|
||||
- platform: template
|
||||
name: "Textual Representation Wind Direction"
|
||||
lambda: |-
|
||||
return {id(tx20_id).get_wind_cardinal_direction()};
|
||||
update_interval: 2s
|
||||
|
||||
|
||||
See Also
|
||||
--------
|
||||
|
||||
- :ref:`sensor-filters`
|
||||
- :apiref:`tx20/tx20.h`
|
||||
- `Amazon Tx20 <https://www.amazon.de/Technoline-Tx-20/dp/B01HXZ3KLA>`__
|
||||
- `La Crosse Tx23 <https://www.lacrossetechnology.com/tx23-wind-sensor>`__
|
||||
- `Datagram Tx20 <http://www.sdpro.eu/jm/images/allegati/Tx20_Documentazione.pdf>`__
|
||||
- `Datagram Tx23 <https://www.lacrossetechnology.com/tx23-wind-sensor>`__-
|
||||
- :ghedit:`Edit`
|
84
components/sensor/zyaura.rst
Normal file
@ -0,0 +1,84 @@
|
||||
ZyAura CO2 & Temperature & Humidity Sensor
|
||||
==========================================
|
||||
|
||||
.. seo::
|
||||
:description: Instructions for setting up ZyAura co2, temperature and humidity monitors.
|
||||
:image: zgm053.jpg
|
||||
:keywords: CO2, MT8057, MT8057S, MT8060, ZGm05, ZGm053U, ZG1683R, ZG1583RUD
|
||||
|
||||
The ZyAura CO2 & Temperature & Humidity sensor allows you to use your
|
||||
`ZGm05(3)(U) <http://www.zyaura.com/products/ZGm05.asp>`__
|
||||
(`MT8057 <https://masterkit.ru/shop/1266110>`__, `MT8057S <https://medgadgets.ru/shop/kit-mt8057.html>`__),
|
||||
`ZG1683R(U) <http://www.zyaura.com/products/ZG1683R.asp>`__ (`MT8060 <https://masterkit.ru/shop/1921398>`__),
|
||||
`ZG1583RUD <http://www.zyaura.com/products/ZG1583RUD.asp>`__
|
||||
monitors with ESPHome.
|
||||
|
||||
.. figure:: images/zgm053-full.jpg
|
||||
:align: center
|
||||
:width: 80.0%
|
||||
|
||||
ZyAura ZGm053U CO2 & Temperature Monitor.
|
||||
|
||||
.. figure:: images/zgm053-connection.jpg
|
||||
:align: center
|
||||
:width: 80.0%
|
||||
|
||||
ZyAura ZGm053U connection diagram (1 - empty, 2 - clock, 3 - data, 4 - GND).
|
||||
|
||||
.. code-block:: yaml
|
||||
|
||||
# Example configuration entry
|
||||
sensor:
|
||||
- platform: zyaura
|
||||
clock_pin: D1
|
||||
data_pin: D2
|
||||
co2:
|
||||
name: "ZyAura CO2"
|
||||
temperature:
|
||||
name: "ZyAura Temperature"
|
||||
humidity:
|
||||
name: "ZyAura Humidity"
|
||||
|
||||
Configuration variables:
|
||||
------------------------
|
||||
|
||||
- **clock_pin** (**Required**, :ref:`config-pin`): The pin where the clock bus is connected.
|
||||
- **data_pin** (**Required**, :ref:`config-pin`): The pin where the data bus is connected.
|
||||
- **co2** (*Optional*): The information for the CO2 sensor.
|
||||
|
||||
- **name** (**Required**, string): The name for the CO2 sensor.
|
||||
- **id** (*Optional*, :ref:`config-id`): Set the ID of this sensor for use in lambdas.
|
||||
- All other options from :ref:`Sensor <config-sensor>`.
|
||||
|
||||
- **temperature** (*Optional*): The information for the temperature sensor.
|
||||
|
||||
- **name** (**Required**, string): The name for the temperature sensor.
|
||||
- **id** (*Optional*, :ref:`config-id`): Set the ID of this sensor for use in lambdas.
|
||||
- All other options from :ref:`Sensor <config-sensor>`.
|
||||
|
||||
- **humidity** (*Optional*): The information for the humidity sensor
|
||||
|
||||
- **name** (**Required**, string): The name for the humidity sensor.
|
||||
- **id** (*Optional*, :ref:`config-id`): Set the ID of this sensor for use in lambdas.
|
||||
- All other options from :ref:`Sensor <config-sensor>`.
|
||||
|
||||
- **update_interval** (*Optional*, :ref:`config-time`): The interval to check the
|
||||
sensor. Defaults to ``60s``.
|
||||
|
||||
|
||||
.. note::
|
||||
|
||||
ZGm05 monitor (and maybe others) needs some initial time to get correct data when powered
|
||||
on. Only after this timespan will the sensor report correct values. It's not recommended to set
|
||||
``update_interval`` lower than ``20s``.
|
||||
|
||||
See Also
|
||||
--------
|
||||
|
||||
- :ref:`sensor-filters`
|
||||
- :doc:`mhz19`
|
||||
- `CO2mon-esp firmware <https://github.com/Anonym-tsk/co2mon-esp>`__ by `@anonym-tsk <https://github.com/Anonym-tsk>`__
|
||||
- `Some information about hacking MT8060 <https://habr.com/ru/company/dadget/blog/394333/>`__
|
||||
- `CO2MeterHacking project <https://revspace.nl/CO2MeterHacking>`__
|
||||
- :apiref:`zyaura/zyaura.h`
|
||||
- :ghedit:`Edit`
|
165
components/sim800l.rst
Normal file
@ -0,0 +1,165 @@
|
||||
Sim800L Component
|
||||
=================
|
||||
|
||||
.. seo::
|
||||
:description: Instructions for setting up the SIM800L gsm module to send and receive SMS in ESPHome.
|
||||
:image: sim800l.jpg
|
||||
:keywords: SMS SIM800L GSM
|
||||
|
||||
The ``SIM800L`` Component provides the ability to send and receive SMS text messages. The device must be
|
||||
connected via a :doc:`UART bus </components/uart>` supporting both receiving and transmitting line.
|
||||
The uart bus must be configured at the same speed of the module which is by default 9600bps.
|
||||
The required connection wires are ``+VCC``, ``GND``, ``RX`` and ``TX``.
|
||||
|
||||
.. warning::
|
||||
|
||||
If you are using the :doc:`logger` make sure you are not using the same pins for ``TX`` and ``RX`` or
|
||||
otherwise disable the uart logging with the ``baud_rate: 0`` option.
|
||||
|
||||
.. note::
|
||||
|
||||
This module requires a power supply between 3.8V and 4.2V that can handle current spikes up
|
||||
to 2 amps, it will not work by powering from the same 3.3v power source of the ESP. However you can
|
||||
connect ``TX`` and ``RX`` lines directly without any level shifter.
|
||||
|
||||
.. figure:: images/sim800l-full.jpg
|
||||
:align: center
|
||||
:width: 60.0%
|
||||
|
||||
.. code-block:: yaml
|
||||
|
||||
# Example configuration entry
|
||||
uart:
|
||||
baud_rate: 9600
|
||||
tx_pin: TX
|
||||
rx_pin: RX
|
||||
|
||||
sim800l:
|
||||
on_sms_received:
|
||||
- logger.log:
|
||||
format: "Received '%s' from %s"
|
||||
args: [ 'message.c_str()', 'sender.c_str()' ]
|
||||
|
||||
Configuration variables:
|
||||
------------------------
|
||||
|
||||
- **uart_id** (*Optional*, :ref:`config-id`): Manually specify the ID of the UART hub.
|
||||
- **id** (*Optional*, :ref:`config-id`): Manually specify the ID used for code generation.
|
||||
- **on_sms_received** (*Optional*, :ref:`Automation <automation>`): An action to be
|
||||
performed when a sms is received. See :ref:`sim800l-on_sms_received`.
|
||||
|
||||
.. _sim800l-on_sms_received:
|
||||
|
||||
``on_sms_received`` Trigger
|
||||
---------------------------
|
||||
|
||||
With this configuration option you can write complex automations whenever a sms message
|
||||
is received. To use the message content, use a :ref:`lambda <config-lambda>`
|
||||
template, the message content and the sender phone number are available inside that lambda
|
||||
under the variables named ``message`` and ``sender`` respectively.
|
||||
|
||||
.. code-block:: yaml
|
||||
|
||||
on_sms_received:
|
||||
- lambda: |-
|
||||
id(sms_sender).publish_state(sender);
|
||||
id(sms_message).publish_state(message);
|
||||
|
||||
|
||||
.. _sim800l-send_sms_action:
|
||||
|
||||
``sim800l.send_sms`` Action
|
||||
---------------------------
|
||||
|
||||
Send a SMS message to a phone recipient using this action in automations.
|
||||
|
||||
.. code-block:: yaml
|
||||
|
||||
on_...:
|
||||
then:
|
||||
- sim800l.send_sms:
|
||||
recipient: '+15551234567'
|
||||
message: Hello there
|
||||
|
||||
# Templated:
|
||||
- sim800l.send_sms:
|
||||
recipient: !lambda |-
|
||||
if (id(reed_switch).state) return "+15551234567";
|
||||
else return "15551234568";
|
||||
message: !lambda |-
|
||||
return id(reed_switch).state ? "Door is now OPEN" : "Hey door just CLOSED";
|
||||
|
||||
Configuration options:
|
||||
|
||||
- **recipient** (***Required**, string, :ref:`templatable <config-templatable>`): The message recipient.
|
||||
number.
|
||||
- **message** (**Required**, string, :ref:`templatable <config-templatable>`): The message content.
|
||||
- **id** (*Optional*, :ref:`config-id`): Manually specify the ID of the Sim800L if you have multiple components.
|
||||
|
||||
.. note::
|
||||
|
||||
This action can also be written in :ref:`lambdas <config-lambda>`:
|
||||
|
||||
.. code-block:: cpp
|
||||
|
||||
id(sim800l1).send_sms("+15551234567", "The message content");
|
||||
|
||||
|
||||
Getting started with Home Assistant
|
||||
-----------------------------------
|
||||
|
||||
The following code will get you up and running with a configuration updating received messages
|
||||
on Home Assistant and will also setup a service so you can send messages with your Sim800L.
|
||||
|
||||
.. code-block:: yaml
|
||||
|
||||
api:
|
||||
services:
|
||||
- service: send_sms
|
||||
variables:
|
||||
recipient: string
|
||||
message: string
|
||||
then:
|
||||
- sim800l.send_sms:
|
||||
recipient: !lambda 'return recipient;'
|
||||
message: !lambda 'return message;'
|
||||
|
||||
text_sensor:
|
||||
- platform: template
|
||||
id: sms_sender
|
||||
name: "Sms Sender"
|
||||
- platform: template
|
||||
id: sms_message
|
||||
name: "Sms Message"
|
||||
|
||||
uart:
|
||||
baud_rate: 9600
|
||||
tx_pin: TX
|
||||
rx_pin: RX
|
||||
|
||||
sim800l:
|
||||
on_sms_received:
|
||||
- lambda: |-
|
||||
id(sms_sender).publish_state(sender);
|
||||
id(sms_message).publish_state(message);
|
||||
|
||||
Now your latest received sms and sender number will be displayed by the text sensors.
|
||||
|
||||
To trigger the automation from Home Assistant you can invoke the service with this code:
|
||||
|
||||
.. code-block:: yaml
|
||||
|
||||
automation:
|
||||
# ...
|
||||
action:
|
||||
- service: esphome.livingroom_send_sms
|
||||
data:
|
||||
recipient: "+15551234567"
|
||||
message: "Hello World!"
|
||||
|
||||
See Also
|
||||
--------
|
||||
|
||||
- :apiref:`sim800l/sim800l.h`
|
||||
- :doc:`/components/uart`
|
||||
- :ghedit:`Edit`
|
@ -326,6 +326,7 @@ All Triggers
|
||||
- :doc:`remote_receiver.on_* </components/remote_receiver>`
|
||||
- :doc:`sun.on_sunrise </components/sun>` / :doc:`sun.on_sunset </components/sun>`
|
||||
- :ref:`switch.on_turn_on/off <switch-on_turn_on_off_trigger>`
|
||||
- :ref:`sim800l.on_sms_received <sim800l-on_sms_received>`
|
||||
|
||||
All Actions
|
||||
-----------
|
||||
@ -360,6 +361,7 @@ All Actions
|
||||
- :ref:`sensor.integration.reset <sensor-integration-reset_action>`
|
||||
- :ref:`display.page.show_* <display-pages>`
|
||||
- :ref:`uart.write <uart-write_action>`
|
||||
- :ref:`sim800l.send_sms <sim800l-send_sms_action>`
|
||||
|
||||
.. _config-condition:
|
||||
|
||||
|
BIN
images/atm90e32.jpg
Normal file
After Width: | Height: | Size: 34 KiB |
BIN
images/sim800l.jpg
Executable file
After Width: | Height: | Size: 23 KiB |
BIN
images/tx20.jpg
Normal file
After Width: | Height: | Size: 10 KiB |
BIN
images/zgm053.jpg
Normal file
After Width: | Height: | Size: 21 KiB |
@ -90,6 +90,7 @@ Sensor Components
|
||||
ADS1115, components/sensor/ads1115, ads1115.jpg
|
||||
AM2320, components/sensor/am2320, am2320.jpg
|
||||
APDS9960, components/sensor/apds9960, apds9960.jpg
|
||||
ATM90E32, components/sensor/atm90e32, atm90e32.jpg
|
||||
BH1750, components/sensor/bh1750, bh1750.jpg
|
||||
Binary Sensor Map, components/sensor/binary_sensor_map, binary_sensor_map.jpg
|
||||
BLE RSSI, components/sensor/ble_rssi, bluetooth.svg
|
||||
@ -132,11 +133,13 @@ Sensor Components
|
||||
Template Sensor, components/sensor/template, description.svg
|
||||
Total Daily Energy, components/sensor/total_daily_energy, sigma.svg
|
||||
TSL2561, components/sensor/tsl2561, tsl2561.jpg
|
||||
Tx20, components/sensor/tx20, tx20.jpg
|
||||
Ultrasonic Sensor, components/sensor/ultrasonic, ultrasonic.jpg
|
||||
Uptime Sensor, components/sensor/uptime, timer.svg
|
||||
WiFi Signal Strength, components/sensor/wifi_signal, network-wifi.svg
|
||||
Xiaomi MiFlora, components/sensor/xiaomi_miflora, xiaomi_miflora.jpg
|
||||
Xiaomi MiJia, components/sensor/xiaomi_mijia, xiaomi_mijia.jpg
|
||||
ZyAura, components/sensor/zyaura, zgm053.jpg
|
||||
Custom Sensor, components/sensor/custom, language-cpp.svg
|
||||
|
||||
Looking for a sensor that outputs its values as an analog voltage? Have a look at the
|
||||
@ -269,6 +272,7 @@ Climate Components
|
||||
Custom Climate, components/climate/custom, language-cpp.svg
|
||||
Coolix IR Remote, components/climate/coolix, air-conditioner.svg
|
||||
Tcl112 IR Remote, components/climate/tcl112, air-conditioner.svg
|
||||
Yashima IR Remote, components/climate/yashima, air-conditioner.svg
|
||||
|
||||
Misc Components
|
||||
---------------
|
||||
@ -293,6 +297,7 @@ Misc Components
|
||||
|
||||
PCF8574 I/O Expander, components/pcf8574, pcf8574.jpg
|
||||
MCP23017 I/O Expander, components/mcp23017, mcp23017.svg
|
||||
SIM800L, components/sim800l, sim800l.jpg
|
||||
Debug Component, components/debug, bug-report.svg
|
||||
|
||||
Additional Custom Components
|
||||
|