Understanding message formatter and message handler

Understanding message formatter and message handler

In the Zoho IoT application, data sent from the gateway/smart device can be enhanced further. This includes decoding raw payload into a usable JSON format and performing additional computations and enrich by calling external API's. This is achieved using the Message Formatter and Message Handler.

Message Formatter

Payloads sent by the device can be of any format. These formats need to be converted to readable values in the form of JSON to be further processed in the application. Zoho IoT applications provide the option to include a decoder as an uplink message formatter for a device product. 


NotesNote: Message formatting is supported for LoRa node devices connected using LoRa datastreams.

Message formatters are predefined for some sensors showcased in the device product gallery, and there is no limit for its usage. For other sensors, users can implement their own formatter using custom functions. Please note, the number of executions for decoding with custom function is limited. To enable unrestricted decoding executions directly within the Zoho IoT application, please contact our support team at support@zohoiot.com.

NotesNote: Custom functions for uplink handler i.e the decoder supports JavaScript Lite.

For example, consider the Milesight AM103 device that sends payloads in Hexadecimal format. The uplink message formatter linked to the AM103 device product will decode the hex message as given below:

Here, the device sends the payload in the hexadecimal format:

017564 03671801 04686D 077DC501

The Output of the formatter will be:

{
    "battery": 100,
    "co2": 453,
    "temperature": 28,
    "humidity": 54.5
}

Here is a sample code used as a decoder.

This JSON object is then used by the Zoho IoT application to process further like parse the values for the configured datapoints, etc.

Info
The maximum processing time for functions is 2 seconds. For further details, please contact support@zohoiot.com.

Message Handler  

After a message is received and formatted(optional), complex computations can be performed, and external APIs can be called if needed and enrich the received data using message handler. Zoho IoT applications provide the option to include a message handler for a device model/device instance. 



NotesNote: The message handler can use a custom function written in the Deluge language, and the payload received by the message handler must be a JSON payload.

For example, based on the temperature data received from the AM103 device, you can call a weather API to get the external temperature. Next, calculate the delta value between the internal room temperature and the external temperature, and add the new value to the JSON payload.

Input Payload for message handler:

{
temp_c : 27
}

Output Payload by message handler:

{
temp_c : 27,
temp_out : 40
temp_del : 13
}

Info
The maximum processing time for functions is 2 seconds. For further details, please contact support@zohoiot.com.

Message Handler Model and Instance Customization

A message handler can be defined for a device model, and all devices created from this model will utilize the specified message handler. If a particular device instance needs a different handler, users have the option to override the default model message handler.

Fair Usage Policy

The fair usage policy outlines the limitations on Message Handler and Message Formatter functions across all editions of the application. This is to ensure balanced system performance. These limits apply individually to each registered device rather than to the application as a whole.
 
Feature
Function Processing Time
Time Window
Max Request allowed
Message Handler
500ms
2 hours
75
Message Formatter
50ms
2 hours
35

For more details, contact support@zohoiot.com.

See Also
 



        Create. Review. Publish.

        Write, edit, collaborate on, and publish documents to different content management platforms.

        Get Started Now


          Access your files securely from anywhere

            Zoho CRM Training Programs

            Learn how to use the best tools for sales force automation and better customer engagement from Zoho's implementation specialists.

            Zoho CRM Training
              Redefine the way you work
              with Zoho Workplace

                Zoho DataPrep Personalized Demo

                If you'd like a personalized walk-through of our data preparation tool, please request a demo and we'll be happy to show you how to get the best out of Zoho DataPrep.

                Zoho CRM Training

                  Create, share, and deliver

                  beautiful slides from anywhere.

                  Get Started Now


                    Zoho Sign now offers specialized one-on-one training for both administrators and developers.

                    BOOK A SESSION







                                Quick LinksWorkflow AutomationData Collection
                                Web FormsEnterpriseOnline Data Collection Tool
                                Embeddable FormsBankingBegin Data Collection
                                Interactive FormsWorkplaceData Collection App
                                CRM FormsCustomer ServiceAccessible Forms
                                Digital FormsMarketingForms for Small Business
                                HTML FormsEducationForms for Enterprise
                                Contact FormsE-commerceForms for any business
                                Lead Generation FormsHealthcareForms for Startups
                                Wordpress FormsCustomer onboardingForms for Small Business
                                No Code FormsConstructionRSVP tool for holidays
                                Free FormsTravelFeatures for Order Forms
                                Prefill FormsNon-Profit

                                Intake FormsLegal
                                Mobile App
                                Form DesignerHR
                                Mobile Forms
                                Card FormsFoodOffline Forms
                                Assign FormsPhotographyMobile Forms Features
                                Translate FormsReal EstateKiosk in Mobile Forms
                                Electronic Forms
                                Drag & drop form builder

                                Notification Emails for FormsAlternativesSecurity & Compliance
                                Holiday FormsGoogle Forms alternative GDPR
                                Form to PDFJotform alternativeHIPAA Forms
                                Email FormsFormstack alternativeEncrypted Forms

                                Wufoo alternativeSecure Forms

                                TypeformWCAG


                                      All-in-one knowledge management and training platform for your employees and customers.

                                                Create. Review. Publish.

                                                Write, edit, collaborate on, and publish documents to different content management platforms.

                                                Get Started Now




                                                                  You are currently viewing the help pages of Qntrl’s earlier version. Click here to view our latest version—Qntrl 3.0's help articles.




                                                                      Manage your brands on social media


                                                                        • Desk Community Learning Series


                                                                        • Digest


                                                                        • Functions


                                                                        • Meetups


                                                                        • Kbase


                                                                        • Resources


                                                                        • Glossary


                                                                        • Desk Marketplace


                                                                        • MVP Corner


                                                                        • Word of the Day


                                                                        • Ask the Experts


                                                                          Zoho Sheet Resources

                                                                           

                                                                              Zoho Forms Resources


                                                                                Secure your business
                                                                                communication with Zoho Mail


                                                                                Mail on the move with
                                                                                Zoho Mail mobile application

                                                                                  Stay on top of your schedule
                                                                                  at all times


                                                                                  Carry your calendar with you
                                                                                  Anytime, anywhere




                                                                                        Zoho Sign Resources

                                                                                          Sign, Paperless!

                                                                                          Sign and send business documents on the go!

                                                                                          Get Started Now




                                                                                                  Zoho TeamInbox Resources





                                                                                                            Zoho DataPrep Demo

                                                                                                            Get a personalized demo or POC

                                                                                                            REGISTER NOW


                                                                                                              Design. Discuss. Deliver.

                                                                                                              Create visually engaging stories with Zoho Show.

                                                                                                              Get Started Now








                                                                                                                                  • Related Articles

                                                                                                                                  • Adding a Message Handler through a Device Instance

                                                                                                                                    A message handler custom function can be added through a device instance in the end application. To add a message handler through a device, Access the End Application. Select Devices > Devices in the left pane. Click on the name of the device for ...
                                                                                                                                  • Understanding Devices

                                                                                                                                    In Zoho IoT applications, a device represents a real world entity that can be a gateway, a smart device, a sensor, or even a virtual service/system application that needs to be managed and monitored. Devices in the application are the essential ...
                                                                                                                                  • Message Handler Custom Function

                                                                                                                                    When data is received from endpoints such as gateways or smart devices in the Zoho IoT application, you can use a message handler to perform additional processing. This includes running complex computations, calling external APIs, and enriching the ...
                                                                                                                                  • Testing a Message Handler Custom Function

                                                                                                                                    While creating a message handler custom function, you can test the function to see if the desired output is received. For testing, you can provide the expected value and see if the expected output value is obtained. For the message handler custom ...
                                                                                                                                  • Understanding Custom Functions

                                                                                                                                    Custom functions in Zoho IoT allow you to extend the platform's capabilities. These functions are written using various programming languages and are easy to construct. With custom functions, users can move beyond the default offerings of the ...
                                                                                                                                    Wherever you are is as good as
                                                                                                                                    your workplace

                                                                                                                                      Resources

                                                                                                                                      Videos

                                                                                                                                      Watch comprehensive videos on features and other important topics that will help you master Zoho CRM.



                                                                                                                                      eBooks

                                                                                                                                      Download free eBooks and access a range of topics to get deeper insight on successfully using Zoho CRM.



                                                                                                                                      Webinars

                                                                                                                                      Sign up for our webinars and learn the Zoho CRM basics, from customization to sales force automation and more.



                                                                                                                                      CRM Tips

                                                                                                                                      Make the most of Zoho CRM with these useful tips.



                                                                                                                                        Zoho Show Resources