Ir para o conteúdo principal
CloudStudio

DataPoint

The DataPoint object represents a value, typically used to represent the state of an endpoint at a given moment.

Properties

value (number) The value property represents the endpoint value as a number. See the table at the end of this section for the endpoint types to which this property applies and its meaning.

Examples

This example shows the current value of the first endpoint of a device, through the log console.

env.log('Endoint value: ', myDevice.endpoints.byIndex(0).getCurrentValue().value);

isOn (boolean) The isOn property indicates whether the endpoint is currently turned on. See the table at the end of this section for the endpoint types to which this property applies and its meaning.

Examples

This example shows the current state of the first endpoint of a device, through the log console.

env.log('Endoint state: ', myDevice.endpoints.byIndex(0).getCurrentValue().isOn);

state (number) The state property indicates the current state of the endpoint. This property applies to IAS Sensor type endpoints.

Examples

This example shows the current state of the first endpoint of a device, through the log console.

env.log('Endoint state: ', myDevice.endpoints.byIndex(0).getCurrentValue().state);

position (number) The position property indicates the current position, for Closure type endpoints.

Examples

This example shows the current position of the first endpoint of a device, through the log console.

env.log('Endoint position: ', myDevice.endpoints.byIndex(0).getCurrentValue().position);

mode (number) The mode property indicates the current mode of a Thermostat type endpoint.

Examples

This example shows the current mode of the first endpoint of a device, through the log console.

env.log('Thermostat mode: ', myDevice.endpoints.byIndex(0).getCurrentValue().mode);

fanMode (number) The fanMode property indicates the current fan mode of a Thermostat type endpoint.

Examples

This example shows the current fan mode of the first endpoint of a device, through the log console.

env.log('Fan mode: ', myDevice.endpoints.byIndex(0).getCurrentValue().fanMode);

setpoint (number) The setpoint property indicates the desired temperature for a Thermostat type endpoint.

Examples

This example shows the desired temperature of the first endpoint of a device, through the log console.

env.log('Setpoint: ', myDevice.endpoints.byIndex(0).getCurrentValue().setpoint);

ambientTemperature (number) The ambientTemperature property indicates the current ambient temperature of a Thermostat type endpoint.

Examples

This example shows the current ambient temperature of the first endpoint of a device, through the log console.

env.log('Ambient temperature: ', myDevice.endpoints.byIndex(0).getCurrentValue().ambientTemperature);

latitude (number) The latitude property indicates the latitude for a Location Tracker type endpoint.

Examples

This example shows the current coordinates of the first endpoint of a device, through the log console.

var v = myDevice.endpoints.byIndex(0).getCurrentValue();
env.log('Coordinates: ', v.latitude, ' - ', v.longitude);

longitude (number) The longitude property indicates the longitude for a Location Tracker type endpoint.

Examples

This example shows the current coordinates of the first endpoint of a device, through the log console.

var v = myDevice.endpoints.byIndex(0).getCurrentValue();
env.log('Coordinates: ', v.latitude, ' - ', v.longitude);

flags (number) The flags property indicates the special conditions of a Location Tracker type endpoint.

Examples

This example shows the flags of the first endpoint of a device, through the log console.

env.log('Flags: ', myDevice.endpoints.byIndex(0).getCurrentValue().flags);

activeEnergy (number) The activeEnergy property indicates the active energy of an Energy Meter type endpoint.

Examples

This example shows the active, reactive, and apparent energy of the first endpoint of a device, through the log console.

var v = myDevice.endpoints.byIndex(0).getCurrentValue();
env.log('Energy (active / reactive / apparent): ', v.activeEnergy, '/', v.reactiveEnergy, '/', v.apparentEnergy);

reactiveEnergy (number) The reactiveEnergy property indicates the reactive energy of an Energy Meter type endpoint.

Examples

This example shows the active, reactive, and apparent energy of the first endpoint of a device, through the log console.

var v = myDevice.endpoints.byIndex(0).getCurrentValue();
env.log('Energy (active / reactive / apparent): ', v.activeEnergy, '/', v.reactiveEnergy, '/', v.apparentEnergy);

apparentEnergy (number) The apparentEnergy property indicates the apparent energy of an Energy Meter type endpoint.

Examples

This example shows the active, reactive, and apparent energy of the first endpoint of a device, through the log console.

var v = myDevice.endpoints.byIndex(0).getCurrentValue();
env.log('Energy (active / reactive / apparent): ', v.activeEnergy, '/', v.reactiveEnergy, '/', v.apparentEnergy);

text (string) The text property indicates the text associated with a Text Container type endpoint.

Examples

This example shows the text associated with the first endpoint of a device, through the log console.

env.log('Text: ', myDevice.endpoints.byIndex(0).getCurrentValue().text);

DataPoint object properties for each endpoint type

PropertyEndpoint typeMeaning
valueNumeric endpoints (scalar, discrete, etc.)Current value
ApplianceOff: 0On: 1
DimmerOff: 0On: current level
ClosureCurrent position
IAS SensorCurrent state
isOnAppliance / Dimmer / ThermostatOff: falseOn: true
ClosureStopped: falseMoving: true
stateIAS SensorCurrent state
positionClosureCurrent position
modeThermostatCurrent mode
fanModeThermostatCurrent fan mode
setpointThermostatDesired temperature
ambientTemperatureThermostatAmbient temperature
latitudeLocation trackerLatitude
longitudeLocation trackerLongitude
flagsLocation trackerLocation flags
activeEnergyEnergy MeterActive energy
reactiveEnergyEnergy MeterReactive energy
apparentEnergyEnergy MeterApparent energy
textText containerCurrent text

Última atualização em

Nesta página

Propertiesvalue (number) The value property represents the endpoint value as a number. See the table at the end of this section for the endpoint types to which this property applies and its meaning.isOn (boolean) The isOn property indicates whether the endpoint is currently turned on. See the table at the end of this section for the endpoint types to which this property applies and its meaning.state (number) The state property indicates the current state of the endpoint. This property applies to IAS Sensor type endpoints.position (number) The position property indicates the current position, for Closure type endpoints.mode (number) The mode property indicates the current mode of a Thermostat type endpoint.fanMode (number) The fanMode property indicates the current fan mode of a Thermostat type endpoint.setpoint (number) The setpoint property indicates the desired temperature for a Thermostat type endpoint.ambientTemperature (number) The ambientTemperature property indicates the current ambient temperature of a Thermostat type endpoint.latitude (number) The latitude property indicates the latitude for a Location Tracker type endpoint.longitude (number) The longitude property indicates the longitude for a Location Tracker type endpoint.flags (number) The flags property indicates the special conditions of a Location Tracker type endpoint.activeEnergy (number) The activeEnergy property indicates the active energy of an Energy Meter type endpoint.reactiveEnergy (number) The reactiveEnergy property indicates the reactive energy of an Energy Meter type endpoint.apparentEnergy (number) The apparentEnergy property indicates the apparent energy of an Energy Meter type endpoint.text (string) The text property indicates the text associated with a Text Container type endpoint.DataPoint object properties for each endpoint type