Connect Home Assistant to UserAlertX

Get a text or email from Home Assistant when it matters: water on the basement floor, the freezer warming up, the garage door left open, the sump pump running nonstop. No app on your phone, nothing to install in Home Assistant — it uses Home Assistant's built-in RESTful notifications. About 10 minutes, once.

1. Get your UserAlertX API key

It's on your account screen. No account yet? Start a free trial — then add your mobile number on the account screen if you want alerts by text.

2. Add the key and the notifier to Home Assistant

Edit these files in your Home Assistant config folder (with the File editor or Studio Code Server add-on, or over Samba/SSH).

secrets.yaml — add one line, with your key:

useralertx_key: YOUR_API_KEY

configuration.yaml — add this (if you already have a notify: section, add just the - name: useralertx block under it):

notify:
  - name: useralertx
    platform: rest
    resource: https://useralertx.com/cgi-bin/itmessages.cgi
    method: POST
    message_param_name: body
    title_param_name: title
    headers:
      X-Api-Key: !secret useralertx_key

Then Developer tools → YAML → Check configuration, and restart Home Assistant. You now have an action called notify.useralertx.

3. Send a test

Developer tools → Actions, switch to YAML mode, paste this and press Perform action:

action: notify.useralertx
data:
  message: "Hello from Home Assistant"

The first alert by text may be held until you reply START to the one-time text UserAlertX sends you — after that, alerts go straight through.

4. Use it in automations

In the automation editor, add an action and pick notify.useralertx (under Notifications). Or paste one of these into automations.yaml — change the entity_id to your own sensor:

Water leak

- alias: "Text me on a water leak"
  triggers:
    - trigger: state
      entity_id: binary_sensor.basement_leak
      to: "on"
  actions:
    - action: notify.useralertx
      data:
        title: "Water leak"
        message: "The basement leak sensor is wet ({{ now().strftime('%H:%M') }})"

Freezer too warm for 15 minutes

- alias: "Text me if the freezer warms up"
  triggers:
    - trigger: numeric_state
      entity_id: sensor.freezer_temperature
      above: 10
      for: "00:15:00"
  actions:
    - action: notify.useralertx
      data:
        message: "Freezer is at {{ states('sensor.freezer_temperature') }}° - check the door"

Garage door left open

- alias: "Text me if the garage is open 20 minutes"
  triggers:
    - trigger: state
      entity_id: cover.garage_door
      to: "open"
      for: "00:20:00"
  actions:
    - action: notify.useralertx
      data:
        message: "The garage door has been open for 20 minutes"

The text arrives as "Water leak: The basement leak sensor is wet (21:14)" — the title goes in front. Leave it out and Home Assistant puts its own name there: "Home Assistant: The garage door has been open for 20 minutes". Using an older Home Assistant? trigger: - platform: state and action: - service: notify.useralertx work the same way.

Good to know

  • Cost: each alert is a normal UserAlertX alert — 3¢ by text, 1.5¢ by email.
  • Limits: 10 alerts an hour and 50 a day per account, and at least 3 seconds apart — two automations firing at the same moment means the second alert is refused. Use for: (like the examples) so a sensor that flickers on and off doesn't send a burst, and put several things into one message rather than one alert each.
  • Text or email: alerts go the way your account is set (Delivery method on the account screen). Want some automations by email and others by text? Add a second notifier under notify: that always uses email, then pick notify.useralertx_email for those:
      - name: useralertx_email
        platform: rest
        resource: https://useralertx.com/cgi-bin/itmessages.cgi
        method: POST
        message_param_name: body
        title_param_name: title
        headers:
          X-Api-Key: !secret useralertx_key
        data:
          method: email
    (Your email has to be verified on the account; for texts, your mobile number.)
  • If Home Assistant itself goes down, it can't tell you. Pair this with the upcheck example on another machine, pointed at your Home Assistant address, to hear about that too.
  • Pause: reply P to any alert text to pause alerts (they're held, not lost); START sends them.

More examples · ← Home