|  Developer
Updated on June 24, 2022

hub.scenes.block.data.list

  • Version: 0.0.1
  • Classes: UI
  • Title: Scene manager categories
  • Description: The command is a way to get multiple result sets of data related to each other. Should describe and list any type present to describe Item Value Type of Scene Value Type.
  • Terms: The command is a way to get multiple result sets of data related to each other. Should describe and list any type present to describe Item Value Type of Scene Value Type.
  • Abstract: The new hub.scenes.block.data.list command is intended to provide information that can be used to a user interface (UI) to compose scene blocks by themselves.

The previous approach to provide data for a UI was to use hub.scenes.block.list API command to obtain preformatted when blocks for any item listed in a static data source.The new approach should provide data to compose comparison operations for any kind of data represented by devices/items available on a hub.The new command will provide a number of collections to use.

They are:

  • List of value types available for the current version of the firmware. This collection will contain a list of types that can be used to compose an item of a logical device. Example of a value type: bool, int, float, string, token, array, dictionary,
  • List of value type families with a listing of value types bound to the same family. A value type family is a group of types for which the same list of comparison methods available from the scenes engine can be applied.
Edit
FieldTypeRequiredDescription
valueTypesbooleanIf true, show a list of Item Value Types supported by the current version of the firmware.
scalableValueTypesbooleanIf true, shows a list of scalable value types (value types with units) supported by the firmware.
valueScalesbooleanIf true, shows a list of value for every present value type.
scenesValueTypesbooleanIf true, show a list of Scenes value Types. They are types to represent some scene-specific data, but there is no ability to create an item of those value types.
valueTypeFamiliesbooleanIf true, shows a list of value-type families. Value types can be united to families. A family of value types can be used to indicate what common operations can be applied to all types of a family.
comparisonOperatorsbooleanIf true, shows a list of value-type family-related comparison methods.
comparisonMethodsbooleanIf true, shows a list of comparison methods present in the firmware, and shows their metadata, that indicates what kind of parameters can be passed to a particular comparison method. via as command call.
advancedScenesVersionbooleanIf true, extracts advanced_scenes feature version. The same value can be obtained via as hub.features.list command call.
Edit
Field Type Required Description
valueTypes object Contains a list of value types present in the firmware, except scalable value types. which are included. By them full set of rules is filtered
valueTypes.list array of strings + An array of value type names.
scalableValueTypes object Contains a list of scalable value types/(values with units), available for that version of the firmware.
scalableValueTypes.list array of strings + An array of scalable value type names.
valueScales object Lists available scales/units of a specific scalable value type. Indicates whether a scalable value has a converter between different , has a default .
valueScales.{scalable type name} object Information about particular scalable type
valueScales.{scalable type name}.scales array of strings + A list of for a value type
valueScales.{scalable type name}.converter boolean If true, a value has a converter between different .
valueScales.{scalable type name}.defaultScale string If a type has a default , shows its name.
scenesValueTypes object Contains a list of Scene value types present in the firmware. Examples: , .
scenesValueTypes.list array of strings + An array of value type names.
valueTypeFamilies object A list of families of value types. A single value type family can have the same list of comparison methods for any type present in the family.
valueTypeFamilies.{familyName} object + A list of value types that forms a family.
comparisonOperators object Describes comparison operators available for different value type families.
comparisonOperators.families array of family operations objects + A list of different sets of comparison methods bound to a specific value type family
comparisonMethods object Describes properties of different comparison methods.
comparisonMethods.info object Describes a version of a comparison methods metadata.
comparisonMethods.{methodName}.dataSource array of objects An array of data sources supported by the comparison method.
comparisonMethods.{methodName}.dataSource[].index int The position of a data source is a method (0 – left, 1 – right in case of two operands). One of the fields or is required.
comparisonMethods.{methodName}.dataSource[].types array of data source types + Data source types that are supported on this position or field. Possible data sources: , , , , , . Future data sources: , .
comparisonMethods.{methodName}.dataSource[].field string Optional. The field name of a parameter. One of the fields or is required.
comparisonMethods.{methodName}.comparator object Optional. description of a comparator if needed
comparisonMethods.{methodName}.comparator.type string + A type of a comparator possible values
comparisonMethods.{methodName}.comparator.options array of strings A name of a field where the comparator is expected by a comparison method
comparisonMethods.{methodName}.comparator.field string A list of comparators supported by the comparison method
advancedScenesVersion string The value of advanced_scenes feature.
Edit
Edit
				
					{
    "method": "hub.scenes.block.data.list",
    "params": {
        "valueTypes": true,
        "scalableValueTypes": true,
        "valueScales": true,
        "scenesValueTypes": true,
        "valueTypeFamilies": true,
        "comparisonOperators": true,
        "comparisonMethods": true,
        "advancedScenesVersion": true
    }
}				
			
Edit
				
					{
    "api": "1.0",
    "error": null,
    "method": "hub.scenes.block.data.list",
    "id": "<REQUEST_ID>",
    "result": {
        "valueTypes": {
            "list": [ "bool", "int", "float", "string", "token", "dictionary", "array", "rgb",  ... ]
        },
        "scalableValueTypes": {
            "list": [ "illuminance", "pressure", ... 38 more names ]
        },
        "valueScales": {
            "temperature": { "scales": [ "celsius", "fahrenheit" ], "converter": true, "defaultScale": "fahrenheit" },
                ...
            "velocity": { "scales": [ "meter_per_second", "mile_per_hour" ], "converter": false }
        },
        "scenesValueTypes": { "list": ["24_hours_interval", "interval", "hms_interval"] },
        "valueTypeFamilies": {
            "numeric": [ "int", "float", "scalableValueTypes" ],
            "strings": [ "string", "token" ],
            "valuesWithLess": [ "int", "float", "scalableValueTypes", "string" ],
            "valuesWithoutLess": [ "otherTypes??" ]
        },
        "comparisonOperators": {
            "families": [ {
                "family": "numeric",
                "methods": [
                    {"op": "<", "name": "less", "method": "compareNumbers"},
                    {"op": ">", "name": "greater", "method": "compareNumbers"},
                    {"op": "<=", "name": "less equal", "method": "compareNumbers"},
                    {"op": ">=", "name": "greater equal", "method": "compareNumbers"},
                    {"op": "==", "name": "equal", "method": "compareNumbers"},
                    {"op": "!=", "name": "not equal", "method": "compareNumbers"},
                    {"op": "between", "name": "between", "method": "compareNumberRange"},
                    {"op": "not_between", "name": "not between", "method": "compareNumberRange"}
                ]
            },
            {
                "family": "strings",
                "methods": [
                    {"op": "<", "name": "less", "method": "compareStrings"},
                    {"op": ">", "name": "greater", "method": "compareStrings"},
                    {"op": "<=", "name": "less equal", "method": "compareStrings"},
                    {"op": ">=", "name": "greater equal", "method": "compareStrings"},
                    {"op": "==", "name": "equal", "method": "compareStrings"},
                    {"op": "!=", "name": "not equal", "method": "compareStrings"},


                    {"op": "begin", "name": "begins with", "method": "stringOperation"},
                    {"op": "end", "name": "ends with", "method": "stringOperation"},
                    {"op": "contain", "name": "contains", "method": "stringOperation"},
                    {"op": "length", "name": "length equal to", "method": "stringOperation"},
                    {"op": "not_begin", "name": "doesn't begin with", "method": "stringOperation"},
                    {"op": "not_end", "name": "doesn't end with", "method": "stringOperation"},
                    {"op": "not_contain", "name": "doesn't contain", "method": "stringOperation"},
                    {"op": "not_length", "name": "length not equal to", "method": "stringOperation"}

                ]
            },
            {
                "family": "valuesWithLess",
                "methods": [
                    {"op": "<", "name": "less", "method": "compareValues"},
                    {"op": ">", "name": "greater", "method": "compareValues"},
                    {"op": "<=", "name": "less equal", "method": "compareValues"},
                    {"op": ">=", "name": "greater equal", "method": "compareValues"},
                    {"op": "==", "name": "equal", "method": "compareValues"},
                    {"op": "!=", "name": "not equal", "method": "compareValues"}
                ]
            },
            {
                "family": "valuesWithoutLess",
                "methods": [
                    {"op": "==", "name": "equal", "method": "compareValues"},
                    {"op": "!=", "name": "not equal", "method": "compareValues"}
                ]
            }
        ]
        },
        "comparisonMethods": {
            "info": { "version": "1.0.0" },
            "compareNumberRange": {
                "comparator": {
                    "family": "numeric",
                    "field": "comparator",
                    "options": [ "between", "not_between" ],
                    "type": "enum"
                },
                "dataSource": [
                    { "index": 0, "types": [ "item", "expression" ] },
                    { "index": 1, "types": [ "constant" ], "field": "startValue" },
                    { "index": 2, "types": [ "constant" ], "field": "endValue" }
                ]
            },
            "compareNumbers": {
                "comparator": {
                    "family": "numeric",
                    "field": "comparator",
                    "options": [ "<", ">", "<=", ">=", "==", "!=" ],
                    "type": "enum"
                },
                "dataSource": [
                    { "index": 0, "types": [ "item", "expression" ] },
                    { "index": 1, "types": [ "constant", "expression" ] }
                ]
            },
            "compareStrings": {
                "comparator": {
                    "family": "strings",
                    "field": "comparator",
                    "options": [ "<", ">", "<=", ">=", "==", "!=" ],
                    "type": "enum"
                },
                "dataSource": [
                    { "index": 0, "types": [ "item", "expression" ] },
                    { "index": 1, "types": [ "constant", "expression" ] }
                ]
            },
            "compareValues": {
                "comparator": {
                    "family": "valuesWithoutLess",
                    "field": "comparator",
                    "options": [ "==", "!=" ],
                    "type": "enum"
                },
                "dataSource": [
                    { "index": 0, "types": [ "item", "expression" ] },
                    { "index": 1, "types": [ "constant", "expression" ] }
                ]
            },
            "inArray": {
                "comparator": {
                    "family": "array",
                    "field": "comparator",
                    "options": [ "in", "not_in" ],
                    "type": "enum"
                },
                "dataSource": [
                    { "index": 0, "types": [ "item", "expression" ] },
                    { "index": 1, "types": [ "constant" ] }
                ]
            },
            "isItemState": {
                "dataSource": [
                    { "index": 0, "types": [ "device_item", "item" ] },
                    { "index": 1, "types": [ "constant", "expression" ] }
                ]
            },
            "isItemStateChanged": {
                "dataSource": [
                    { "index": 0, "types": [ "item", "expression" ] },
                    { "index": 1, "types": [ "constant", "expression" ], "field": "start" },
                    { "index": 2, "types": [ "constant", "expression" ], "field": "finish" }
                ]
            },
            "stringOperation": {
                "comparator": {
                    "family": "strings",
                    "field": "comparator",
                    "options": [ "begin", "end", "contain", "length", "not_begin", "not_end", "not_contain", "not_length" ],
                    "type": "enum"
                },
                "dataSource": [
                    { "index": 0, "types": [ "item", "expression" ] },
                    { "index": 1, "types": [ "constant", "expression" ] }
                ]
            }
        },
        "advancedScenesVersion": { "version": "Major.Minor" }
    }
}