Integration HA with local SMS Gateway

Hi all,

I needed to cover a state when my connectivity to the internet is broken, but I still need to send an SMS to my phone about a triggered alarm.
It exists some online services called SMS Gateways, but you still need connectivity to the internet to use it.
So I have created from my old GSM modem a local SMS gateway and integrated to my HA instance.
You can install it everywhere where you have an installed Python (raspberry pi, general Linux distro, etc.)
You can run my SMS gateway inside Docker as well.
You can find the guide how to install an run it on my GitHub page:
https://github.com/pajikos/sms-gammu-gateway

Home Assistant Integration Example:

Signal Strength sensor

- platform: rest
  resource: http://xxx.xxx.xxx.xxx:5000/signal
  name: GSM Signal
  scan_interval: 30
  value_template: '{{ value_json.SignalPercent }}'
  unit_of_measurement: '%'

SMS notification

notify:    
  - name: SMS GW
    platform: rest
    resource: http://xxx.xxx.xxx.xxx:5000/sms
    method: POST_JSON
    authentication: basic
    username: admin
    password: password
    target_param_name: number
    message_param_name: text

Using in Automation

- alias: Alarm Entry Alert - Garage Door
  trigger:
    platform: state
    entity_id: binary_sensor.garage_door
    state: 'on'
  condition:
    - platform: state
      entity_id: alarm_control_panel.alarm
      state: 'armed_home'
  action:
    service: notify.sms_gw
    data:
      message: 'alert, entry detected at garage door'
      target: '+xxxxxxxxxxxx'

GSM Signal Strength Indicator
2019-09-07%2000_02_46-Home%20Assistant

8 Likes

THis is awesome! Works like a charm… Do you have any intentions of making this a Hassio addon? Also, it would be great if this could be configured to receive data over sms so you can have possibly a sensor that could be configured based on the content of a sms received? Even if this was just a binary sensor that would be fantastic

Hi, thank you.
I am not using Hassio so I am not familiar with the making of it.
I understand, that it may exist some cases when it would be fine to have a general mechanism to accept SMS and call something in HA. On the other side, they exist other and more convenient ways how to configure you HA remotely. I do not have such a use case.

Work has been done in hassio 3.6 and this can now run inside hassio as docker container or directly by using chat from ppp

More details here

I would like to have the ability to actually turn off and on my cable modem via an SMS message sent directly from my mobile device if my internet is out and I am away from home.

Hello, I am using your API and works great but I have the question. How I canstart sms-gammu-gateway within start of raspbian? I use a standalone instalation without docker.

1 Like

Very nice application, thank you!
I’m running it in a Docker with old Huawei E156G modem.

Has anyone tried to use it on Synology?
I tried to set it that way but in SMS gateway logs I see: “POST /sms HTTP/1.1” 401 -

image
image
image
image

Hello Ambrozy
did you sort this out? i’m in the same boat…

Unfortunately not, but wasn’t so important so I stopped looking for a solution.

Thank you Pavel for your work,
I’m successfully installed it on another server of my network and I can send me SMS.
I’m new to HA, and I don’t known where I can put theses HA configuration information, to permit my HA server to communicate with my Gammu Server, could you give me some details please ?