Skip to content

Commit

Permalink
Sim800l dial (#1027)
Browse files Browse the repository at this point in the history
* Dial support for sim800l component

* fix

Co-authored-by: Guillermo Ruffino <[email protected]>
  • Loading branch information
spilin and glmnet authored Feb 25, 2021
1 parent 3cb84bb commit 11b46de
Showing 1 changed file with 29 additions and 7 deletions.
36 changes: 29 additions & 7 deletions components/sim800l.rst
Original file line number Diff line number Diff line change
Expand Up @@ -2,11 +2,11 @@ Sim800L Component
=================

.. seo::
:description: Instructions for setting up the SIM800L GSM module to send and receive SMS in ESPHome.
:description: Instructions for setting up the SIM800L GSM module to dial, 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
The ``SIM800L`` Component provides the ability to dial, 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``.
Expand Down Expand Up @@ -92,11 +92,24 @@ Send a SMS message to a phone recipient using this action in automations.
message: !lambda |-
return id(reed_switch).state ? "Door is now OPEN" : "Hey door just CLOSED";
.. _sim800l-dial_action:

``sim800l.dial`` Action
---------------------------

Dial to a phone recipient using this action in automations.

.. code-block:: yaml
on_...:
then:
- sim800l.dial:
recipient: '+15551234567'
Configuration options:

- **recipient** (***Required**, string, :ref:`templatable <config-templatable>`): The message recipient.
number.
- **message** (**Required**, string, :ref:`templatable <config-templatable>`): The message content.
- **recipient** (***Required**, string, :ref:`templatable <config-templatable>`): The number to dial.
- **id** (*Optional*, :ref:`config-id`): Manually specify the ID of the SIM800L if you have multiple components.

.. note::
Expand All @@ -105,14 +118,14 @@ Configuration options:

.. code-block:: cpp
id(sim800l1).send_sms("+15551234567", "The message content");
id(sim800l1).dial("+15551234567");
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.
on Home Assistant and will also setup a service so you can send messages and dial with your SIM800L.

.. code-block:: yaml
Expand All @@ -126,6 +139,12 @@ on Home Assistant and will also setup a service so you can send messages with yo
- sim800l.send_sms:
recipient: !lambda 'return recipient;'
message: !lambda 'return message;'
- service: dial
variables:
recipient: string
then:
- sim800l.dial:
recipient: !lambda 'return recipient;'
text_sensor:
- platform: template
Expand Down Expand Up @@ -159,6 +178,9 @@ To trigger the automation from Home Assistant you can invoke the service with th
data:
recipient: "+15551234567"
message: "Hello World!"
- service: esphome.livingroom_dial
data:
recipient: "+15551234567"
Relay management commands received from an authorized sender:
Expand Down

0 comments on commit 11b46de

Please sign in to comment.