Skip to content

Notification Media

Name Input Params Return Data Description
resiot_sendemail String, String, String Boolean, String Send an e-mail to a given E-mail address list with a Subject and a Message using the first Media Notification configuration available
resiot_sendemailtxt String, String, String Boolean Send an e-mail to a given E-mail address list with a Subject and a Message using the first Media Notification configuration available
resiot_sendemailnotemplate String, String, String Boolean Send an e-mail to a given E-mail address list with a Subject and a Message using the first Media Notification configuration available. The message is formatted in HTML without adding a default template
resiot_sendemailatt String, String, String, String Boolean, String Send an e-mail to a given E-mail address list with a Subject and a Message using the first Media Notification configuration available. The message also contains an Attachment specified by its IdHex
resiot_alert String, String Boolean, String Send an Alert message to a member of your organization or to your entire organization
resiot_alertwithfeedback String, String, String, String, String, Integer, Integer Boolean, String Send an Alert message containing a field to set a node field
resiot_alertwithattachment String, String, String Boolean, String Send an Alert message containing the link to an attachment
resiot_alertelement String, String, String, String Boolean, String Send an Alert message linked to an existing Element (Node, Gateway, Variable or Scene)
resiot_importantmessage String, String Boolean, String Send an Important message to a member of your organization or to your entire organization
resiot_importantmessagewithfeedback String, String, String, String, String, Integer, Integer Boolean, String Send an Important message containing a field to set a node field
resiot_importantmessagewithattachment String, String Boolean, String Send an Important message containing the link to an attachment
resiot_telegram String, String String Send a telegram message using media
resiot_pushover String, String String Send a pushover notification using media
resiot_msteams String, String String Send a custom message using Microsoft Teams media

resiot_sendemail(String, String, String)

Send an e-mail to a given E-mail address list with a Subject and a Message using the first Media Notification configuration available. The email body will be encapsulated in a premade layout and set as HTML.
Example
AllWorked, Err = resiot_sendemail(E-mail, Subject, Message)
Input Parameters
 - E-mail (String): * The e-mail of the recipient. Can contain up to 10 email addresses, separated by a ;(semicolon) without spaces.
 - Subject (String): * The subject of the e-mail.

 - Message (String): * The message of the e-mail.
Returns
 - AllWorked (Boolean): * The functions returns true if the assignment worked.

 - Err (String): * The functions returns an empty string if the assignment worked, otherwise it returns the error description. *

Email = "email@email.com"       -- The e-mail of the recipient
Subject = "Subject"             -- The subject of the e-mail
Message = "Message"             -- The message of the e-mail
AllWorked, Err = resiot_sendemail(Email, Subject, Message)
resiot_debug(AllWorked)
resiot_debug(Err)
-- 
-- If there aren't any errors:
-- 
-- AllWorked = true
-- Err = ""
-- 
-- Else:
-- 
-- AllWorked = false
-- Err = "Error..."
-- 

Return to index


resiot_sendemailtxt(String, String, String)

Send an e-mail to a given E-mail address list with a Subject and a Message using the first Media Notification configuration available. Unlike resiot_sendemail, this function will be sent as plain text.
Example
AllWorked = resiot_sendemailtxt(E-mail, Subject, Message)
Input Parameters
 - E-mail (String): * The e-mail of the recipient. Can contain up to 10 email addresses, separated by a ;(semicolon) without spaces.
 - Subject (String): * The subject of the e-mail.

 - Message (String): * The message of the e-mail.
Returns
 - AllWorked (Boolean): * The functions returns true if the assignment worked.

Email = "email@email.com"       -- The e-mail of the recipient
Subject = "Subject"             -- The subject of the e-mail
Message = "Message"             -- The message of the e-mail
AllWorked = resiot_sendemailtxt(Email, Subject, Message)
resiot_debug(AllWorked)
-- 
-- If there aren't any errors:
-- 
-- AllWorked = true
-- 
-- Else:
-- 
-- AllWorked = false
-- 

Return to index


resiot_sendemailnotemplate(String, String, String)

Send an e-mail to a given E-mail address list with a Subject and a Message using the first Media Notification configuration available. The email body will be set as HTML but it will not be encapsulated in a premade layout.
Example
AllWorked = resiot_sendemailnotemplate(E-mail, Subject, Message)
Input Parameters
 - E-mail (String): * The e-mail of the recipient. Can contain up to 10 email addresses, separated by a ;(semicolon) without spaces.
 - Subject (String): * The subject of the e-mail.

 - Message (String): * The message of the e-mail.
Returns
 - AllWorked (Boolean): * The functions returns true if the assignment worked.

Email = "email@email.com"       -- The e-mail of the recipient
Subject = "Subject"             -- The subject of the e-mail
Message = "Message"             -- The message of the e-mail
AllWorked = resiot_sendemailnotemplate(Email, Subject, Message)
resiot_debug(AllWorked)
-- 
-- If there aren't any errors:
-- 
-- AllWorked = true
-- 
-- Else:
-- 
-- AllWorked = false
-- 

Return to index


resiot_sendemailatt(String, String, String, String)

Send an e-mail to a given E-mail address list with a Subject and a Message using the first Media Notification configuration available. The message also contains an Attachment specified by its IdHex.
Example
AllWorked, err = resiot_sendemailatt(E-mail, Subject, Message, AttachmentIdHex)
Input Parameters
 - E-mail (String): * The e-mail of the recipient. Can contain up to 10 email addresses, separated by a ;(semicolon) without spaces.
 - Subject (String): * The subject of the e-mail.

 - Message (String): * The message of the e-mail.
 - AttachmentIdHex (String): * The IdHex of the Attachment.

Returns
 - AllWorked (Boolean): * The function returns true if the assignment worked.
 - err (String): * The function returns an empty string if the assignment worked, otherwise it returns the error.

Email = "email@email.com"       -- The e-mail of the recipient
Subject = "Subject"             -- The subject of the e-mail
Message = "Message"             -- The message of the e-mail
AttachmentIdHex = "74678234323" -- The IdHex of the Attachment
AllWorked, err = resiot_sendemailatt(Email, Subject, Message, AttachmentIdHex)
resiot_debug(AllWorked)
resiot_debug(err)
-- 
-- If there aren't any errors:
-- 
-- AllWorked = true
-- err = ""
-- 
-- Else:
-- 
-- AllWorked = false
-- err = "Error..."
-- 

Return to index


resiot_alert(String, String)

Send an Alert message to a member of your organization or to your entire organization.
Example
AllWorked, Error = resiot_alert(ToWho, Message)
Input Parameters
 - ToWho (String): * This string contain the e-mail or the Hexadecimal ID of the user that will receive the message. If you leave the string empty, the message will be sent to the whole organization. If you insert the email, make sure that the email belongs to a user in your ResIOT platform
 - Message (String): * The message that will be sent to the receiver.

Returns
 - AllWorked (Boolean): * The functions returns true if the assignment worked.
 - Error (String): * If the Result is false, here is wrote the error.

ToWho = "e-mail@e-mail.com"     -- This string contain the e-mail or the Hexadecimal ID of the user that will receive the message. If empty, the message will be sent to the whole organization. If you insert the email, make sure that the email belongs to a user in your ResIOT platform
Message = "The Message"         -- The message that will be sent to the receiver
AllWorked, Error = resiot_alert(ToWho, Message)
if Error ~= "" then
    -- error 
    resiot_debug(Error)
else
    -- bool value successfull call
    resiot_debug(AllWorked)
end

-- MESSAGE TO ALL ORGANIZATION MEMBERS
ToWho = ""      -- When empty, the message will be sent to the whole organization
Message = "The Message"         -- The message that will be sent to the receiver
AllWorked, Error = resiot_alert(ToWho, Message)
if Error ~= "" then
    -- error 
    resiot_debug(Error)
else
    -- bool value successfull call
    resiot_debug(AllWorked)
end

Return to index


resiot_alertwithfeedback(String, String, String, String, String, Integer, Integer)

Send an Alert message containing a field to set a node field.
Example
AllWorked, Error = resiot_alertwithfeedback(ToWho, Message, AppEUI, DevEUI, Tag, Time, Type)
Input Parameters
 - ToWho (String): * This string contain the e-mail or the Hexadecimal ID of the user that will receive the message. If you leave the string empty, the message will be sent to the admins.
 - Message (String): * The message that will be sent to the receiver.

 - AppEUI (String): * The AppEUI of the node you want to edit the tag.
 - DevEUI (String): * The DevEUI of the node you want to edit the tag.

 - Tag (String): * The Tag you want to edit.
 - Time (Integer): * At what time you want to set the tag (in seconds).

 - Type (Integer): * The type of the tag.
Returns
 - AllWorked (Boolean): * The functions returns true if the assignment worked.

 - Error (String): * If the Result is false, here is wrote the error. *

ToWho = "e-mail@e-mail.com"     -- This string contain the e-mail or the Hexadecimal ID of the user that will receive the message. If empty, the message will be sent to the whole organization
Message = "The Message"         -- The message that will be sent to the receiver
AppEUI = "736c6c6f72613336"
DevEUI = "323831394D367F02"
Tag = "UserExtraValue01"
Time = os.time() - 7200         -- The time in which the tag will be saved, it is in seconds. in this example the value will be saved two hours ago from now
Type = 0                        -- The type of the field that will appear in the alert. 0 -> String; 1 -> Numeric; 2 -> Boolean. Any other will be count as 0
AllWorked, Error = resiot_alertwithfeedback(ToWho, Message, AppEUI, DevEUI, Tag, Time, Type)
if Error ~= "" then
    -- error 
    resiot_debug(Error)
else
    -- bool value successfull call
    resiot_debug(AllWorked)
end

Return to index


resiot_alertwithattachment(String, String, String)

Send an Alert message containing the link to an attachment.
Example
AllWorked, Error = resiot_alertwithattachment(ToWho, Message, IdHexAttachment)
Input Parameters
 - ToWho (String): * This string contain the e-mail or the Hexadecimal ID of the user that will receive the message. If you leave the string empty, the message will be sent to the admins.
 - Message (String): * The message that will be sent to the receiver.

 - IdHexAttachment (String): * The Hexadecimal ID of the Attachment you want to download.
Returns
 - AllWorked (Boolean): * The functions returns true if the assignment worked.

 - Error (String): * If the Result is false, here is wrote the error. *

ToWho = "e-mail@e-mail.com"         -- This string contain the e-mail or the Hexadecimal ID of the user that will receive the message. If empty, the message will be sent to the whole organization
Message = "The Message"             -- The message that will be sent to the receiver
IdHexAttachment = "6e6f6435333330" -- The Hexadecimal ID of the Attachment you want to download. You can find this at the "Attachment List" Page
AllWorked, Error = resiot_alertwithattachment(ToWho, Message, IdHexAttachment)
if Error ~= "" then
    -- error 
    resiot_debug(Error)
else
    -- bool value successfull call
    resiot_debug(AllWorked)
end

Return to index


resiot_alertelement(String, String, String, String)

Send an Alert message linked to an existing Element (Node, Gateway, Variable or Scene).
Example
AllWorked, Error = resiot_alertelement(ToWho, Message, ElementType, ElementIdentifier)
Input Parameters
 - ToWho (String): * This string contain the e-mail or the Hexadecimal ID of the user that will receive the message. If you leave the string empty, the message will be sent to the admins.
 - Message (String): * The message that will be sent to the receiver.

 - ElementType (String): * The element type of the Element to link. Valid values are "node", "gateway", "var" and "scene"
 - ElementIdentifier (String): * The Hexadecimal ID (if the element is a Node or a Scene), the EUI (if the element is a Gateway) or the Name (if the element is a Variable) of the Element you want to link to the Alert.

Returns
 - AllWorked (Boolean): * The functions returns true if the assignment worked.
 - Error (String): * If the Result is false, here is wrote the error.

ToWho = "e-mail@e-mail.com"            -- This string contain the e-mail or the Hexadecimal ID of the user that will receive the message. If empty, the message will be sent to the whole organization
Message = "The Message"                -- The message that will be sent to the receiver
ElementType = "node"                   -- The element type of the Element to link. Valid values are "node", "gateway", "var" and "scene"
ElementIdentifier = "6e6f6435333330"   -- The Hexadecimal ID (if the element is a Node or a Scene), the EUI (if the element is a Gateway) or the Name (if the element is a Variable) of the Element you want to link to the Alert
AllWorked, Error = resiot_alertelement(ToWho, Message, ElementType, ElementIdentifier)
if Error ~= "" then
    -- error 
    resiot_debug(Error)
else
    -- bool value successfull call
    resiot_debug(AllWorked)
end

Return to index


resiot_importantmessage(String, String)

Send an Important message to a member of your organization or to your entire organization.
Example
AllWorked, Error = resiot_importantmessage(ToWho, Message)
Input Parameters
 - ToWho (String): * This string contain the e-mail or the Hexadecimal ID of the user that will receive the message. If you leave the string empty, the message will be sent to the whole organization.
 - Message (String): * The message that will be sent to the receiver.

Returns
 - AllWorked (Boolean): * The functions returns true if the assignment worked.
 - Error (String): * If the Result is false, here is wrote the error.

ToWho = "e-mail@e-mail.com"     -- This string contain the e-mail or the Hexadecimal ID of the user that will receive the message
Message = "The Message"         -- The message that will be sent to the receiver
AllWorked, Error = resiot_importantmessage(ToWho, Message)
if Error ~= "" then
    -- error 
    resiot_debug(Error)
else
    -- bool value successfull call
    resiot_debug(AllWorked)
end

Return to index


resiot_importantmessagewithfeedback(String, String, String, String, String, Integer, Integer)

Send an Important message containing a field to set a node field.
Example
AllWorked, Error = resiot_importantmessagewithfeedback(ToWho, Message, AppEUI, DevEUI, Tag, Time, Type)
Input Parameters
 - ToWho (String): * This string contain the e-mail or the Hexadecimal ID of the user that will receive the message. If you leave the string empty, the message will be sent to the admins.
 - Message (String): * The message that will be sent to the receiver.

 - AppEUI (String): * The AppEUI of the node you want to edit the tag.
 - DevEUI (String): * The DevEUI of the node you want to edit the tag.

 - Tag (String): * The Tag you want to edit.
 - Time (Integer): * At what time you want to set the tag (in seconds).

 - Type (Integer): * The type of the tag.
Returns
 - AllWorked (Boolean): * The functions returns true if the assignment worked.

 - Error (String): * If the Result is false, here is wrote the error. *

ToWho = "e-mail@e-mail.com"     -- This string contain the e-mail or the Hexadecimal ID of the user that will receive the message. If empty, the message will be sent to the whole organization
Message = "The Message"         -- The message that will be sent to the receiver
AppEUI = "736c6c6f72613336"
DevEUI = "323831394D367F02"
Tag = "UserExtraValue01"
Time = os.time() - 7200         -- The time in which the tag will be saved, it is in seconds. in this example the value will be saved two hours ago from now
Type = 0                        -- The type of the field that will appear in the alert. 0 -> String; 1 -> Numeric; 2 -> Boolean. Any other will be count as 0
AllWorked, Error = resiot_importantmessagewithfeedback(ToWho, Message, AppEUI, DevEUI, Tag, Time, Type)
if Error ~= "" then
    -- error 
    resiot_debug(Error)
else
    -- bool value successfull call
    resiot_debug(AllWorked)
end

Return to index


resiot_importantmessagewithattachment(String, String, String)

Send an Important message containing the link to an attachment.
Example
AllWorked, Error = resiot_importantmessagewithattachment(ToWho, Message, IdHexAttachment)
Input Parameters
 - ToWho (String): * This string contain the e-mail or the Hexadecimal ID of the user that will receive the message. If you leave the string empty, the message will be sent to the admins.
 - Message (String): * The message that will be sent to the receiver.

 - IdHexAttachment (String): * The Hexadecimal ID of the Attachment you want to download.
Returns
 - AllWorked (Boolean): * The functions returns true if the assignment worked.

 - Error (String): * If the Result is false, here is wrote the error. *

ToWho = "e-mail@e-mail.com"         -- This string contain the e-mail or the Hexadecimal ID of the user that will receive the message. If empty, the message will be sent to the whole organization
Message = "The Message"             -- The message that will be sent to the receiver
IdHexAttachment = " 6e6f6435333330" -- The Hexadecimal ID of the Attachment you want to download. You can find this at the "Attachment List" Page
AllWorked, Error = resiot_importantmessagewithattachment(ToWho, Message, IdHexAttachment)
if Error ~= "" then
    -- error 
    resiot_debug(Error)
else
    -- bool value successfull call
    resiot_debug(AllWorked)
end

Return to index


resiot_telegram(String, String)

Send a telegram message using media.
Example
Error = resiot_telegram(Message, HexID)
Input Parameters
 - Message (String): * The body of the message.
 - HexID (String): * The Hexadecimal Id that identify the media to use. If left empty it pick the first available.

Returns
 - Error (String): * It return the error if there is one, otherwise i is empty. *

Message = "Hello World!"    -- The body of the message
HexID = "6d656433"          -- The Hexadecimal Id that identify the media to use. If left empty it pick the first available
Error = resiot_telegram(Message, HexID)
if Error ~= "" then
    -- error 
    resiot_debug(Error)
end

Return to index


resiot_pushover(String, String)

Send a pushover notification using an existing, configured media.
Example
Error = resiot_pushover(Message, HexID)
Input Parameters
 - Message (String): * The text of the notification.
 - HexID (String): * The Hexadecimal Id that identifies the media to use.

Returns
 - Error (String): * It return the error if there is one, otherwise the string is empty. *

Message = "Hello World!"    -- The body of the message
HexID = "6d656433"          -- The Hexadecimal Id that identify the media to use.
Error = resiot_pushover(Message, HexID)
if Error ~= "" then
    -- error 
    resiot_debug(Error)
end

Return to index


resiot_msteams(String, String)

Send a custom message using Microsoft Teams media.
Example
Error = resiot_msteams(Message, HexID)
Input Parameters
 - Message (String): * The text of the notification.
 - HexID (String): * The Hexadecimal Id that identifies the media to use.

Returns
 - Error (String): * It return the error if there is one, otherwise the string is empty. *

Message = "Hello World!"    -- The body of the message
HexID = "6d656433"          -- The Hexadecimal Id that identify the media to use.
Error = resiot_msteams(Message, HexID)
if Error ~= "" then
    -- error 
    resiot_debug(Error)
end

Return to index