/Things/Concentrator/ReadStandaloneDevice (extension)
Reads a standalone sensor device on the network, and returns the result.
Use the following asynchronous method in the Javascript Library, to call this resource.
var Response = await AgentAPI.Things.Sensor.ReadStandaloneDevice(JID,Language,Momentary,Peak,Status,Computed,Identity,History,Fields,From,To,When,[,DeviceToken[,ServiceToken[,UserToken]]]);
Note: This method will call the AgentAPI.Xmpp.RegisterEventHandler method to ensure the client receives events as soon as the response is returned. This requires the inclusion of the /Events.js javascript file on the page. See the RegisterEventHandler resource for more information.
Input Arguments
| Parameter | Description |
|---|---|
JID |
JID of the concentrator. If a Bare JID, the function will attempt to get the Full JID before performing the query. |
Language |
The ISO Language code to use when returning localized strings. |
Momentary |
If momentary values are to be read. |
Peak |
If peak values are to be read. |
Status |
If status values are to be read. |
Computed |
If computed values are to be read. |
Identity |
If identity values are to be read. |
History |
If historical values are to be read. |
Fields |
Optional array of field names to read. |
From |
Optional start timestamp from which to read. |
To |
Optional end timestamp to which to read. |
When |
Optional timestamp to start a scheduled readout. |
DeviceToken |
Optional device token(s) (delimited by space characters), identifying the device(s) where a distributed transaction originated. |
ServiceToken |
Optional service token(s) (delimited by space characters), identifying the service(s) where a distributed transaction originated. |
UserToken |
Optional user token(s) (delimited by space characters), identifying the user(s) where a distributed transaction originated. |
Note: To send an information query to a connected device, you need its Full JID. If you provide a Bare JID, the library call will attempt to get the Full JID for you. To avoid such call each time you need to make such a call, you can get the Full JID yourself, by calling await AgentAPI.Things.XmppHelper.GetFullJid(JID). To be able to get the Full JID, you need to have an approved presence subscription to the device’s Bare JID. To send a presence subscription call AgentAPI.Xmpp.SendPresenceSubscription.
Response
The response will contain the information the client has access to, about the node.