Skip to content

Question: Define an HTTP Protocol to Support Lazy Attributes. #574

Open
@jason-fox

Description

@jason-fox

Currently when I provision a device like this using the Ultralight or JSON IoT Agent:

{
     "endpoint": "http://iot-sensors/iot/lamp001",
...      
     "commands": [ 
        {"name": "on","type": "command"},
        {"name": "off","type": "command"}
     ],
     "lazy": [
        {"object_id": "b", "name": "batteryLevel", "type":"Number",
          "metadata": {"unitCode": {"type": "Text","value": "C62"}}
        }
     ],
     "attributes": [
        {"object_id": "s", "name": "state", "type":"Text"},
        {"object_id": "l", "name": "luminosity", "type":"Integer",
          "metadata": {"unitCode": {"type": "Text","value": "CDL"}}
        }
     ]
   }

I can successfully send HTTP Commands to my device using the endpoint http://iot-sensors/iot/lamp001, however retrieving the entity the lazy attribute is always blank (yes, I know #23 is still open). If I had provisioned the same device using the OPC-UA IoT Agent, it would make an OPC request for the lazy attribute to the OPC-UA server.

Is there any good reason why at least the HTTP Binding couldn't have a queryHandler (similar to the existing commandHandler) to make a GET request on <endpoint>/<lazy-attribute> ?

So in this case a GET http://orion:1026/v2/entities/Lamp:001?attrs=batteryLevel
should result in a GET http://iot-sensors/iot/lamp001/b (where b is the object_id for `batteryLevel). correct?

It doesn't make sense to add an equivalent for MQTT or AMPQ because message queues are not synchronous.

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions