[APP][Pro] WhatsApp - Simple. Reliable. Private

Hi,
My mobile numer is member of the group.
What do I have to do that homey is member of the group?

@Michael_Zimmer did you add whatsapp to Homey via the Add Devices section? Or did you just install the app and tried to connect the widget?

The device whatsapp was added.
Do I habe to install the brta version?

@Michael_Zimmer yes best to install the beta

Hi @martijnpoppen,

I was looking at this package:
Mentions and How to mention in a group using the WhatsApp API?

It looks like adding mentions are extra post var. I was looking in your code to see where you actually did the call, but now I know why I couldn’t find it :wink:

I will checkout the baileys package and see if I can see some starting points!

Just to be sure, I can “catch” the mention of my “homey ai bot ;)”,

but I would like to do the mention in the message I sent out!

So, I would like to do something like:

HEEEE @31061234567: The washingmachine is done, please put it in the dryer.

This way I can “nagg” may teenagers in the house to do some chores :wink:

1 Like

@Frekel both packages you share are an external service or are using a browser window to let this work which is really heavy on memory.

The Whiskeysockets Baileys package ( linked in first post) is using the same web sockets as the WhatsApp web and therefore can be implemented at a way lower memory footprint and is also less likely to get taken down. The baileys packages is not that straightforward as the things you send and there’s not such thing as a single call :wink:

But as far as I see with mention you want to send a mention and not receive?

@martijnpoppen Yes. Looking at the code from Baileys I am looking for something like:

const sentMsg = await sock.sendMessage(id, { text: '@12345678901', mentions: ['12345678901@s.whatsapp.net'] })

I kinda think this is not something you can whip up in a day, but If you need help I am more than willing to take a look!

1 Like

@Frekel where did you see that? Will check. Think this is possible

1 Like

@martijnpoppen Saw it on the github page:

1 Like

New app update (:green_square: LIVE: 1.27.7):

Changelog:

NEW:
1: NEW: add clear widget button to device
2: NEW: Add mentions to flowcards. (use like @31612345678 this is a test)

FIXES:
1: FIX: widgets performance improvements




If you find any issues, send a report via the mobile homey app

More - apps - Whatsapp - settings wheel right top - send diagnostic report (put your email in the input field to make it easier)



Issue list: [APP][Pro] WhatsApp - Simple. Reliable. Private - #3 by martijnpoppen

1 Like

@Frekel Mentions are added (see message above :point_up: )

1 Like

NO WAY!!! :smiling_face_with_three_hearts: :partying_face:

1 Like

Hi @martijnpoppen,

First of all thanks for all the hard work you’re doing with your Homey Apps, i actually love using them!

I’d like to suggest adding the ability to delete messages, and here’s why:

I have a smart doorbell that sends a notification to a WhatsApp group consisting of myself, my wife, and my Homey (Homey Pro Bot). The process works as follows:

  1. The first message sent is: “Ding dong, someone’s at the door.”, along with a snapshot from the doorbell.

  2. Immediately after, the image is sent to OpenAI for analysis.

  3. Once the analysis is complete, a second message is posted: “Ding dong, it appears the delivery driver is here with a package for you.”

This results in two messages with the same image—one generic and one more detailed after the AI analysis.

What I would like is for the first message to act as a “Loading State”, and once the image is analyzed, that initial message should be deleted and replaced with the detailed one. This way, only the more informative message remains, avoiding redundancy in the chat.

I’ve reviewed the documentation for the WhatsApp client you’re using, and it does support message deletion.

Thanks for considering this feature!

For the ones interested in the AI Analysis:

async function sendRequest(image, question) {

  const url = 'https://api.openai.com/v1/chat/completions';

  const headers = {
    'Content-Type': 'application/json',
    'Authorization': 'Bearer redacted',
  };

  const body = {
    model: 'gpt-4o',
    messages: [
      {
        role: 'system',
        content: 'you are a computer, that answers questions truthfully and briefly'
      },
      {
        role: 'user',
        content: [
          {
            type: 'image_url',
            image_url: {
              url: image
            }
          },
          {
            type: 'text',
            text: question
          }
        ]
      }
    ]
  };

  try {
    const response = await fetch(url, {
      method: 'POST',
      headers: headers,
      body: JSON.stringify(body)
    });

    const data = await response.json();
    console.log(data);
    return data.choices[0].message.content;  // Return the data if needed for further processing
  } catch (error) {
    console.error('Error:', error);
    return null;  // Return null in case of error
  }
}

const json = JSON.parse(args[0])
const image = json.image
const question = json.question
// Call the function
const answer = await sendRequest(image, question);
tag("openai_analyze_image_answer", answer)
return answer

@Snoep i like the idea but this app was never intended to interfere with the original messages
I also foresee a lot of issue with this setup. As it can conflict with other messages

If this gets any votes of other people I might consider it. But for now I won’t integrate this

I understand, unfortunate.
I might fork your app and try it myself. JS/Typescript is not really my expertise tho :smiley:

1 Like

Hi @martijnpoppen,

I have updated the app to 1.27.7. The scroll function in the Widget is working on my tablet.

Well done. Thanks

Rogier

1 Like

On my device the whatsapp widget is not showing any messages.
I sent the code (without 'and with ‘CODE’) to the whatsapp group I created.
No change

@Michael_Zimmer Please send a diagnostics report

@martijnpoppen It is working buuuutttt I saw one small thing. If you enter a comma directly after the phonenumber to mention, it is not working:

For now, this is no issue. I create the messages myself, so I can just prevent it from happening (just a space between the number and , will do!!)

Thanks again for the great work!

1 Like