giuseppecastaldo / ha-addons

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

Listen for messages from specific group or user? #20

Closed adamrhoades closed 1 year ago

adamrhoades commented 1 year ago

How would I go about creating an automation that would be triggered by a specific message to a specific group?

I've been able to trigger with a specific message, but anyone could send that message.

Thanks!

ekkesa commented 1 year ago

Why not trigger on the new message event and use a template condition to test if it is the correct group?

adamrhoades commented 1 year ago

Had a play around with it and realised I could utilise more of the data from the new_whatsapp_message event.

Came up with an automation that checks for a specific message of 'Unlock' and in a specific group using 'remoteJid'

It even announces who has opened the gate by their whatsapp username and sends a reply acknowledging the request.

alias: Whatsapp Unlock Gate description: "" trigger:

Thank you for the suggestion!