SmsGateway for homeassistant

Hello,
I want to show a project that I started recently. It’s a sms gateway for homeassistant. This project is in a very early stage. But I successfully send sms from home assistant.

This is my setup:

  • Synology DS918+ as docker server
  • HomeAssistant (docker)
  • SmsGateway (docker)
  • Huawei E3131 (gsm modem connected to /dev/ttyUSB0 on synology)

You can pull image using this command
docker pull sebastianhaba/sms-gateway

This image accept environment variables

  • DEVICE - path to modem
  • ASPNETCORE_URLS - here you can start gateway on diffrent port

Homeassistant notify configuration:

- platform: rest
  name: sms
  resource: http://[container_ip]:[container_exposed_port]/api/sms
  method: POST_JSON
  verify_ssl: false
  message_param_name: Message
  target_param_name: Recipient

and you can call it from homeassistant:

service: notify.sms
data: {"target":"<phone_number>", "message":"<your_message>"}

SourceCode: SmsGateway,GsmModem

Please note: all source code is on develop branch and I currently pushed code that is using stable version of dotnetcore sdk, so it will run only on windows. Docker image works on linux because is using preview6 version of dotnetcore 3.0 sdk.

2 Likes

For info I built a few month ago an SMStoMQTT, MQTTtoSMS gateway. If you are interested don’t hesitate to ask questions.

1 Like