Understanding Model and Instance

Understanding Model and Instance

A model is like a container that can be configured with different templates (datapoints, commands, alarm rules, and fields). Using this model, you can create multiple instances (devices, assets, and locations) with the same setup.

Each managed entity needs its own model to create an instance of it. That is, a Device model is needed to create a device instance, an Asset model to create an asset instance, and a Location model to create a location instance.
The model is created in the Developer Application, and the instances are created in the End Application.



For example, if you want to add 10 energy meters in a smart buildings application, you can create a device model called Energy Meter in the developer application and configure it with datapoints like current, power, etc. Based on this device model, you can create 10 energy meter instances in the end application.


Model - Instance Relationship

The Model-Instance relationship is a standout feature in Zoho IOT applications as it allows you to scale easily. The relationship between a model and its instances is single-way synchronous.

The characteristics of the Model-Instance relationship are listed below:
  • Changes made to the model will be reflected in all the instances created based on it.
  • Changes made to a particular instance will remain unique to that particular instance.
  • Changes to the model will overrule the unique changes made to a particular instance.
To understand this, let us first consider a model (can be a location, asset, or device) configured as shown below.

Model Name

Alpha

Datapoint Template

Temperature, Humidity

Alarm Rule Template

Temperature High, Temperature Low

Command Template

ON/ OFF, Adjust temperature


Note: This model-instance approach is also applicable for Assets, and Locations  
Based on this model, three new instances: Instance A, Instance B, and Instance C are created. These three instances will have the same Datapoints, Alarm Rules, and Commands configured as templated in the model.



 Adding/Removing Template in a Model .

Adding a datapoint template, alarm rule template or command template to a device model will include the corresponding datapoint, alarm rule or command to all the instances derived based on the model.

If a third datapoint template: Pressure in added to Model Alpha. A new pressure datapoint will be in all the three instances derived from it.



Removing a datapoint template, alarm rule template or command template from a device model will remove the corresponding datapoint, alarm rule, or command from all the devices derived based on the device model.

If the Temperature Low Alarm Rule Template is removed from model Alpha, the Temperature Low Alarm Rule will be removed from all three instances.


Adding/Removing/Disabling a Datapoint, Command, (or) Alarm Rule in a n instance

Adding a datapoint, alarm rule or command to an instance will be reflected only in that specific instance and will not affect the model, or instances based on the model.

For example, if you add a datapoint Air Quality to instance B, then the Air Quality datapoint is added only to that particular instance. As a result, Instance B will have three datapoints: Temperature, Humidity, Pressure and Air Quality. While, the remaining two instances: Instance A, and Instance C, will have only three datapoints: Temperature, Pressure, and Humidity.



Note: Adding an instance specific datapoint, command, or alarm rule is disabled by default in the application. You can enable them on the model settings page. Learn more about how to enable instance specific datapoints, commands, overview dashboards, and command.
Removing a datapoint, alarm rule or command from a instance is only possible if they were added at the instance level.

For example, in Instance B only the datapoint Air Quality can be removed directly from the instance. While it will not be possible to remove other datapoints, commands, and alarm rules only for a specific instance.



Datapoints, commands, and alarm rules for specific instances can be disabled, effectively restricting them from performing their intended functions.

If the Pressure datapoint in Instance A and Humidity datapoint in Instance C are disabled. Pressure data for Instance A and Humidity data for Instance C will not be parsed and stored for the period they are disabled.



Disabling Datapoint Templates, Command Templates, and Alarm Rule Templates in the model will disable the corresponding datapoints, commands, and alarm rules in all the instances based on the model.

If the Datapoint Template Humidity, and Command Template ON/OFF are disabled in model, then datapoint Humidity, and command ON/OFF will be disabled for all instances.



Editing Template Values  

Editing a specific value of a datapoint template, command template, or alarm rule template in the device model will update the same parameter in the datapoint, command, or alarm rule in the instance level.

Consider the command template: Adjust Temperature, in model Alpha, created with the set of parameters as listed below:

Name 
Adjust Temperature
Input Type 
Slider
Slider Numeric Data Type 
Numerical
Slider Min. Number 
16
Slider Max. Numbe
32
Increment/Decrement Steps 
1
Kind 
Temperature
Datapoint Unit 
Celsius
Command Key 
set_temp
Status 
On

The Adjust Temperature command in the three instances: Instance A, Instance  B, and Instance C will have the same set of parameters.



Now, after the instances are created, the following changes are made to the Adjust Temperature command template.

Slider Min. Number
18
Slider Max. Number
28
Increment steps
2

These values will now be updated for the Adjust Temperature command in all the three instances.



Note: The parameters allowed to be modified after a template is created are limited for and is different for datapoint templates, command templates, and alarm rule templates.

Editing a specific value of a datapoint , command, or alarm rule in a specific instance will affect only that instance.

For example, if the command key for Adjust Temperature is changed to assign_temp in Instance B. Only the command key for Instance B will be updated, while for Instance A, Instance C, and Model Alpha, the value will remain unchanged.



Note: Only parsing key for datapoints, command key for commands, and scheduled time for alarm rules can be edited at the instance level.
 
See Also
  1. Understanding Devices
  2. Understanding Assets
  3. Understanding Locations
 


    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











                                        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

                                              Zoho Desk Resources

                                              • Desk Community Learning Series


                                              • Digest


                                              • Functions


                                              • Meetups


                                              • Kbase


                                              • Resources


                                              • Glossary


                                              • Desk Marketplace


                                              • MVP Corner


                                              • Word of the Day


                                                Zoho Marketing Automation

                                                  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 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

                                                                                                          • Understanding Assets

                                                                                                            In Zoho IOT applications, any physical object that is being managed by a sensor or device can be added virtually as an asset. Adding them as assets simplifies monitoring and ensures efficient management of the connected resources. Resources such as ...
                                                                                                          • Understanding Commands

                                                                                                            Zoho IOT applications enable users to execute actions on connected devices, and assets/locations using commands. These commands send instructions to the devices. For example, take an air conditioning (AC) unit in a smart home system. By using a ...
                                                                                                          • Model Templates and Instance Specific

                                                                                                            Monitor and control modules include datapoints, alarm rules, overview dashboards, and commands. Model Templates Monitor and control modules are configured as templates in the managed entity models: device, asset, and location. When a managed entity ...
                                                                                                          • Understanding Locations

                                                                                                            Introduction to Location In Zoho IOT, a location represents a physical place with multiple devices and assets located under it. Each location can function as either a parent location having one or more child locations, and a child location can ...
                                                                                                          • Understanding Widgets

                                                                                                            Widgets are the building blocks of a dashboard. They display vital statistics in intuitive formats. In Zoho IOT Application, you can create widgets of type cards, charts, dials, image, tables, calendars, commands, maps, timeline, and image layout. ...
                                                                                                            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