My project is using smart home product to trigger IFTTT and using Webhooks to update the V pin on Blynk.
I have read and find some topic on it. However, they can’t help.
I am using Arduino Uno, ESP8266, and SONOFF door/window sensor.
My project is using smart home product to trigger IFTTT and using Webhooks to update the V pin on Blynk.
I have read and find some topic on it. However, they can’t help.
I am using Arduino Uno, ESP8266, and SONOFF door/window sensor.
Hey there, if you’re using blynk IOT then check this out
https://docs.blynk.io/en/blynk.cloud/https-api-overview
I have try
http://blynk-cloud.com/xxxxtokenxxx/update/V0?value=1
http://cloud.blynk.cc:8080/xxxxtokenxxx/pin/V0
However, it shows “invalid token”. Cloud you suggest any solution?
Are you using blynk IOT ?
Yes, I am using Blynk in blynk.cloud. Do I need to use the app so that the api will function?
You should check this out
https://docs.blynk.io/en/blynk.cloud/https-api-overview
Your url should look like this sample
https://blynk.cloud/external/api/update?token=ffujYGgbf805tgsf&v1=1
No, just use the right url and it should work
Using https://blynk.cloud
on its own in the IFTTT API call won’t always work. It depends on the location of the Blynk server that holds the user’s project and the location of the IFTTT server.
When the IFTTT server makes the API call it will try to use a DNS service to resolve blynk.cloud
(translate blynk.cloud
into an IP address) and that DNS service will most likely return the IP address of the Blynk cloud server that is geographically closest to the IFTTT server.
With 5 regional Blynk cloud servers, there’s a 1 in 5 chance that it will hit the correct one. If IFTTT also uses a geographically distributed network of servers (which I would expect that they do) then you may even get a situation where an IFTTT API call works one day, but not the next - because the call is being handled by a different IFTTT server.
With Blynk Legacy the workaround to this was to find and use the IP address of the Blynk cloud server that holds your project. The risk of hard-coding the server IP address into your IFTTT call is that if the IP address of the server needs to change for any reason then the API call will fail.
Blynk have created a more elegant solution with Blynk IoT which uses subdomains. Each cloud server has its own unique subdomain like https://lon1.blynk.cloud
for the London server and https://ny3.blynk.cloud
for the New York server.
The correct subdomain for the server that holds your account should always be included in the URL when you’re making API calls (especially with services like IFTTT) to overcome these issues.
You can find the correct server subdomain by looking at the bottom right hand corner of your web console dashboard, or the “About” screen of the app.
More info in the documentation here:
https://docs.blynk.io/en/blynk.cloud/troubleshooting
Pete.
In fact, https://fra1.blynk.cloud/external/api/update?token=myToken&v1=1
works for me.
Is it a bad idea to hardwire the local server in the code?
No, It’s not a bad idea at all - it’s exactly what you should do, as I explained in my last post.
Pete.