Skip to content

Commit

Permalink
Incoming SMS handling for netgear_lte (#9047)
Browse files Browse the repository at this point in the history
* Incoming SMS handling for netgear_lte

* Fix sms_id

* ✏️ Tweak
  • Loading branch information
amelchio authored Mar 28, 2019
1 parent 0d441dd commit 831411c
Showing 1 changed file with 44 additions and 1 deletion.
45 changes: 44 additions & 1 deletion source/_components/netgear_lte.markdown
Original file line number Diff line number Diff line change
Expand Up @@ -48,7 +48,6 @@ netgear_lte:
monitored_conditions:
- usage
- sms

```
{% configuration %}
Expand Down Expand Up @@ -102,3 +101,47 @@ If you do not supply `notify` configuration, a default notification service with
The `netgear_lte` integration allows you to monitor your Netgear LTE modem.

If you do not supply `sensor` configuration, a default set of sensors is created.

## {% linkable_title Events %}

### {% linkable_title Event `netgear_lte_sms` %}

Messages arriving in the modem inbox are sent as events of type `netgear_lte_sms` with the following content.

| Event data attribute | Description |
| -------------------- | ---------------------------------------- |
| `host` | The modem that received the message.
| `sms_id` | The inbox ID of the received message.
| `from` | The sender of the message.
| `message` | The SMS message content.

## {% linkable_title Services %}

### {% linkable_title Service `netgear_lte.delete_sms` %}

The integration makes a service call available to delete messages from the modem inbox. This can be used to clean up after incoming SMS events.

| Service data attribute | Optional | Description |
| ---------------------- | -------- | ----------- |
| `host` | no | The modem that should have a message deleted.
| `sms_id` | no | Integer or list of integers with inbox IDs of messages to delete.

## {% linkable_title Examples %}

The following automation example processes incoming SMS messages with the [Conversation](/components/conversation/) integration and then deletes the message from the inbox.

```yaml
automation:
- alias: SMS conversation
trigger:
- platform: event
event_type: netgear_lte_sms
action:
- service: conversation.process
data_template:
text: '{{ trigger.event.data.message }}'
- service: netgear_lte.delete_sms
data_template:
host: '{{ trigger.event.data.host }}'
sms_id: '{{ trigger.event.data.sms_id }}'
```

0 comments on commit 831411c

Please sign in to comment.