How to connect 1000+ web apps to cayenne using Zapier

In this topic, we will learn how to add 1000+ web app to cayenne using Zapier. a good start will be to first get familiar with Zapier by going through the docs. https://zapier.com/learn/

What is Zapier

Zapier is an online automation tool that connects your favorite apps, such as Gmail, Slack, MailChimp, and over 1,000 more. You can connect two or more apps to automate repetitive tasks without coding or relying on developers to build the integration. Move info between your web apps automatically, so you can focus on your most important work. It’s easy enough that anyone can build their own app workflows with just a few clicks.

There are two parts in Zapier which are:

Trigger:

A Trigger is the event in an app that starts the Zap.
Here we are going to display the weather forecast on the cayenne dashboard.
Zapier has a built-in weather app but it only updates day once a day which is kind of :-1:. so we are going to use https://openweathermap.org/ to get the weather forecast where the client routinely calls an endpoint for new data and triggers the app when the id we provided has changed.
sign up to openweathermap and subscribe to free OpenWeather API. your API key will be sent to you via email and will take a couple of hours to activate.
in Zapier trigger webhook you need to add the following URL with your city name and API key

http://api.openweathermap.org/data/2.5/weather?q=Burbank, US&APPID= <APP Key>

next, you need to add the Deduplication Key as dt which is the date and time of the last reading in Unix epoch format. This allows Zapier to detect the data returned by the webhook actually changed.

click continue and if everything is correct you will get a data response something like this:

next we need to add:

Action

we are going to use webhook again to make a custom POST request to the cayenne API to send this weather forecast data to the cayenne dashboard.

the URL to be added is:

https://api.mydevices.com/things/{thing_id}/data where thing_id is the MQTT client_id

Fill all the details as shown in the images below.

Data is the JSON body and Zapier has a cool feature which provides you with all the data from the trigger.

Basic auth: you need to add your device MQTT username and MQTT password.

Header is Content-Type: application/json

once done click continue and it will run a test. you might need to trigger the test twice to see the temporary widgets populate on your dashboard. Make them permanent by clicking on +.


Similarly, you can connect 1000+ web apps to cayenne.

A special thanks to @jnacci for sharing this post.

5 Likes

I carefuly followed all the steps you were previously described and was stucked at the same end.
I was Sending Test Custom Request to Webhooks by Zapier and received the response:
We had trouble sending your test through.
The app returned “Not Found”. This usually happens when a field value used in this step is missing or we’re unable to find some information in your connected app or service. Make sure that the information exists and that the field values used in this step are entered correctly.
Hide details
Troubleshooting Errors | Common Webhooks by Zapier Problems | Contact Support
We made a request to api.mydevices.com and received (404) Not Found.


Method
POST
URL
https://api.mydevices.com/things/{xxxxxxxx-xxxx-xxxx-xxxx-xxxxxxxxxxxx}/data
Data Pass-Through?
false
Data
[
{“channel”:33,“value”:284.72,“type”:“temp”,“unit”,“k”},
{“channel”:34,“value”:41,“type”:“rel_hum”,“unit”,“p”}
]
Unflatten
yes
Basic Auth
xxxxxxx-xxxx-xxxx-xxxx-xxxxxxxxxxxx|xxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxx
Headers
Content-Type
application/json

image

Thanks for the reply in advance.

remove {} from the URL.

Thanks

2 Likes