Obtain network and connection information about an agent’s paired device
Agent
Table — Device information
This method provides an agent with information about its paired device. The information is returned as a table with the following keys:
Key | Type | Description |
---|---|---|
id | String | The device’s unique ID. This is also available using the imp.configparams property’s deviceid key |
isconnected | Boolean | true if the device is currently seen to be online, otherwise false . This is the same value returned by device.isconnected() |
ipaddress | String | The connected device’s IP address as seen by the impCloud, ie. it is the device’s, or its router’s WAN address, not its local network IP address. The address is presented in dotted quad notation, or an empty string ("" ) if the device has not connected since the agent started or restarted. The presence of an IP address does not indicate whether the device is actually connected |
You should note that the information is re-populated every time the agent detects a device connection.
The following snippet uses device.info() to determine whether a newly connected device has changed its IP address between connections.