giuseppecastaldo / ha-addons

Home Assistant Whatsapp Add-on
Apache License 2.0
49 stars 18 forks source link

React to your own message #74

Open moryoav opened 1 month ago

moryoav commented 1 month ago

In whatsapp it's possible to react to your own message. You send a message and then you can add a reaction to that same message you sent. In order to do that with this addon, what I would need is to know the remoteJid generated by "whatsapp.send_message" (because send_message doesn't trigger a "new_whatsapp_message" event, there doesn't seem to be any other way to get the remoteJid of that message). This could be extremely useful. If there's any workaround I'd love to know.

The simplest solution seems to be to add "response_variable" option to the send_message service. So that it'll look like this:

alias: Send notification
service: whatsapp.send_message
data:
  clientId: default
  to: [my phone number]
  body:
    text: |
      testing
  response_variable: ev

Then I could store this variable in a text helper and use it later.