History: IoT Dashboard and Workflow
Source of version: 11
Copy to clipboard
{file type="gallery" fileId="2239" showicon="y"}Given the existence of https://doc.tiki.org/API, we began exploring their potential for integration with the physical world. This led to early experiments documented here: https://doc.tiki.org/Internet+of+Things+usage Over time, these explorations grew into a dedicated feature designed specifically for IoT use cases, now available starting from Tiki 28: https://gitlab.com/tikiwiki/tiki/-/merge_requests/4178. !! What is involved in this new feature * Trackers for IoT data : use Tiki Trackers to store physical object–related data and event logs. * Visual interface for event handling : decide what happens when new data is created in a tracker through an interactive drawing canvas. {img src="display2222" link="display2222" width="400" rel="box[g]" imalign="center" desc="Click to expand" align="center" styleimage="border"} * Realtime dashboard : monitor your physical device in real time with dashboards that display changes as they occur. The dashboard is designed by you, drag in widget as you wish and build the dashboard in the way you want it to look {img src="display2226" link="display2226" width="400" rel="box[g]" imalign="center" desc="Click to expand" align="center" styleimage="border"} If you are familiar with Arduino you can quickly follow the steps explained in this snippet to build a remote temperature monitor tool : https://gitlab.com/-/snippets/3759981 !! How to get started First of all you need to install latest version of Tiki or upgrade to Tiki 28 or later. 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. {img src="display2223" link="display2223" width="400" rel="box[g]" imalign="center" desc="Click to expand" align="center" styleimage="border"} The last thing is to enable the API access feature, please follow this link on how to do it https://doc.tiki.org/API If all above is done, you can start by opening ~~#d0021b:/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) {img src="display2225" link="display2225" width="400" rel="box[g]" imalign="center" desc="Click to expand" align="center" styleimage="border"} Create a Tracker to hold your IoT devices data and define the fields depending on your requirements : This is crucial, think of the tracker your database (and it is a powerful no-code database built-in Tiki, not familiar with it? check https://doc.tiki.org/Trackers). {img src="display2227" link="display2227" width="400" rel="box[g]" imalign="center" desc="Click to expand" align="center" styleimage="border"} Example of a tracker for a ~~#ff0000:Home Air Quality Monitor~~ system When your tracker is ready, go back to __/tiki-iot_dashboard.php__ and from there you can create a new IoT app and tie it to the tracker you just created. Moving forward, any change that happens into your tracker will also trigger the execution of your IoT defined flow. {img src="display2228" link="display2228" width="400" rel="box[g]" imalign="center" desc="Click to expand" align="center" styleimage="border"} !! Building the IoT app !!! The flow design Once the app is created and linked with a Tracker, you can now decide what the app actually does. By flow design we give you ability to configure (without writing code) what happen when new entries are created or updated inside the tracker. {img src="display2244" link="display2244" width="400" rel="box[g]" imalign="center" desc="Click to expand" align="center" styleimage="border"} Nodes encapsulate logic that happen when data arrives. Current nodes : * Email Send : It takes text as input, use it as email body, send the email using your existing instance settings then pass the same input text to the next node as is (if any) * Hardware I/O State : More related to physical devices. You configure the pin number (can be virtual) and decide to change it state when the node is executed. We will take later about the endpoint you can use to read this I/O state. * File logger : This takes input as text, logs it into a file located at __lib/iot_tiki/logs/__ then pass the input as is to the next node * Math Comparison : Get input, pass it to the condition and if condition passes, the flow will continue, if not the flow will stop. The syntax written here follows the calculation syntax https://doc.tiki.org/Calculations and __$input__ represent the input within your formula. The output of your formula SHOULD evaluate to true or false at the end otherwise some unexpected behavior may happen * String Template : This node is used to rewrite string from input and output whatever is supplied in the config of the node with every occurrence of __==input==__ being replaced by the input value. * Sensor Input : This is where we can get data that was inserted into the Tracker. It output the value exactly as supplied * Webhook Send : Get input and send it as request body via a POST request to the webhook URL is configured A sample flow : {img src="display2238" link="display2238" width="400" rel="box[g]" imalign="center" desc="Click to expand" align="center" styleimage="border"} {img src="display2239" link="display2239" width="400" rel="box[g]" imalign="center" desc="Click to expand" align="center" styleimage="border"} You can quickly test your flow by inserting new entry in the tracker tied to your IoT app of edit an existing item. !!! Set up your real-time dashboard to visualize incoming data. After saving data to the Tracker and defining what actions should be performed when new data arrives, you may want to monitor events in real time. 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 : # Choose type of widget : ## Sensor input : This widget help visualize data directly from a Tracker field ## Led (IO State) : This widget display an "LED" https://en.wikipedia.org/wiki/Light-emitting_diode like design and it's purpose is display state of virtual or real hardware input/output (ON OR OFF). !!!! Know issue Note : there is a known issue that prevent the state to correctly update and the state become null, we are investigating the cause and we will implement a fix very soon ~~#ff0000:__Note__: 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.~~ {img src="display2246" link="display2246" width="400" rel="box[g]" imalign="center" desc="Click to expand" align="center" styleimage="border"} * Connect your IoT devices or services to Tiki using the Tiki APIs * Test & Next steps
History
Information | Version | |||||
---|---|---|---|---|---|---|
Elvis ANSIMA | 12 | |||||
Elvis ANSIMA | 11 | |||||
Elvis ANSIMA | 10 | |||||
Elvis ANSIMA | 9 | |||||
Elvis ANSIMA | 8 | |||||
Elvis ANSIMA | 7 | |||||
Elvis ANSIMA | 6 | |||||
Elvis ANSIMA | 5 | |||||
Elvis ANSIMA | 4 | |||||
Elvis ANSIMA | 3 | |||||
Elvis ANSIMA | 2 | |||||
Elvis ANSIMA | 1 |