yehor e02ced287b
All checks were successful
Build release image / build (push) Successful in 1m30s
Migrate more blog posts
2025-05-20 13:24:39 +03:00

1.7 KiB
Raw Permalink Blame History

slug title tags image
send-and-receive-sms-in-home-assistant-with-gsm-modem Send and receive SMS in Home Assistant with GSM modem
smart home
Home Assistant
home automation
SMS
GSM
/img/blog/2021/01/modem.jpg

Yes, it is possible and you dont need to build anything from sources. Sending SMS from your home could be useful, for example, to send emergency alerts. But what about receiving and parsing SMS messages? Well, I used it to integrate my car security system with my Home Assistant. Now my Home Assistant could start the engine of my car automatically to warm it up before driving to work.

First of all, we need to set up notification service via GSM modem following the official documentation. This will allow us to send SMS messages by calling the notify service, for example in automation action:

action:
  - service: notify.sms
    data:
      message: Hi!

But also this integration allows reading SMS messages sent to the modem phone number by listening to the sms.incoming_sms event.

trigger:
  - platform: event
    event_type: sms.incoming_sms

Automation trigger in UI

In automation action, we can now parse the message by searching keywords in it:

action:
  - choose:
      - conditions:
          - condition: template
            value_template: >-
              {{'engine is off' in trigger.event.data['text']}}
        sequence:
          -  ...

Parsing action

Here we are checking for the engine is off text in incoming SMS to perform some action. For example, to set the value of some input_boolean.