← All articles
Developer API, MCP and webhooks·

Recipe: Sonos announces "Mum has just checked in" via Home Assistant

A complete end-to-end example. Webhook, Home Assistant automation, TTS, done.

This is a full walkthrough of the most-requested integration. It assumes you have Home Assistant running with HTTPS access from the internet (Nabu Casa, Cloudflare Tunnel, or similar), and a Sonos (or any speaker Home Assistant can target with TTS) on the same network.

What you will end up with

The moment Mum taps her check-in:

  1. Getwello fires a check_in.created webhook to your Home Assistant.
  2. Home Assistant verifies the signature, picks up the event.
  3. An automation triggers, fetches Mum's display name, and tells your kitchen Sonos to say "Mum has just checked in" at a calm volume.

Step 1: Get an API key and webhook secret from Getwello

  1. Follow Create your first API key to mint a key.
  2. Follow Set up your first webhook using the URL https://<your-home-assistant>/api/webhook/getwello_check_in. Tick only check_in.created. Save the whsec_... secret.

Step 2: Add the secret to Home Assistant

Edit secrets.yaml in your Home Assistant config directory and add:

getwello_webhook_secret: whsec_your_real_secret_here

Step 3: Add the webhook automation

Edit automations.yaml (or use the UI):

- alias: "Getwello check-in announce"
  trigger:
    - platform: webhook
      webhook_id: getwello_check_in
      allowed_methods:
        - POST
      local_only: false
  condition:
    # Verify the HMAC signature. Replace the placeholder with your actual
    # check; see the inline template below.
    - "{{ trigger.json.event == 'check_in.created' }}"
  action:
    - service: tts.cloud_say
      target:
        entity_id: media_player.kitchen_sonos
      data:
        message: >-
          {% set name = state_attr('input_text.getwello_mum_name','value') | default('Mum') %}
          {{ name }} has just checked in.
        cache: false
        options:
          gender: female
    - service: media_player.volume_set
      target:
        entity_id: media_player.kitchen_sonos
      data:
        volume_level: 0.25

Step 4: Verify the signature (recommended)

Anyone who knows your webhook URL could send a fake POST. Home Assistant lets you verify the signature in a Python script or via a custom integration. The pattern:

  1. Read X-Getwello-Signature header and the raw request body.
  2. Compute HMAC-SHA256 over {timestamp}.{body} using your secret.
  3. Compare to the v1 value from the header. Reject the request if they do not match, or if the timestamp is older than 5 minutes.

For a code example, see Set up your first webhook.

Step 5: Test it

  1. Reload your Home Assistant automations.
  2. Back at Settings → Developer API, click Test next to your webhook. A green "Test delivered, HTTP 200" should appear. Home Assistant should pick up the test event in its log (but, because the test event has event: "webhook.test" not check_in.created, the condition in the automation skips the TTS , which is correct).
  3. Have Mum tap her check-in. Within a few seconds, the Sonos should speak.

Variations

  • Multiple speakers: change entity_id to a media_player group.
  • Different message: edit the message template. You could include the time, the mood, anything from trigger.json.data.
  • Quiet hours: add a condition that suppresses the announcement between, say, 23:00 and 07:00.
  • Different action: instead of TTS, turn on a lamp, change a status indicator, send a Pushover, anything Home Assistant can do.

What this costs you

Nothing extra from Getwello (it is part of the £4.99 family plan). If you use Home Assistant Cloud for the HTTPS URL, that is its own subscription. If you use a local Nabu Casa-free alternative like Cloudflare Tunnel, the whole setup is free.

If you set this up and it works, send us a photo of Mum's reaction to her first announcement. We love that.

More on developer api, mcp and webhooks

Didn't answer your question?

Email hello@getwello.co.uk