What is involved in this new feature | |
|
| |
How to get started | |
|
Then you need to enable the feature in the admin panel. From the admin panel you can search "feature_internet_of_things" in the preferences or visit "/tiki-admin.php?page=features#contentadmin_features-programmer" then activate the feature. If prompted to activated the Realtime please go ahead, it is required for the IoT feature to work.
If all above is done, you can start by opening /tiki-iot_dashboard.php. Note that you need to have 'tiki_p_manage_iot_apps' permission which you configure in the admin panel (by default all admins have this permission)
Moving forward, any change that happens into your tracker will also trigger the execution of your IoT defined flow.
| |
Building the IoT app | |
|
| |
The flow design | |
|
A sample flow :
Known issues* Some setting from the drawing canvas may not take effect untill you have changed that manually. For example you insert a String template node, make sure you type in something before saving, the default value may not be pulled correctly if you don't change at least once before saving. You can keep the same default value but just make sure you changed it manually | |
Set up your real-time dashboard to visualize incoming data. | |
|
For example, from your mobile device, you could check the current state of your smoke detector. Depending on your setup, you might even see the live smoke levels in your kitchen — without needing to refresh the page. In industrial applications, the real-time dashboard can be used to monitor the state of multiple sensors simultaneously. The dashboard is built with widgets that you give different look and pair them with in data source of your choice. From above screenshot :
Example of a widget design When you are done creating your dashboard you just need to hit the "Save" button. To actually see the real time dashboard, just go to /tiki-iot_dashboard.php?mode=view&app_id=app_id or click the view dashboard link under the IoT app settings If your real-time setup was correctly done, stay on the dashboard and submit some data, you will see the change immediately reflecting on the dashboard. Known issues* For a hardware I/O node to appear in the I/O dropdown as a data source, you must first configure the I/O in the flow design and log data into the tracker at least once. This limitation exists due to the current detection method for configured I/O in your flow design. Improvements to this behavior are planned in a future update.
| |
Connect your IoT devices or services to Tiki using the Tiki APIs | |
|
The first thing to do is to generate an access token. The combination of the access token and app_id will be used to authenticate our programmatical calls. We have 3 operations actually implemented and all to be called via a single endpoint {{Base-URL}}/tiki-ajax_services.php?controller=iotapps&action=iot_api_middleware . In the request we need two headers for authentication :
The current implemented operations are :
Eg. of request : json Copy to clipboard
Eg. of request : json Copy to clipboard
Eg. of request : json Copy to clipboard
| |
A Quick demo of the real-time dashboard | |