Low-code/ No-code integrations are a life saver when you want to automate your business processes. Integromat is one such platform which can help you take direct actions on important data coming from your IoT devices. With the EMnify Multi Cloud Data Streamer, you can stream connectivity events, usage data and more from your EMnify connected devices and create automations with it using Integromat.
- A device with a cellular modem and EMnify SIM card
- An Integromat account
- Connectivity metadata available into Integromat to unify all IoT operations dashboards in one place
- Easy low-code integration
- Set up triggers on receiving events or usage data from your SIM
- One-time set up needed for multiple processes
- Processing handled on the Integromat platform. No processing required at your server.
- Can take actions like sending email or triggering API calls or DB queries etc. on events like device disconnected
- Provides a one stop solution to monitor your IoT devices for preemptive maintenance, everyday operations or breakdown
When you have a device with an EMnify SIM sending data, you can set the amount of data a particular device can consume in a month. You can set this limit from the EMnify portal for security reasons or from a data consumption point of view. Once this data limit is reached, the SIM will still try to connect to the network and create a PDP context but will fail to do so. It will send an event in this case stating why it isn't able to connect. We then use this event to trigger an email using Integromat to take further actions.
Prepping your Integromat Scenario to accept the Data Streamer
In your Integromat account, click on `+ Create a new scenario` and select the service Webhooks. On the Scenario building pages, click on the Webhooks icon to select Custom webhook.
Under the Webhook title in the box, click on Add and give your webhook an appropriate name.
On saving this you will see a url that is generated. Copy this url as we will need it in the next step to connect it to the Data Streamer.
Creating an event stream with the EMnify Data Streamer
Once you have prepped the Integromat, go to the EMnify Portal to create a data stream. Log in with your credentials and click on the Integrate button on the left hand side menu. Then go ahead and click on ADD NEW STREAM.
Select Webhook as your stream of choice and choose the source Stream events.
The PDP Context create event is triggered when the SIM tries to create a data channel in the network. Now if your SIM has used up all the alloted data, it won't be able to send data through this channel. The event will reflect this and will serve you the reason why it wasn't able to create the PDP context.
Which is why under the EVENT OPTIONS in the create Data Streams, you need to choose just the Create PDP Context event.
In the target URL, enter the url copied when you created a webhook module in Integromat.
Click on Create to create the stream with the Multi Cloud Data Streamer (MCDS).
*You can also create a data stream using the EMnify API.
Triggering an E-mail on receiving the Data used-up event
After creating the Stream, you want to trigger an action when the event arrives. To do that, we need to provide the format of the event to the Webhooks module in Integromat, so it knows in what format to expect. You can do this by lowering the limit to 1MB of one of your devices and using some data on it. After that let the device connect again by restarting the device.
You can also use this test event as a template.
"description": "Policy Control"
"description": "Create PDP Context"
"name": "EMnify Demo"
"description": "PDP Context Request rejected, because endpoint is currently blocked due to exceeded traffic limit.",
The webhook module will show that it has successfully determined the format.
We will now trigger an email on the Integromat platform upon receiving the event. Next to the webhook module in the Integromat scenario, click on the plus sign to add another module.
Select the Email module (you can choose any email service like Google email or Microsoft 365 email) and click on Send me an Email. In the subject line, you can choose elements from the event which was read by your Integromat webhook module.
Click on OK and run your integration once to test it out. you should get an email when your device which has used up all the allocated data, tries to use data again.
You can use this template to automate many other events, such as creating an invoice, recharging your account, or checking for activity when the device enters a new country.