My first app with IoT-devices and Power Automate
Connect your IoT-buttons (and Qods) with any third party system that has a connector to Microsoft Power Automate, without writing a single line of code.
For instance, you can:
- Log your service requests into Microsoft Excel to track them efficiently
- Send an SMS or an email when a key is pressed
- Create a customer satisfaction dashboard in Microsoft Power BI
Before you start: requirements
Before using this connector, you need to:
- Create a free Ubiqod account
- Validate your email and connect to your Ubiqod account
- Have a valid Microsoft Power Automate licence (visit https://flow.microsoft.com/fr-fr/)
If you don’t see any IoT-device in your Ubiqod account, please contact the Skiply support team (firstname.lastname@example.org).
Prepare your Ubiqod Account
When you create your Ubiqod account, a demo IoT-device is automatically included (its name starts by SIMUxxxx and cannot be modified). This IoT-device is ready to use. You will be able to test your Power Automate flow without having a physical device in hands, thanks to our integrated simulator.
If you need to configure your environment again, you must complete the following steps in your Ubiqod account:
- Create a Site
- Create a Code list (in the Settings menu). You can leave it blank (default labels will be generated like “button 1”) or add labels for each button to make it more explicit.
Edit your IoT-device under the “Trackers” menu and fill in the following fields:
- IoT-device label (can be a position inside a building)
- Dispatch group(s) (you must include the IoT-devices that you intend to connect with Microsoft Power Automate to at least one Ubiqod dispatch group).
- Code list
- Do not force code mode
Create your Flow
About Microsoft Power Automate
Microsoft Power Automate is a low code platform designed to help users that are not coders to connect different apps between them. With Microsoft Power Automate, you can create a Flow that can send a SMS when a new line is added in a spreadsheet, without writing a single line of code.
A Flow contains at minimum:
- A trigger
- An action
You can add multiple actions and/or conditions in a Flow.
Our Ubiqod connector for Microsoft Power Automate lets you trigger an action each time data is received from one or more IoT-devices or Qods.
Add a Flow
In Microsoft Power Automate, in “My flows” menu, click “New”, and choose “Automated from blank”, or choose “Automated flow” in the “Create” menu:
Enter a flow name.
In the field “Choose your flow’s trigger”, look for “Ubiqod”, and choose “When data is received from devices”:
The first time you setup the connector, Microsoft Power Automate will ask you for a connection name and an API Key.
The API key can be found in the “Account” menu of your Ubiqod account:
Click on the Show/Hide icon, copy the API key, and paste it into the Microsoft Power Automate screen. Give a name to the connection, and click “Create”:
Configure the trigger
In the Group Name list, select a Dispatch group:
Each IoT-device belonging to this group in your Ubiqod account will trigger an action in your Flow.
Congratulations builder! Your trigger is configured. You can now add a New Step by clicking the corresponding button, and setup action.
Use the data in the action step
At next step, you will tell Microsoft Power Automate how to use data of your devices to perform an action.
As an example, we will create an action that sends an email with the details of a service request, depending on the button pressed on an IoT-device.
Look for the “Mail” connector in the list of actions, and choose “Send an email notification” in the action list:
You may be asked to validate the Terms and Conditions of Use.
For each field of the mail action setup, you can use the data from the device. For instance, if you want to set the subject of the email as Device XXX has a message”, where XXX is the name of the IoT-device, you will configure the subject this way:
You can mix dynamic fields (available on the right of your screen, in “Dynamic content” tab) and text. You can even use formulas (Expression tab) to build a more customized experience.
Following fields are available for mapping:
- Identifier: identifier of the Qod or IoT-device (s/n)
- Qod or IoT-device label: label of the Qod or IoT-device
- Action value: code label or raw value if no such code defined in the related code list (button index for IoT-devices if no such code defined)
- Site Label: Site name the Qod or IoT-device is linked to
- Timestamp: datetime of Qod scanning or IoT-device message transmission
- Number of presses: Only for IoT-devices, number of times the button was pressed
- Site Id: site ID the Qod or IoT-device is linked to
- On-device condition: 1 if condition is valid, 0 if not – For IoT-device: condition is valid when magnetic badge has been swiped / For Ubiqod Keys: condition is valid when dynamic QR code has been scanned from the device and validated by the Ubiqod server
- Customer contact email: email of customer contact defined on Site
- Customer contact phone: phone number of customer contact defined on Site
- Site manager email: email of site manager defined on Site
- Site manager phone: phone number of site manager defined on Site
- GPS condition: 1 if condition is valid, 0 if not – condition is valid when the user GPS position is under the validation distance from the site position, 0 if not or if the user refused to give his position
- Code condition: 1 if condition is valid, 0 if not – condition is valid when the entered code is defined in the related code list
- GPS value: if available, GPS coordinates of the user’s position
- Validation code value: if available, validation code label or raw value if no such code defined in the related code list
- Custom field 1: only for Qod with a form, value of field #1
- Custom field 2: only for Qod with a form, value of field #2
- Custom field 3: only for Qod with a form, value of field #3
- Custom field 4: only for Qod with a form, value of field #4
Complete mandatory fields to customize your service request (To, Body and Subject) and click “Save”.
Congratulations! You have built a full functional IoT App with Ubiqod and Microsoft Power Automate.
Now, each time you press a button, an email will be sent.
Your account is configured with sample data. If you want to change the label corresponding to a button of your IoT-device, you must edit the Code list associated to your IoT-device.
Tests & troubleshooting
You can launch the simulator to test your flow (click on the "play" icon in the IoT-device list):
Data will be sent 10 seconds after the first press, except if you use the badge. Keep the simulator open until the 3 leds stay up for 1 second.
You can check if Microsoft Power Automate receives data here:
With "real" IoT-device, it can take up to 30 seconds before the email is sent, and sometimes more for it to be received.
Don’t forget to add your devices in the correct Dispatch group in your Ubiqod account (the one used in the trigger).
If nothing happens after 1 minute, go to the IoT-device list in your Ubiqod account, or press "Refresh" to update "Last seen" information:
- If the “Last seen” field does not update: your device does not send the data to the system: contact Skiply support (email@example.com)
- If the “Last seen” field updates: check if the device belongs to the group set when you configured the trigger into Microsoft Power Automate