Skip to content

Sending WhatsApp messages with Home Assistant: how the Call Me Bot works

The integration of WhatsApp into your smart home offers numerous options for receiving messages and notifications directly on your smartphone. With Home Assistant, you can send WhatsApp messages to be informed about system events or notifications, for example. In this article, we explain how you can send WhatsApp messages with Home Assistant and what role the Call Me Bot plays in this.

Advertisements

Why integrate WhatsApp into Home Assistant?

WhatsApp is one of the most popular messaging platforms worldwide. The ability to send WhatsApp messages via Home Assistant brings a new level of communication to your smart home. Instead of only receiving notifications via apps or emails, you can be informed quickly and directly via WhatsApp.

One example: If you have a security event in your smart home – such as motion detection or a door opening – you can receive a WhatsApp message that notifies you immediately. This type of notification is particularly practical as WhatsApp is available on almost every smartphone and you don’t need to open an additional app.

The Call Me Bot: The solution for WhatsApp in Home Assistant

The Call Me Bot is a service that allows you to send WhatsApp messages via Home Assistant. With this bot, you can configure Home Assistant to send automated messages to your WhatsApp number. The Call Me Bot provides a simple API that allows you to send WhatsApp messages from within Home Assistant without the need for in-depth technical knowledge. Best of all, it’s completely free!

How does the Call Me Bot with Home Assistant work?

To send WhatsApp messages with Home Assistant, you must first integrate the Call Me Bot into your Home Assistant system. Here are the steps you need to follow:

1. register with the Call Me Bot

First you need to create an account with the Call Me Bot. This is usually done via a WhatsApp chat with the bot, where you will receive your API key, which is necessary to send messages via Home Assistant.

  • Open WhatsApp and send the following message to the Call Me Bot number(+34 644 596 804):
    “I allow callmebot to send me messages
  • You will receive a reply with an API key and instructions for further configuration.

2. configure the Home Assistant

After registration, you must integrate the Call Me Bot into Home Assistant. To do this, add the configuration in the configuration.yaml file of Home Assistant.

Here is an example of the configuration:

notify:
  - name: WhatsApp # Dein Name
    platform: rest
    resource: https://api.callmebot.com/whatsapp.php
    data:
      source: HA
      phone: +34123123123   #Deine Telefonnummer
      apikey: 456789        #Dein API Key

Replace DEIN_API_KEY with the API key you received from the Call Me Bot. The name can be freely chosen. It is best to choose the name of the device or the mobile phone number to which messages are sent. You can also add multiple numbers by performing step 1 with a different number and adding it with the same configuration (but a different name).

3. send messages

Once the configuration is complete, you can now send WhatsApp messages via Home Assistant. To send a message, you can use the notify.whatsapp function in Home Assistant. Here is an example of how to send a message in an automation:

automation:
  - alias: 'Nachricht bei Bewegung'
    trigger:
      platform: state
      entity_id: binary_sensor.motion_sensor
      to: 'on'
    action:
      service: notify.whatsapp
      data:
        message: 'Bewegung erkannt! Bitte prüfe die Überwachungskamera.'

In this example, a message is sent via WhatsApp when a motion sensor is activated.

A message can also be sent as normal via the “Notification” block when creating an automation in Home Assistant. To do this, enter notify.name under “Target” or “Targed”, i.e. the name that was assigned in the configuration.

home assistant whatsapp nachricht senden 1024x575 1

4. testing and customizing

Now you can test the automation. When the sensor is triggered, you should receive a WhatsApp message on your smartphone. You can customize this automation to send different messages based on different triggers – be it system messages, alerts or reminders.

Advantages of WhatsApp integration in Home Assistant

  • Real-time notifications: Receive instant updates on important events in your smart home, directly on your smartphone.
  • Automation: Use the flexibility of Home Assistant to create custom automations that send WhatsApp messages.
  • Ease of use: Since almost everyone has WhatsApp on their smartphone, this is an easy and instantly accessible way to communicate with your smart home.
  • Multiple uses: Send notifications for a variety of events – from door sensors to motion detection to system status updates.

WhatsApp and Home Assistant – an unbeatable team

The integration of WhatsApp into Home Assistant via the Call Me Bot is an excellent way to make your smart home even more practical and user-friendly. With simple steps, you can send WhatsApp messages directly from your Home Assistant system and be notified of events in your home anytime, anywhere. Whether it’s for security-related incidents or simply to remind you of important tasks, the Call Me Bot makes WhatsApp a powerful tool in your smart home.

With the WhatsApp Home Assistant integration, you can take your smart home to the next level and always stay up to date!