textbee Logotextbee.dev
Save 44% with yearly billing.View Plans

Smart home

Home Assistant SMS notifications: send and receive texts through your own phone

Published and updated

Home Assistant can text you, or anyone, without an SMS provider account. A rest_command in configuration.yaml posts to the textbee send endpoint, and any automation calls it like a notify action. For the other direction, a webhook trigger receives the textbee webhook, so a text to the phone can run an automation: open the gate, arm the alarm, or answer with the house status.

Send
HTTP POST
to the textbee send endpoint
Receive
Webhook
MESSAGE_RECEIVED, flat JSON
Pace
10 to 15 / min
per Android phone
textbee code
None
uses what the tool ships today

What you need

  • Home Assistant with access to configuration.yaml and secrets.yaml.
  • A textbee account with the Android app installed on the phone that holds the SIM, and an API key from the dashboard.
  • For receiving: an instance reachable from the internet over HTTPS, through Home Assistant Cloud or your own reverse proxy. textbee rejects private addresses.
  • The textbee app on the phone. Download the app, then create an API key in the dashboard.

Send SMS from Home Assistant

rest_command is a built-in integration. It takes headers, a content type and a templated payload, which is everything the textbee endpoint needs.

  1. Add the key to secrets.yaml

    Keep the key out of configuration.yaml so it never lands in a backup you share.

    secrets.yaml
    textbee_api_key: YOUR_TEXTBEE_API_KEY
  2. Define the rest_command

    The payload is a Jinja template. tojson quotes the message safely, so a text with quotes or a line break still produces valid JSON.

    configuration.yaml
    rest_command:
      send_sms:
        url: https://api.textbee.dev/api/v1/gateway/send-sms
        method: POST
        headers:
          x-api-key: !secret textbee_api_key
        content_type: "application/json"
        payload: '{"recipients": ["{{ to }}"], "message": {{ message | tojson }}}'
  3. Restart and test

    Restart Home Assistant. In Developer Tools, Actions, run rest_command.send_sms with to and message and check the phone.

  4. Call it from an automation

    Any automation can now send a text. This one texts you when the front door opens at night.

    automations.yaml
    - alias: Text me when the front door opens at night
      triggers:
        - trigger: state
          entity_id: binary_sensor.front_door
          to: "on"
      conditions:
        - condition: time
          after: "22:00:00"
          before: "06:00:00"
      actions:
        - action: rest_command.send_sms
          data:
            to: "+12015550123"
            message: "Front door opened at {{ now().strftime('%H:%M') }}"

Receive SMS in Home Assistant

The webhook trigger exposes the JSON body as trigger.json. A long random webhook id and a check on the sender are the protection, because a trigger cannot compute the HMAC.

  1. Add a webhook trigger

    local_only must be false so textbee can reach it. The sender condition limits commands to your own number.

    automations.yaml
    - alias: Answer status requests by SMS
      triggers:
        - trigger: webhook
          webhook_id: textbee-inbound-8f3k2q9v
          allowed_methods: [POST]
          local_only: false
      conditions:
        - condition: template
          value_template: "{{ trigger.json.webhookEvent == 'MESSAGE_RECEIVED' and trigger.json.sender == '+12015550123' }}"
      actions:
        - if:
            - condition: template
              value_template: "{{ 'status' in trigger.json.message | lower }}"
          then:
            - action: rest_command.send_sms
              data:
                to: "{{ trigger.json.sender }}"
                message: "Alarm {{ states('alarm_control_panel.home') }}, front door {{ states('binary_sensor.front_door') }}"
  2. Register the URL in textbee

    The URL is https://your-home-assistant/api/webhook/textbee-inbound-8f3k2q9v. Register it in the textbee dashboard with the MESSAGE_RECEIVED event. With Home Assistant Cloud, create a cloud webhook for this automation and register that URL instead.

  3. Test it

    Text the word status to the phone from your own number. The reply arrives within a minute.

Ask your AI agent to set it up

The prompt below carries the endpoints, the payloads and the Home Assistant details from this page. Change the line that starts with What I want, paste the prompt into your agent, and it walks you through the setup with your own field names and numbers.

Prompt for your AI agent

Paste it into Claude, ChatGPT, Cursor or any coding agent. It carries the textbee API facts and the Home Assistant details the agent needs, so it does not guess.

I want to connect textbee to Home Assistant. textbee is an SMS gateway that sends and receives SMS through my own Android phone. Help me set it up step by step.

Facts about the textbee API. Use only these. Do not invent endpoints or fields.
- Send an SMS: POST https://api.textbee.dev/api/v1/gateway/send-sms with the header x-api-key: <TEXTBEE_API_KEY> and a JSON body like {"recipients": ["+12015550123"], "message": "Hello"}. recipients must be a JSON array of E.164 numbers, even for one number. Optional fields: deviceId, simSubscriptionId, scheduledAt (ISO 8601, in the future). The response is {"data": {"success": true, "smsBatchId": "..."}}.
- Check delivery or read replies: GET https://api.textbee.dev/api/v1/gateway/messages with the same header. Filters: direction=received, smsBatchId=<id from the send>, from and to as ISO timestamps. Each row has a status such as sent, delivered, failed or received.
- Receive an SMS: textbee posts JSON to a webhook URL I register in the dashboard. A MESSAGE_RECEIVED delivery has these top-level fields: smsId, message, deviceId, webhookSubscriptionId, webhookEvent, idempotencyKey, sender, receivedAt. The header X-Signature holds an HMAC-SHA256 hex digest of the raw body, keyed with the signing secret I set on the webhook. Retries reuse the same idempotencyKey.
- Limits: One Android phone sends roughly 10 to 15 messages a minute. Text only, no MMS. Messages over 160 characters are split into segments.

What I want: Send SMS from my Home Assistant automations, and run an automation when I text a command to the phone.

Home Assistant specifics you should know:
- rest_command supports headers, content_type and a Jinja payload template; automations call it with action: rest_command.send_sms and data: to, message.
- The webhook trigger exposes the JSON body as trigger.json; set local_only: false so textbee can reach it, and use a long random webhook_id.
- A trigger cannot verify the HMAC signature; the random id and a sender check are the protection.
- Use !secret for the API key. Home Assistant needs internet access to reach the textbee API.

Give me:
1. The exact clicks and field values in Home Assistant, using its real field labels.
2. The request body or field mapping, with placeholders for my API key and phone numbers. Never ask me to paste the real key into this chat.
3. A test with one number and what a correct result looks like.
4. The three most likely failure causes and how to check each one.

Automations that work well

Night door alert
A state trigger on the door sensor with a time condition, then rest_command.send_sms. It works when you are asleep and the phone is on do not disturb for everything but SMS.
Power or internet trouble
A UPS or ping sensor that sends a text when the house goes dark. Home Assistant needs a path to the internet at that moment, so this works best when the instance runs on a small UPS with mobile backup.
Guest gate code
A script that texts a one-time code to a guest, with an input_text helper for the number.
Status by text
The webhook automation above: text status and get the alarm state and the doors back.

What works and what does not

Works today

  • Sending from any automation or script with a templated message
  • Texts from your own number that run automations
  • Several recipients in one call: pass a list in the template
  • Everything else Home Assistant can do once a text arrives: lights, locks, notifications, scripts

Not with this route

  • Receiving texts without a public HTTPS address
  • Signature verification inside a trigger
  • Sending while Home Assistant has no internet connection
  • MMS

What Home Assistant charges

Home Assistant is free and open source. Receiving webhooks from the internet needs Remote UI through Home Assistant Cloud, or your own reverse proxy and domain. home-assistant.io, checked on September 25, 2026. textbee itself charges a flat monthly plan with messages included; see pricing.

Frequently asked questions

Why not use the notify platform?

There is no notify platform for textbee, and rest_command does the same job in a few lines. If you prefer the notify.* pattern, wrap rest_command.send_sms in a script named send_sms and call the script from your automations.

Can the Home Assistant Companion phone also run textbee?

Yes. The textbee app only needs SMS permission and a data connection. Many setups use a spare Android phone plugged in next to the router, with the SIM that receives the alerts in the family phones.

What happens when my internet is down?

Home Assistant cannot reach the textbee API, so the send fails. The phone itself keeps working on mobile data. For outage alerts, run Home Assistant on a UPS and give it a mobile backup route, or send the alert from a device outside the house.

How do I secure the webhook?

Use a webhook id of 20 random characters or more, keep local_only false but allowed_methods on POST only, and check trigger.json.sender against your own number in a condition. Anyone who has the URL can post to it, so never share it.

Can I text several people?

Yes. Change the payload template to build the recipients array from a list, for example {"recipients": {{ to | tojson }}, ...} and pass to as a list in the automation.

Sources

  1. home-assistant.io, checked on September 25, 2026
  2. home-assistant.io: RESTful Command, checked on September 25, 2026

Read next