Hello! Anyone know how I can configure an official WhatsApp API (Meta Developers) in Home Assistant so that when I send a specific message, like “gate” it will open the gate?
I tried to do this function using “Phone last notification” and it doesn’t work, because when I have 2 or more notifications, HomeAssistant gets confused.
I saw some tutorials on how to do it with NodeRED, but I only found tutorials with unofficial APIs, for me it’s a problem because I want the system to always work.
From what I saw, it would be possible to create a Webhook to synchronize with the APP at Meta Developers, but I couldn’t figure out how to create this Webhook valid through NodeRED, or if it has to be in another location, like rapidapi or webhooksite.
I also tried using Nabucasa, I saw that you could create it from a trigger, but I couldn’t figure out how to link it to NodeRED to get the messages.
In our project we need to analyze the messages, because each command sent will trigger a different device. “gate” open/close the gate while “alarm” active the alarm. I believe that in this case, it would also be possible to do it through automation, but again I don’t know how to do it.
From what I saw in Meta’s documentation, the webhook must be a valid https link, that is, it cannot give a message about an insecure certificate.
So the first point, I can’t get my Home Assistant to work over https. Another thing, it seems that Meta doesn’t accept ports, it has to be a direct link, I would have to change the HA port to 80, my provider doesn’t release this port, so it wouldn’t work either, even on https (from what I saw in the documentation ).
So I think the “ideal” would be to use the nabucasa webhook to intermediate. I even tried to generate the webhook with a long-lived token, but without success, 404 Not Found appears.
I’m trying to do exactly the same as you: opening a gate with a whatsapp message using NodeRed. I don’t have the slightest Idea where to start. I read the above linked documentation, but that just explains the process of creating a “Nabu Casa Cloud webhook”. But how does one get a “virtual” whasapp number to send commands to and how do they get to Nabucasa? And once Nabucasea sends them (trough the “webhook” I suppose?) to my HA, how do you process them in NodeRed?
Can’t help you with WhatsApp - but if you are going to pull your phone out to send a message - why not just use a VPN from your mobile to your home router?
Some routers (I use a fritzbox - but I know other routers have it as well) even come with a pre-installed wireguard VPN.
Scan the code from the appropriate router menu and you are ready to go.
I leave the VPN running 24/7 - but of course you can also activate/de-activate on your phone - it is up instantenously.
In that case you just use the normal card you are using to open that gate.
When the VPN is up, your mobile is functionally in your home wifi.
A lot faster and safer I think?
This isn’t about me personally opening the gate, I have Nabucasa Cloud so I can easily open the gate from afar.
This is about guests or the gardener who should be able to open the gate (and do some other stuff) without having to call me each time - and the one app everybody (in Europe) has on their phone and knows how to operate is Whatsapp.