iotagent-json icon indicating copy to clipboard operation
iotagent-json copied to clipboard

Implement passive attributes (AKA lazy attributes)

Open dmoranj opened this issue 9 years ago • 8 comments

This IoTA does not yet support lazy attributes but it support a very similar mechanism based on subscriptions and explicit requests from the device to retrieve information from the Context Broker. It should be easy to modify the configuration mechanism to allow lazy attributes (and consequently, commands), to be used with this IoTA.

dmoranj avatar Feb 09 '16 15:02 dmoranj

May I ask which is this very similar mechanism?

ezequiel-umu avatar Feb 10 '16 17:02 ezequiel-umu

Of course :) I was talking about what's referred in the protocol as Configuration Retrieval. That's a mechanism that lets the device ask the IoT Agent for particular pieces of information, that the IoT will read, in turn from the Context Broker (both things asynchronously, of course). This mechanism currently works with on single requests from the device, but I'm working on a feature to enable subscriptions to particular pieces of information (this functionality has already been implemented in the IoT Agent Library). Processing a notification and a relayed Context Provisioning request are quite similar tasks, and probably could be dealt with using the same functions with not so many changes.

dmoranj avatar Feb 11 '16 08:02 dmoranj

@dmoranj do you have in mind that device subscribes to the topic /{{apikey}}/{{deviceid}}/commands and listen here for the command coming from Orion, and then respond to this command via /{{apikey}}/{{deviceid}}/replies?

drasko avatar May 09 '16 23:05 drasko

Mostly yes. I will probably change the subscription topic, as I prefer to have one-way tokens to ease the creation of ACLs in the MQTT broker, but it will work that way: the client subscribes to a topic where the commands will arrive, and will reply to another topic. In fact, this functionality has been implemented for the MQTT transport of the Ultralight IoT Agent, as you can see here, so most probably we will reuse those topics.

dmoranj avatar May 10 '16 07:05 dmoranj

Hello, I have a sensor-actuator registered in orion using iot-agent and I created the subscription.

If a third party application modifies a sensor value, orion must send iot-agent information and iot-agent to the device.

For example, if I have 3 attributes inside the sensor and one of them controls a valve. In orion that attribute is true or false. If the attribute is modified in orion must be sent to IOT-agent and IOT-agent to the device to close or open the valve Is it possible?

amfgomez avatar Sep 25 '18 12:09 amfgomez

@amfgomez what you describe seems to be a question about IOTA-CB integration rather than a comment on the issue of passive attributes. I'd suggest to use StackOverflow to post such question: https://stackoverflow.com/questions/ask. Please, use the "fiware" label. Thanks!

fgalan avatar Sep 25 '18 12:09 fgalan

https://stackoverflow.com/questions/52499615/modify-attribute-on-device-by-iot-agent-json

amfgomez avatar Sep 26 '18 06:09 amfgomez

https://github.com/telefonicaid/iotagent-json/blob/master/docs/usermanual.md includes this note:

IMPORTANT NOTE: current version of the agent only supports active attributes, i.e. those attributes actively reported by the device to the agent. Passive or lazy attributes, i.e. those attributes whose value is only given upon explicit request from the agent, are not implemented. Please check the issue #89 for more details and updates regarding its implementation.

That note should be removed once this issue gets completed.

fgalan avatar Nov 21 '18 07:11 fgalan