Note: The Free API is only for personal use.
CallMeBot can now send WhatsApp Messages from the Apple Home App (HomeKit) Automations using the Shortcuts capabilities of the Home Hub (HomePod or AppleTV). Very simple to configure using the "Get Content of URL" Action within the Automation setup.

See below the step-by-step instructions to send WhatsApp Notifications Messages from Apple Home App.

Setup:

You need to get the apikey form the bot before using the API:

1. Add the phone number +34 694 29 84 96 into your Phone Contacts. (Name it it as you wish)

  1. Send this message "I allow callmebot to send me messages" to the new Contact created (using WhatsApp of course)
  2. Wait until you receive the message "API Activated for your phone number. Your APIKEY is 123123" from the bot.
    Note: If you don't receive the ApiKey in 2 minutes, please try again after 24hs.
  3. The WhatsApp message from the bot will contain the apikey needed to send messages using the API.

You can send text messages using the API after receiving the confirmation.

Example:
58

5. Enjoy

5. Note, If you need any of the capabilities listed below, please check https://textmebot.com (low cost) or https://www.twilio.com/ (best official provider)
    - Send messages to others
    - Send messages to Groups
    - Send messages from your whatsapp number
    - Send Images
    - Send Buttons
    - Send documents
    - Receive the answers

How to send a WhatsApp Message from an Home App Automation

It is very simple to send a WhatsApp Notification from any Home App Automation. Just follow these step by step instructions:

1) In the Home App, createa new Automation (Click + and then "Create Home Automation")

New Automation to send WhatsApp from HomeApp

2) Select and configure the trigger for the automation. In this example, the trigger will be when "People Arrive", but Callmebot works with any trigger. For example, you can configure it to trigger when someone rings the doorbell, a sensor detects something, then a light turns on, or when your kid gets home from school.

Trigger for the WhatsApp Message in HomeApp

3) After configuring the Trigger, Click "Next" to go to the Scenes and Accessories list. Select "Convert to Shortcut" (under Advanced at the bottom of the screen)

 Convert Scene to Shortcut to add the WhatsApp Message
 

4) Now you can call the Callmebot API using Home App’s native shortcut Web actions:

  1. If you don’t want this Automation to control or do anything else, remove the default “Set scenes and Accessories” action by tapping the “x” button next to it.
  2. Tap “Add Action” or use the Search box at the bottom.
  3. Select “Web” Category, and scroll down and select “Get Contents of URL”.
  4. Now paste your Callmebot API URL in the “URL” field of the action (see details and screenshot below).
Webhook to send whatsapp from Home App Shortcut Add action to send whatsapp message from "GET Content"Using WEB action to send whatsapp message from HomeKit Finally, calling to the CallMeBot API to send whatsapp message from HomeKitURL Format to send whatsapp message using Home App Shortcut
 

CallMeBot API URL details:

https://api.callmebot.com/whatsapp.php?source=homeapp&phone=[PhoneNumber]&apikey=[ApiKey]&text=[Text Message]

Where the blue parameters are:

[PhoneNumber]: Your phone number (used to get the apikey) including the country code (Ex.: +49123123132)
[ApiKey]: The apikey that you received during the activation process (step 4-5 above)
[Text Message]: Message that you want to send to your WhatsApp number when the trigger is activated. It has to be urlencoded. You can use this online converter to encode the message. (i.e. %20 for space, %0A for new lines). WhatsApp formatting characters are allowed (i.e "*" for bold, etc.). Check here how to include emoticons in the message 👍.

CallMeBot API URL Example:

https://api.callmebot.com/whatsapp.php?source=homeapp&phone=+49123123123&apikey=1234567&text=This+is+a+test+message+from+Home+App+Automation

5) If you want to Test your WhatsApp HomeKit Automation, see the "Testing your Automation" section below, before exiting the Action screen.

6) if you are done Testing (or do not want to test) you can tap Next and Done.

WhatsApp Message Action added into the list of automations

Note: You will see your new automation in your automation list. Note there is no icon as this runs a Shortcut (I think this is a Home bug and will be resolved, as it looks empty) but the automation works. Also, note that you could add the Callmebot action to an existing automation, but if you are not using a Shortcut already, you need to convert it into a shortcut first (and at the moment, this seems to remove all your Scenes or Actions from the automation).

Testing your Automation

To test your WhatsApp Action:

On the Shortcut Action screen, you can test the action by tapping on the “play” button in the bottom right corner of the screen. This will test the Action and show you the result. If the preview doesn’t show any errors, you should get your WhatsApp message in a few seconds.

How to include dynamic fields in the Text Message

You can include dynamic fields in the Text Message. Instructions will be published soon.
  

Problems?

If you have problems, like not receiving the Call on Telegram, or not receiving the WhatsApp messages,  try to test the CallMeBot API using your Web Browser:

  • Telegram Phone Calls using Web Browser: here
  • Telegram Text Messages using Web Browsers: here
  • WhatsApp Text Messages using Web Browser: here

You might get some errors on the screen that will help you to identify the problem. (Ex: Calls disabled in the Telegram Security Settings, WhatsApp not activated, etc.)

If you still have problems using the API, don’t hesitate to contact me in Telegram @callmebot_com or by email at [email protected]. Remember to Follow me on Twitter to get news about coming features, changes, invitations, etc.