[APP][PRO] WhatsApp Bot - Control your home with a WhatsApp message

Hi everyone,

WhatsApp Bot is an app that allows your Homey Pro to communicate with a dedicated WhatsApp bot using the official Meta WhatsApp Cloud API. This integration enables you to control your smart home by sending and receiving text messages directly within your WhatsApp chat.

TIP: By pairing this app with Gemini AI, you can unlock Natural Language control for your entire home via WhatsApp. Simply route your incoming messages to Gemini AI in your flows to experience a truly intelligent chat interface.


:envelope_with_arrow: Interactive Messaging with Homey

The app is built around two core Flow cards that turn WhatsApp into a powerful interface for your smart home.

:outbox_tray: Send WhatsApp Message (Action)

Stay informed about your home in real-time. Whether it’s a security alert or a simple household reminder, Homey can now “text” you directly.

  • Security: “Presence detected in the garage while you’re away!”
  • Appliances: “The laundry is ready! :basket:
  • Notifications: “Energy consumption is exceeding 3kW, please turn something off.”

:inbox_tray: Message Received (Trigger)

Control your home by simply sending a message to your bot.

  • Remote Execution: Text “Lock everything” to arm your security system and turn off all lights.
  • Status Inquiry: Text “Is the oven on?” to get an instant reply.
  • Conversational Flows: Use the incoming message text as a variable to trigger complex logic or search for information.

:gear: Professional Setup (Meta Cloud API)

Unlike unofficial solutions, this app relies on the official Meta Developer Portal. This ensures your messages are delivered instantly and securely.

  1. Direct Connection: You connect directly to Meta. No middle-man servers, no data sniffing.
  2. Permanent Access: No more QR code scanning every few weeks. Once configured with a Permanent Access Token, it works forever.
  3. Setup Guide Included: I know Meta’s portal can be daunting, so I’ve built a step-by-step Setup Guide directly inside the app settings to walk you through the process.

Download it now on the Homey App Store! I’d love to hear your feedback, see your flows, and help with any questions.

Simone

Test version: https://homey.app/it-it/app/com.dimapp.wabot/WhatsApp-Bot/test/

Configuration Guide: Meta WhatsApp Cloud API

This guide will walk you through the process of creating and configuring your Meta App to integrate WhatsApp with Homey Pro.


1. Create the Meta App for Developers

  1. Go to Meta for Developers and log in with your Facebook account.
  2. Click on “My Apps” in the top right corner and press the “Create App” button.
  3. In the “Use Cases” section, select “Connect with customers through WhatsApp”.
  4. Link the app to a Business Portfolio. If you don’t have one, follow the free guided wizard to create it.
  5. Once the creation is complete, you will be redirected to the Dashboard of your new app.

2. WhatsApp Configuration and Phone Number ID

  1. In the left menu, select “Use Cases” and click “Customize” in the WhatsApp box.
  2. Go to the “API Setup” menu on the left.
  3. Take note of the “Phone Number ID” value (you will need it in the Homey settings).

3. Obtaining a Permanent Access Token

To avoid having to update the token every 24 hours, you need to create a System User:

  1. Go to Meta Business Settings.
  2. In the left menu, open the Users section and choose System users.
  3. Click “Add”, choose a name (e.g., HomeyBot), select the “Admin” role, and click “Create system user”.
  4. Click “Assign assets”, select your App, enable “Full control”, and save.
  5. Click “Generate token”, select your App, and in the permissions list, you must check:
    • whatsapp_business_messaging
    • whatsapp_business_management
  6. Copy the generated Token and keep it safe (it will only be shown once).

4. Configuration on Homey

Open the WhatsApp Bot app settings on Homey and enter:

  • Access Token: The permanent token generated in step 3.
  • Phone Number ID: The ID obtained in step 2.
  • Verify Token: A string of your choice (no spaces, e.g., my_secret_token). This string will be used both to verify the Homey app within the Meta portal and for the initial bot registration (it is the secret code required by the bot).
  • Save the settings and take note of the Webhook URL that appears.

5. Webhook Configuration on Meta

  1. Go back to the Meta Developer Portal, in the WhatsApp menu select “Configuration”.

  2. Click “Edit” next to Webhook:

    • Callback URL: Paste the Webhook URL provided by Homey.
    • Verify token: Enter the string you chose on Homey in step 4.
  3. Click “Verify and Save”.

  4. Under the “Webhook fields” section activate (Subscribe) the messages field.


6. First Activation (Sending a Test Message)

To activate communication, Meta requires an initial manual send:

  1. Go to “API Setup” on the Meta portal.

  2. In the top right, generate a Temporary access token (expires after 24 hours, only needed now).

  3. In “Step 1: Select phone numbers”, select your phone number in the “To” field.

  4. In “Step 2: Send messages with API”, click “Send message”.

  5. You will receive a “Hello World” message on WhatsApp. Now the bot is active, but to use it, you must first register.

  6. Send a message to the bot with the text /register [secret_code] where secret_code is the Verify Token you chose in step 4.

  7. The bot will reply with a welcome message and will be ready to use.


Note: For daily use, Homey will use the Permanent Access Token configured in step 3, so you won’t have to worry about expirations.

How do I add contacts in the address book? eg my personal number, my wife, kids, etc..

Ciao Caesar, You must repeat step six of the guide for each new user.

Essentially, in Meta for developer you must add the number of the person you want to add to the “to” field and then send them the test message. Once that person receives the test message, he must respond with:

/register [your_token]

where [your_token] is the Verify Token chosen in step 4.

From that moment, he will be able to use the bot, and the phone number will appear in the users section of the app settings.

My meta web interface is a bit different than described:

  1. Section is called “API Testing”
  2. Temp token is generated as described
  3. 2. Select a ‘From’ phone number is kept as is (random US number)
  4. 3. Add a recipient phone number I added my personal number
  5. 4. Turn on webhook listening I tested with both On and Off
  6. 5. Choose a type of message to send I chose “Plain Text”
  7. 6. Send messages with the API sends me the text “Welcome to Jasper’s Market, your local grocery store providing farm-fresh produce and high-quality goods!”
  8. I respond in the chat “/register” “/register handshake” “/register [handshake]” but all three responses don’t register in the app

Send me a diagnostic report after sent the comand /register handshake so to take a look