Home Assistant SMS Notifications

To send SMS from Home Assistant, define a rest_command that calls the curl-sms API and use it as an action in your automations. Useful for alerts that must reach you even when the app's push notifications don't: water leak, smoke, power failure.

1. Add the command

In configuration.yaml:

rest_command:
  send_sms:
    url: https://curl-sms.com/api/sms/send
    method: post
    headers:
      authorization: !secret curlsms_auth
    content_type: application/json
    payload: '{{ {"receiver": receiver, "body": message} | to_json }}'

In secrets.yaml:

curlsms_auth: "Bearer cs_test_…"

Restart Home Assistant. With a test key every request is checked but nothing is sent or charged; switch to cs_live_… when it works.

2. Use it in an automation

action: rest_command.send_sms
data:
  receiver: "+4915123456789"
  message: "Water leak detected in the basement"

Building the payload with to_json keeps quotes and line breaks in your message from breaking the JSON.

Alternative: MQTT via NAS or Docker

If you run the curl-sms app on a Synology NAS or the curl-sms Bridge in Docker (e.g. next to Home Assistant), switch on its MQTT input and publish to your broker:

action: mqtt.publish
data:
  topic: curlsms/send/015123456789
  payload: "Front door opened"

The number in the topic is digits only (0049… or 0151…), because + is not allowed in MQTT topics. Both also queue messages locally if the internet connection drops.

Tips

  • Keep alert texts short; one SMS part holds 160 characters.
  • Use the id from the response or a webhook if you want to log delivery.
  • Avoid loops: add a condition or a cooldown so a flapping sensor doesn't send dozens of SMS.

MQTT details: Synology app docs · Bridge docs.