[RELEASE] WhatsApp integration to SmartThings (2-way messaging)

OMG I can get it to finally do
You look like your on your way home do you want me to turn the heating on?

3 Likes

@kayvint

I cant get the test pistons to work, I’m confused as what the POST request URL is supposed to be

What goes in “Make a POST request to”

The URL should be

https://api.twilio.com/2010-04-01/Accounts/twilioAccountSID/Messages.json

You can get the Account SID on your twilio dashboard under settings.

Sorry…accidentally removed the URL from the post. Have added it back. The URL is:-

https://api.twilio.com/2010-04-01/Accounts/twilioAccountSID/Messages.json

Where your twilio account SID can be found on your twilio dashboard under Settings.

Here’s what I have been working on its not finished yet but may help people have ideas

Examples


2 Likes

The limitation of the service is making this not as useful as first thought

A WhatsApp session begins with a user initiated message to your app. Sessions are valid for 24 hours after the most recently received message, during which time you can communicate with them using free form messages. In order to send a message outside the 24 hour Session window, you must use a pre-approved template (see Sending Notifications section above).

So unless I remember to send a message in the morning I don’t get a notification to ask if I want to turn the heating on :disappointed:

That is right. To get around this, what i do is have a “keep-alive” message sent everyday at a specific time using webCoRE.

Every 23 hours?

I have mine setup to send a message everyday at 11pm. Every 23 hours should also work.

Is that enough or do you have to reply to the message?

Good point. How I am doing it is that I run my goodnight routine using ‘Shortcuts’ on iOS. It’s mainly to interact with stuff that is not connected to ST. The last step in that is to send a WhatsApp message to twilio.

Not too sure if just receiving messages would keep the ‘conversation’ alive or not.

Can you please share how you send the automated “keep-alive” message from webCore? Are you using the Twilio number as the To number and your own number as the From? That doesn’t work for me. Any guidance will be appreciated.

You need do send a message from your phone
iOS use “shortcuts” can’t help you if that though
Android use “AutoResponder WA”
Make WebCoRE send a message “Keep Alive Message” Every 24 hours
Setup a rule in AutoResponder WA to reply to that message I used “Keep Alive Reply”


I then made WebCoRE look out for that message and reply with “Message Received”

OK, that make perfect sense. Thanks will try that!

I my piston got so big I had to break it up

My main piston that handles the incoming messages

1 Like

Same here. I had to break up my pistons to accomodate more commands as well.

BTW…is everything working on your end? I’m just curious as there are some users, including myself is currently seeing that the service is down. Looking at the Twilio logs, there is an error. I’m thinking that this could be a Twilio thing.

Looks like there was a problem either with Twilio or ST’s cloud. Everything is back to normal as before.

Its not been very reliable since the weekend
Messages not arriving
and today my webcore keep alive went weird too


The Twilio Debug complains alot about “[12300 - Invalid Content-Type]” anyone know how to stop that from happening

Haven’t seen the error on Twilio on my end. It was a little shaky a few days ago but things seem to have been back to normal now. You still having stability issues?