Skip to content

Html

Name Input Params Return Data Description
resiot_gethtml_widget String, Integer, String, String, String, Bool, String, String, String, String, Integer, Integer, Integer String, String Get the HTML code to show a widget based on a Node Field
resiot_gethtml_linearwidget String, String, String, String, Bool, String, String, String, String, Integer, Integer, Integer String, String Get the HTML code to show a linear widget based on a Node Field
resiot_gethtml_nodeeditfield String, String, String, String, Integer String Get the HTML code of a button that allow to edit the value of the field selected
resiot_gethtml_nodecommand String, String, String String Get the HTML code of the button that can start the selected command
resiot_gethtml_childrenbox String, String, Integer String Get the HTML code of some buttons that will open the detail box of the children of the selected node. This will work only when the node has at least one child

resiot_gethtml_widget(String, Integer, String, String, String, Bool, String, String, String, String, Integer, Integer, Integer)

Get the HTML code to show a widget based on a Node Field.
Example
resultHTML, err = resiot_gethtml_widget(Reference, WidgetType, AppEUI, DevEUI, Field, CustomSearch, width, height, label, color, hourSel, timeSince, timeTo)
Input Parameters
 - Reference (String): * A unique name you can choose, used to identify widgets, when creating more than one widget per page it is strongly recommended to use different References for each widget.
 - WidgetType (Integer): * A numeric code which identifies the type of widget you want to create. Currently only linear widgets are supported. Linear widget code: 10.

 - AppEUI (String): * The AppEUI of the Node you want to get the Field from.
 - DevEUI (String): * The DevEUI of the Node you want to get the Field from.

 - Field (String): * The name of the Node Field you want to use in the widget.
 - CustomSearch (Bool): * When true it allows to use the custom date filter for the widget, otherwise only default time filters are available.

 - width (String): * The HTML width of the widget, if empty string the width will be set to "100%".
 - height (String): * The HTML height of the widget.

 - label (String): * The label you want to display for the line in the widget.
 - color (String): * The color of the line in the widget.

 - hourSel (Integer): * The default value of the time filter (always expressed in hours). For "Custom" use -1. For "Last values" use -2.
 - timeSince (Integer): * The starting time in Unix of the interval you want to search in. Used only when hourSel is -1 (Custom)

 - timeTo (Integer): * The ending time in Unix of the interval you want to search in. Used only when hourSel is -1 (Custom)
Returns
 - resultHTML (String): * The HTML code of the widget to display.

 - err (String): * The error of the function, if no error this will contain an empty string. *

Reference = "ref1"
WidgetType = 10
AppEUI = "1234123412341234"
DevEUI = "2759847589624783"
Field = "Temperature"
CustomSearch = true
width = ""
height = "150"
label = "Temp (°C)"
color = "#8B0000"
hourSel = -1
timeSince = os.time()-3600
timeTo = os.time()-1800

resultHTML, err = resiot_gethtml_widget(Reference, WidgetType, AppEUI, DevEUI, Field, CustomSearch, width, height, label, color, hourSel, timeSince, timeTo)
resiot_debug(resultHTML)
resiot_debug(err)

Return to index


resiot_gethtml_linearwidget(String, String, String, String, Bool, String, String, String, String, Integer, Integer, Integer)

Get the HTML code to show a linear widget based on a Node Field.
Example
resultHTML, err = resiot_gethtml_linearwidget(Reference, AppEUI, DevEUI, Field, CustomSearch, width, height, label, color, hourSel, timeSince, timeTo)
Input Parameters
 - Reference (String): * A unique name you can choose, used to identify widgets, when creating more than one widget per page it is strongly recommended to use different References for each widget.
 - AppEUI (String): * The AppEUI of the Node you want to get the Field from.

 - DevEUI (String): * The DevEUI of the Node you want to get the Field from.
 - Field (String): * The name of the Node Field you want to use in the widget.

 - CustomSearch (Bool): * When true it allows to use the custom date filter for the widget, otherwise only default time filters are available.
 - width (String): * The HTML width of the widget, if empty string the width will be set to "100%".

 - height (String): * The HTML height of the widget.
 - label (String): * The label you want to display for the line in the widget.

 - color (String): * The color of the line in the widget.
 - hourSel (Integer): * The default value of the time filter (always expressed in hours). For "Custom" use -1. For "Last values" use -2.

 - timeSince (Integer): * The starting time in Unix of the interval you want to search in. Used only when hourSel is -1 (Custom)
 - timeTo (Integer): * The ending time in Unix of the interval you want to search in. Used only when hourSel is -1 (Custom)

Returns
 - resultHTML (String): * The HTML code of the widget to display.
 - err (String): * The error of the function, if no error this will contain an empty string.

Reference = "ref1"
AppEUI = "1234123412341234"
DevEUI = "2759847589624783"
Field = "Temperature"
CustomSearch = true
width = ""
height = "150"
label = "Temp (°C)"
color = "#8B0000"
hourSel = -1
timeSince = os.time()-3600
timeTo = os.time()-1800

resultHTML, err = resiot_gethtml_linearwidget(Reference, AppEUI, DevEUI, Field, CustomSearch, width, height, label, color, hourSel, timeSince, timeTo)
resiot_debug(resultHTML)
resiot_debug(err)

Return to index


resiot_gethtml_nodeeditfield(String, String, String, String, Integer)

Get the HTML code of a button that allow to edit the value of the field selected. This is usually used in a "Lua code box" widget.
Example
codeHTML = resiot_gethtml_nodeeditfield(AppEUI, DevEUI, Field, Label, Size)
Input Parameters
 - AppEUI (String): * The AppEUI of the Node.
 - DevEUI (String): * The DevEUI of the Node.

 - Field (String): * The name of the Node Field you want to edit.
 - Label (String): * The string you wanto to in the button, if empty it will show "Edit Value".

 - Size (Integer): * Size of the button, it can range from 0 to 4. [0: extra-small, 1: small, 2: normal, 3: large, 4: extra-large]
Returns
 - codeHTML (String): * The HTML code of the button, in case of error it is empty.

AppEUI = "1234123412341234"
DevEUI = "2759847589624783"
Field = "Temperature"
Label = "Edit Temperature"
Size = 3

codeHTML = resiot_gethtml_nodeeditfield(AppEUI, DevEUI, Field, Label, Size)

-- Normal debug
resiot_debug(codeHTML)
-- Return of the button to the widget
resiot_setreturnvalue(codeHTML)

Return to index


resiot_gethtml_nodecommand(String, String, String)

Get the HTML code of the button that can start the selected command. This is usually used in a "Lua code box" widget.
Example
codeHTML = resiot_gethtml_nodecommand(AppEUI, DevEUI, CommandName)
Input Parameters
 - AppEUI (String): * The AppEUI of the Node.
 - DevEUI (String): * The DevEUI of the Node.

 - CommandName (String): * The name of the Command you want the link of.
Returns
 - codeHTML (String): * The HTML code of the button, in case of error it is empty.

AppEUI = "1234123412341234"
DevEUI = "2759847589624783"
CommandName = "Start_Control"

codeHTML = resiot_gethtml_nodecommand(AppEUI, DevEUI, CommandName)

-- Normal debug
resiot_debug(codeHTML)
-- Return of the button to the widget
resiot_setreturnvalue(codeHTML)

Return to index


resiot_gethtml_childrenbox(String, String, Integer)

Get the HTML code of some buttons that will open the detail box of the children of the selected node. This will work only when the node has at least one child. This is usually used in a "Lua code box" widget.
Example
codeHTML = resiot_gethtml_childrenbox(AppEUI, DevEUI, Size)
Input Parameters
 - AppEUI (String): * The AppEUI of the Node.
 - DevEUI (String): * The DevEUI of the Node.

 - Size (Integer): * Size of the buttons, it can range from 0 to 4. [0: extra-small, 1: small, 2: normal, 3: large, 4: extra-large]
Returns
 - codeHTML (String): * The HTML code of the buttons, in case of error it is empty.

AppEUI = "1234123412341234"
DevEUI = "2759847589624783"
Size = 0

codeHTML = resiot_gethtml_childrenbox(AppEUI, DevEUI, CommandName)

-- Normal debug
resiot_debug(codeHTML)
-- Return of the button to the widget
resiot_setreturnvalue(codeHTML)

Return to index