06-24-2014, 06:16 PM
(This post was last modified: 07-29-2014, 10:50 AM by Dean Roddey.)
General Description
This thread is for discussion of the Resource Monitor device class. This is a very generalized class that can be used by any devices that report usage of some resource, power, water, etc... It can be used in the usual way, by just choosing the resources you wish to monitor, by selecting the appropriate fields. But it also will report via backdoor commands in a more generalized way that can be used by smart tools such as the CQC auto-generation system, allowing resources to be selected by name from among those available from the driver.
Fields Provided
[INDENT]Fields for this class MUST be in one of these forms:
RESMON#sub~fieldname
RESMON#fieldname
As long as the 'fieldname' portion follows the standard CQC field name conventions, that is all that is required from a field naming point of view.
The two forms are intended to deal with two different likely scenarios. If the device just offers completely configurable values that represent individual resources, then you would likely use the second form. The fields might be something like:
and so forth. Each resource monitored are just separate things that aren't necessarily related. The whole field name would be user/device defined.
On the other hand, if the device provides multiple channels where the same information is provided for each channel, then the first form SHOULD be used, and the user/device provided name would be the sub~ part, and the field name part would be the name of the specific measurements, such as:
In this case, there are two channels, which have been named Kitchen and Garage, and the device provides the same values for each channel, so the field names are just repeats of the same values, for each named channel.
Fields MUST be numeric, so Card, Int, or Float, and of course in some cases may be negative values, if the consumption is negative. They MUST be read only. If a usage counter reset capability exists, it is outside of this device class.
[/Indent]
Backdoor Commands/Queries
[INDENT]This device class defines a standard backdoor query via the QueryTextVal driver interface. The Value Id is "QueryResInfo" and the Data Name is "ResourceList", both case sensitive. The driver will return a double quoted comma list, where the first list is of short descriptions of the resources being monitors, and the second are the corresponding field for those resources. The descriptions provided by the driver should be very short and to the point, and include a name and units in parenthesis, e.g. "Refrigerator (KwH)", or "Irrigation (CuGal)" and so forth. There is no attempt to standardize the units, they are just for human consumption in selection lists.
The two lists are separated by a new line, which is a form understood by user interface list browsers. You can directly load such a list into a list browser and it will put the first list into the visible list and will store the second list into the hidden values. This allows you to make a connection between the selected item and the field that contains that information. Of course both lists must be of equal size and the xth item in both lists must represent the same resource.
[/INDENT]
Event Triggers
[INDENT]None at this time[/INDENT]
This thread is for discussion of the Resource Monitor device class. This is a very generalized class that can be used by any devices that report usage of some resource, power, water, etc... It can be used in the usual way, by just choosing the resources you wish to monitor, by selecting the appropriate fields. But it also will report via backdoor commands in a more generalized way that can be used by smart tools such as the CQC auto-generation system, allowing resources to be selected by name from among those available from the driver.
Fields Provided
[INDENT]Fields for this class MUST be in one of these forms:
RESMON#sub~fieldname
RESMON#fieldname
As long as the 'fieldname' portion follows the standard CQC field name conventions, that is all that is required from a field naming point of view.
The two forms are intended to deal with two different likely scenarios. If the device just offers completely configurable values that represent individual resources, then you would likely use the second form. The fields might be something like:
Code:
RESMON#RefrigWatts
RESMON#Sub1_TotalWatts
and so forth. Each resource monitored are just separate things that aren't necessarily related. The whole field name would be user/device defined.
On the other hand, if the device provides multiple channels where the same information is provided for each channel, then the first form SHOULD be used, and the user/device provided name would be the sub~ part, and the field name part would be the name of the specific measurements, such as:
Code:
RESMON#Kitchen~TotalWatts
RESMON#Kitchen~WattSeconds
RESMON#Garage~TotalWatts
RESMON#Garage~WattSeconds
In this case, there are two channels, which have been named Kitchen and Garage, and the device provides the same values for each channel, so the field names are just repeats of the same values, for each named channel.
Fields MUST be numeric, so Card, Int, or Float, and of course in some cases may be negative values, if the consumption is negative. They MUST be read only. If a usage counter reset capability exists, it is outside of this device class.
[/Indent]
Backdoor Commands/Queries
[INDENT]This device class defines a standard backdoor query via the QueryTextVal driver interface. The Value Id is "QueryResInfo" and the Data Name is "ResourceList", both case sensitive. The driver will return a double quoted comma list, where the first list is of short descriptions of the resources being monitors, and the second are the corresponding field for those resources. The descriptions provided by the driver should be very short and to the point, and include a name and units in parenthesis, e.g. "Refrigerator (KwH)", or "Irrigation (CuGal)" and so forth. There is no attempt to standardize the units, they are just for human consumption in selection lists.
The two lists are separated by a new line, which is a form understood by user interface list browsers. You can directly load such a list into a list browser and it will put the first list into the visible list and will store the second list into the hidden values. This allows you to make a connection between the selected item and the field that contains that information. Of course both lists must be of equal size and the xth item in both lists must represent the same resource.
[/INDENT]
Event Triggers
[INDENT]None at this time[/INDENT]
Dean Roddey
Explorans limites defectum
Explorans limites defectum