Endpoint
The endpoint object represents an endpoint within a device installed in the platform. Endpoints are normally accessed through the Endpoints Eigenschaft von Gerät Objekt.
Eigenschaften
address (string) The address property represents the address of the endpoint, as text.
Beispiele
Dieses Beispiel zeigt die Adresse des ersten Endpoints eines Geräts über die Log-Konsole.
env.log('Endoint address: ', myDevice.endpoints.byIndex(0).address);description (string) The description property represents the description of the endpoint.
Beispiele
This example shows the description of the first endpoint of a device, through the log console.
env.log('Endoint description: ', myDevice.endpoints.byIndex(0).description);endpointType (int enum)
The endpointType property indicates the endpoint type. The possible values for this property are as follows:
- endpointType.appliance (1): the endpoint is of on/off type, meaning it can be turned on and off, such as a lamp without brightness control, a valve, a water pump, etc.
- endpointType.dimmer (2): the endpoint can be turned on and off, but its brightness can also be controlled.
- endpointType.lightSensor (4): the endpoint is a light sensor.
- endpointType.colorDimmer (7): the endpoint is capable of controlling chromatic light (RGB or similar).
- endpointType.closureController (10): the endpoint is a valve, curtain, or closure controller that can be opened, closed, and positioned.
- endpointType.curtainController (10): equivalent to endpointType.closureController. This value exists for backward compatibility.
- endpointType.thermostat (12): the endpoint is a thermostat.
- endpointType.camera (13): the endpoint is a camera.
- endpointType.temperatureSensor (14): the endpoint is a temperature sensor.
- endpointType.energyMeter (17): the endpoint is an energy meter.
- endpointType.doorLock (19): the endpoint is an electronic lock.
- endpointType.iasSensor (20): the endpoint is an intrusion, presence, motion, or any other security sensor that has a discrete number of states.
- endpointType.locationTracker (22): the endpoint is a position tracker (GPS).
- endpointType.humiditySensor (23): the endpoint is a humidity sensor.
- endpointType.volumeSensor (24): the endpoint is a volume sensor.
- endpointType.weightSensor (25): the endpoint is a weight sensor.
- endpointType.pressureSensor (26): the endpoint is a pressure sensor.
- endpointType.flowSensor (27): the endpoint is a flow sensor for liquids or gases, meaning the flow unit is a volume.
- endpointType.genericSensor (28): the endpoint is a generic scalar sensor, for which units can be chosen arbitrarily.
- endpointType.genericFlowSensor (29): the endpoint is a generic flow sensor of some other type, for which units can be chosen arbitrarily.
- endpointType.voltageSensor (30): the endpoint is a voltage sensor (voltmeter).
- endpointType.currentSensor (31): the endpoint is a current sensor (ammeter).
- endpointType.activePowerSensor (32): the endpoint is an active power sensor.
- endpointType.reactivePowerSensor (33): the endpoint is a reactive power sensor.
- endpointType.apparentPowerSensor (34): the endpoint is an apparent power sensor.
- endpointType.cosPhiSensor (35): the endpoint is a power factor sensor.
- endpointType.frequencyMeter (36): the endpoint is a frequency sensor (frequency meter).
- endpointType.runTimeMeter (37): the endpoint is a usage time meter (hour meter / run time meter).
- endpointType.ppmConcentrationSensor (38): the endpoint is a concentration sensor, expressed in parts per million (ppm).
- endpointType.mvConcentrationSensor (39): the endpoint is a concentration sensor, expressed in mass per volume units.
- endpointType.airQualityIndexSensor: the endpoint is an air quality sensor (AQI).
- endpointType.peopleFlowSensor (41): the endpoint is a people flow sensor, meaning it can detect the entry and/or exit of people.
- endpointType.peopleCounter (42): the endpoint is a people count sensor, meaning it can detect how many people are present in a given area.
- endpointType.textContainer (43): the endpoint is a text sensor, meaning it can store any text up to 255 characters in length.
Beispiele
This example shows the endpoint type of the first endpoint of a device, through the log console.
env.log('Endoint type: ', myDevice.endpoints.byIndex(0).endpointType);endpointSubType (int enum)
The endpointSubType property indicates the endpoint subtype. The subtype can only be specified for certain endpoint types, as indicated below. The possible values for this property are as follows:
Für Endpoints vom Typ endpointType.appliance:
- applianceEndpointSubType.lamp (1): indicates that the endpoint is a lamp.
- applianceEndpointSubType.valve (2): indicates that the endpoint is a valve.
- applianceEndpointSubType.socket (3): indicates that the endpoint is a socket or plug-in switch.
- applianceEndpointSubType.pump (4): indicates that the endpoint is a water or other liquid pump.
- applianceEndpointSubType.sprinkler (5): indicates that the endpoint is a sprinkler or irrigation circuit.
- applianceEndpointSubType.fan (6): indicates that the endpoint is a fan.
Für Endpoints vom Typ endpointType.iasSensor:
- iasEndpointSubType.motionSensor (1): indicates that the endpoint is a motion sensor.
- iasEndpointSubType.doorSensor (2): indicates that the endpoint is a door or window sensor.
- iasEndpointSubType.floodSensor (3): indicates that the endpoint is a flood detector.
- iasEndpointSubType.presenceSensor (4): indicates that the endpoint is a presence sensor.
- iasEndpointSubType.alarmInput (5): indicates that the endpoint is an alarm sensor.
- iasEndpointSubType.coSensor (6): gibt an, dass der Endpoint ein Kohlenmonoxid-Sensor ist.
- iasEndpointSubType.co2Sensor (7): gibt an, dass der Endpoint ein Kohlendioxid-Sensor ist.
- iasEndpointSubType.gasSensor (8): indicates that the endpoint is a sensor for other types of gases.
- iasEndpointSubType.smokeDetector (9): indicates that the endpoint is a smoke sensor.
- iasEndpointSubType.parkingSensor (10): indicates that the endpoint is a vehicular parking sensor.
Für Endpoints vom Typ endpointType.ppmConcentrationSensor:
- ppmConcentrationSensorSubType.ammonia (1): indicates that the endpoint is an ammonia sensor.
- ppmConcentrationSensorSubType.Ozone (2): indicates that the endpoint is an ozone sensor.
- ppmConcentrationSensorSubType.nitricOxide (3): indicates that the endpoint is a nitric oxide sensor.
- ppmConcentrationSensorSubType.nitrogenDioxide (4): indicates that the endpoint is a nitrogen dioxide sensor.
- ppmConcentrationSensorSubType.sulfurDioxide (5): indicates that the endpoint is a sulfur dioxide sensor.
- ppmConcentrationSensorSubType.carbonMonoxide (6): gibt an, dass der Endpoint ein Kohlenmonoxid-Sensor ist.
- ppmConcentrationSensorSubType.carbonDioxide (7): gibt an, dass der Endpoint ein Kohlendioxid-Sensor ist.
- ppmConcentrationSensorSubType.voc (8): indicates that the endpoint is a volatile organic compounds sensor.
Für Endpoints vom Typ endpointType.mvConcentrationSensor:
- mvConcentrationSensorSubType.lead (1): indicates that the endpoint is a lead sensor.
- mvConcentrationSensorSubType.pm2_5 (2): indicates that the endpoint detects particulate matter up to 2.5 microns.
- mvConcentrationSensorSubType.pm10 (3): indicates that the endpoint detects particulate matter up to 10 microns.
Beispiele
This example shows the endpoint subtype of the first endpoint of a device, through the log console.
env.log('Endoint subtype: ', myDevice.endpoints.byIndex(0).endpointSubType);accessType (int enum)
The accessType property indicates the type of access applied to the endpoint. The possible values for this property are as follows:
- endpointAccessType.readOnly (1): indicates that the value associated with the endpoint cannot be modified manually.
- endpointAccessType.readWrite (2): indicates that the value associated with the endpoint can be modified manually. When doing so, the new value will be recorded immediately, without interacting with the device.
- endpointAccessType.readWriteCommand (3): indicates that the value associated with the endpoint can be modified manually. When doing so, a command will be sent to the device to change the value. It is the device's responsibility to report the new value upon accepting the command.
Beispiele
This example shows the accessType property value of the first endpoint of a device, through the log console.
env.log('Endoint access type: ', myDevice.endpoints.byIndex(0).accessType);operationSecurityLevel (int enum)
The operationSecurityLevel property indicates the security level associated with the endpoint operation. The possible values for this property are as follows:
- endpointOperationSecurityLevel.simple (1): indicates that the endpoint can be operated directly. No warning message or user confirmation is required. In user interfaces, when operating the endpoint, the corresponding command is sent immediately.
- endpointOperationSecurityLevel.medium (2): indicates that to operate the endpoint, a confirmation message must first be displayed, along with the corresponding options to accept or cancel the operation. The message is configurable at the individual endpoint level, but is optional. If no message is specified, a default confirmation message will be used.
- endpointOperationSecurityLevel.high (3): indicates that to operate the endpoint, the confirmation corresponding to the mittel security level is required, but additionally the user is asked to re-enter their password.
Beispiele
This example shows the operationSecurityLevel property value of the first endpoint of a device, through the log console.
env.log('Endoint access type: ', myDevice.endpoints.byIndex(0).operationSecurityLevel);tags (array) The tags property indicates the set of tags applied to the endpoint. This property is an array of strings, each of which indicates a tag.
Beispiele
This example shows the list of tags of the first endpoint of a device.
myDevice.endpoints.byIndex(0).tags.forEach(item => env.log(item));Methoden
getCurrentState() The getCurrentState() method allows obtaining the current state of the endpoint.
Parameter
This method has no parameters.
Ergebnis
The value returned by the method is a DataPoint object that represents the current state of the endpoint. If the current state of the endpoint has not yet been established, the returned value is null.
Beispiel 1
This example shows the current temperature at an endpoint.
env.log(myDevice.endpoints.byIndex(0).getCurrentState().value);updateTemperatureSensorStatus(temperature [, utcDateTime]) The updateTemperatureSensorStatus() method allows updating the value of a temperature sensor, optionally specifying the date and time of the update.
Parameter
- temperature (double): Dieser Parameter gibt die gemessene Temperatur in Grad Celsius an.
- utcDateTime (Datum, optional): Dieser Parameter gibt das UTC-Datum und die UTC-Uhrzeit der Probe an. Wird der Parameter ausgelassen, wird das aktuelle Datum und die aktuelle Uhrzeit verwendet.
Beispiel 1
This example shows how to report a temperature of 32 degrees Celsius on the first endpoint of a device.
myDevice.endpoints.byIndex(0).updateTemperatureSensorStatus(32);updateHumiditySensorStatus(humidity [, utcDateTime]) The updateHumiditySensorStatus() method allows updating the value of a humidity sensor, optionally specifying the date and time of the update.
Parameter
- humidity (double): Dieser Parameter gibt die gemessene Feuchtigkeit als Prozentsatz an.
- utcDateTime (Datum, optional): Dieser Parameter gibt das UTC-Datum und die UTC-Uhrzeit der Probe an. Wird der Parameter ausgelassen, wird das aktuelle Datum und die aktuelle Uhrzeit verwendet.
Beispiel 1
This example shows how to report a humidity of 47% on the first endpoint of a device.
myDevice.endpoints.byIndex(0).updateHumiditySensorStatus(47);updateLightSensorStatus(lightIntensity [, utcDateTime]) The updateLightSensorStatus() method allows updating the value of a light sensor, optionally specifying the date and time of the update.
Parameter
- lightIntensity (double): Dieser Parameter gibt die gemessene Lichtintensität in Lux an.
- utcDateTime (Datum, optional): Dieser Parameter gibt das UTC-Datum und die UTC-Uhrzeit der Probe an. Wird der Parameter ausgelassen, wird das aktuelle Datum und die aktuelle Uhrzeit verwendet.
Beispiel 1
This example shows how to report a light intensity of 7550 lux on the first endpoint of a device.
myDevice.endpoints.byIndex(0).updateLightSensorStatus(7550);updateWeightSensorStatus(weightGrams [, utcDateTime]) The updateWeightSensorStatus() method allows updating the value of a weight sensor, optionally specifying the date and time of the update.
Parameter
- weightGrams (double): Dieser Parameter gibt das gemessene Gewicht in Gramm an.
- utcDateTime (Datum, optional): Dieser Parameter gibt das UTC-Datum und die UTC-Uhrzeit der Probe an. Wird der Parameter ausgelassen, wird das aktuelle Datum und die aktuelle Uhrzeit verwendet.
Beispiel 1
This example shows how to report a weight of 72.5 kg on the first endpoint of a device.
myDevice.endpoints.byIndex(0).updateWeightSensorStatus(72500);updateVolumeSensorStatus(volumeLiters [, utcDateTime]) The updateVolumeSensorStatus() method allows updating the value of a volume sensor, optionally specifying the date and time of the update.
Parameter
- volumeLiters (double): Dieser Parameter gibt das gemessene Volumen in Litern an.
- utcDateTime (Datum, optional): Dieser Parameter gibt das UTC-Datum und die UTC-Uhrzeit der Probe an. Wird der Parameter ausgelassen, wird das aktuelle Datum und die aktuelle Uhrzeit verwendet.
Beispiel 1
This example shows how to report a volume of 15,000 liters on the first endpoint of a device.
myDevice.endpoints.byIndex(0).updateVolumeSensorStatus(15000);updatePressureSensorStatus(pressurePascals [, utcDateTime]) The updatePressureSensorStatus() method allows updating the value of a pressure sensor, optionally specifying the date and time of the update.
Parameter
- pressurePascals (double): Dieser Parameter gibt den gemessenen Druck in Pascal an.
- utcDateTime (Datum, optional): Dieser Parameter gibt das UTC-Datum und die UTC-Uhrzeit der Probe an. Wird der Parameter ausgelassen, wird das aktuelle Datum und die aktuelle Uhrzeit verwendet.
Beispiel 1
This example shows how to report a pressure of 1013 hectopascals (101300 pascals) on the first endpoint of a device.
myDevice.endpoints.byIndex(0).updatePressureSensorStatus(101300);updateIASSensorStatus(state [, utcDateTime]) The updateIASSensorStatus() method allows updating the state of an IAS sensor, optionally specifying the date and time of the update.
Parameter
- state (int): Dieser Parameter gibt den Sensorzustand an, einer der folgenden:
- iasSensorState.Unknown (0): Unknown. The sensor state is not known.
- iasSensorState.idle (1): Idle. The sensor registers no activity.
- iasSensorState.active (2): Active. The sensor registers activity.
- iasSensorState.cleaning (3): Cleaning. The space associated with the sensor is being cleaned.
- iasSensorState.cleaningNeeded (4): Cleaning needed. The space associated with the sensor needs cleaning.
- iasSensorState.testMode (5): Test mode. The sensor is currently in test mode.
- iasSensorState.tampered (6): The sensor has been tampered with and may not be functioning correctly.
- iasSensorState.maintenanceNeeded (7): The sensor requires maintenance and may not be functioning correctly.
- iasSensorState.entering (8): The sensor detects that a vehicle is entering the parking space.
- iasSensorState.leaving(9): The sensor detects that a vehicle is leaving the parking space.
- iasSensorState.violation(10): The sensor reports that the parking space is in violation.
- utcDateTime (Datum, optional): Dieser Parameter gibt das UTC-Datum und die UTC-Uhrzeit der Probe an. Wird der Parameter ausgelassen, wird das aktuelle Datum und die aktuelle Uhrzeit verwendet.
Beispiel 1
This example shows how to report the idle state on the first endpoint of a device.
myDevice.endpoints.byIndex(0).updateIASSensorStatus(1);updateVoltageSensorStatus(voltageVolts [, utcDateTime]) The updateVoltageSensorStatus() method allows updating the state of a voltage sensor, optionally specifying the date and time of the update.
Parameter
- voltageVolts (double): Dieser Parameter gibt die gemessene Spannung in Volt an.
- utcDateTime (Datum, optional): Dieser Parameter gibt das UTC-Datum und die UTC-Uhrzeit der Probe an. Wird der Parameter ausgelassen, wird das aktuelle Datum und die aktuelle Uhrzeit verwendet.
Beispiel 1
This example shows how to report a measurement of 235V on the first endpoint of a device.
myDevice.endpoints.byIndex(0).updateVoltageSensorStatus(235);updateCurrentSensorStatus(currentAmps [, utcDateTime]) The updateCurrentSensorStatus() method allows updating the state of a current sensor, optionally specifying the date and time of the update.
Parameter
- currentAmps (double): Dieser Parameter gibt den gemessenen Strom in Ampere an.
- utcDateTime (Datum, optional): Dieser Parameter gibt das UTC-Datum und die UTC-Uhrzeit der Probe an. Wird der Parameter ausgelassen, wird das aktuelle Datum und die aktuelle Uhrzeit verwendet.
Beispiel 1
This example shows how to report a measurement of 19.5A on the first endpoint of a device.
myDevice.endpoints.byIndex(0).updateCurrentSensorStatus(19.5);updateActivePowerSensorStatus(activePowerWatts [, utcDateTime]) The updateActivePowerSensorStatus() method allows updating the state of an active power sensor, optionally specifying the date and time of the update.
Parameter
- activePowerWatts (double): Dieser Parameter gibt die gemessene Wirkleistung in Watt an.
- utcDateTime (Datum, optional): Dieser Parameter gibt das UTC-Datum und die UTC-Uhrzeit der Probe an. Wird der Parameter ausgelassen, wird das aktuelle Datum und die aktuelle Uhrzeit verwendet.
Beispiel 1
This example shows how to report a measurement of 1250W on the first endpoint of a device.
myDevice.endpoints.byIndex(0).updateActivePowerSensorStatus(1250);updateReactivePowerSensorStatus(reactivePowerVAR [, utcDateTime]) The updateReactivePowerSensorStatus() method allows updating the state of a reactive power sensor, optionally specifying the date and time of the update.
Parameter
- reactivePowerVAR (double): Dieser Parameter gibt die gemessene Blindleistung in Volt-Ampere-Reactive (VAR) an.
- utcDateTime (Datum, optional): Dieser Parameter gibt das UTC-Datum und die UTC-Uhrzeit der Probe an. Wird der Parameter ausgelassen, wird das aktuelle Datum und die aktuelle Uhrzeit verwendet.
Beispiel 1
This example shows how to report a measurement of 750VAR on the first endpoint of a device.
myDevice.endpoints.byIndex(0).updateReactivePowerSensorStatus(750);updateApparentPowerSensorStatus(apparentPowerVA [, utcDateTime]) The updateApparentPowerSensorStatus() method allows updating the state of an apparent power sensor, optionally specifying the date and time of the update.
Parameter
- apparentPowerVA (double): Dieser Parameter gibt die gemessene Scheinleistung in Voltampere (VA) an.
- utcDateTime (Datum, optional): Dieser Parameter gibt das UTC-Datum und die UTC-Uhrzeit der Probe an. Wird der Parameter ausgelassen, wird das aktuelle Datum und die aktuelle Uhrzeit verwendet.
Beispiel 1
This example shows how to report a measurement of 1300VA on the first endpoint of a device.
myDevice.endpoints.byIndex(0).updateApparentPowerSensorStatus(1300);updateCosPhiSensorStatus(cosPhi [, utcDateTime]) The updateCosPhiSensorStatus() method allows updating the state of a cosine phi (power factor) sensor, optionally specifying the date and time of the update.
Parameter
- cosPhi (double): Dieser Parameter gibt den gemessenen Cosinus Phi an.
- utcDateTime (Datum, optional): Dieser Parameter gibt das UTC-Datum und die UTC-Uhrzeit der Probe an. Wird der Parameter ausgelassen, wird das aktuelle Datum und die aktuelle Uhrzeit verwendet.
Beispiel 1
This example shows how to report a cosine phi measurement of 0.98 on the first endpoint of a device.
myDevice.endpoints.byIndex(0).updateCosPhiSensorStatus(0.98);updateFrequencySensorStatus(frequencyHz [, utcDateTime]) The updateFrequencySensorStatus() method allows updating the state of a frequency sensor (frequency meter), optionally specifying the date and time of the update.
Parameter
- frequencyHz (double): Dieser Parameter gibt die gemessene Frequenz in Hz an.
- utcDateTime (Datum, optional): Dieser Parameter gibt das UTC-Datum und die UTC-Uhrzeit der Probe an. Wird der Parameter ausgelassen, wird das aktuelle Datum und die aktuelle Uhrzeit verwendet.
Beispiel 1
This example shows how to report a frequency measurement of 60Hz on the first endpoint of a device.
myDevice.endpoints.byIndex(0).updateFrequencySensorStatus(60);updateGenericSensorStatus(value [, utcDateTime]) The updateGenericSensorStatus() method allows updating the state of a generic scalar sensor, optionally specifying the date and time of the update.
Parameter
- Wert (double): Dieser Parameter gibt den gemessenen Wert in den für den Endpoint ausgewählten Einheiten an.
- utcDateTime (Datum, optional): Dieser Parameter gibt das UTC-Datum und die UTC-Uhrzeit der Probe an. Wird der Parameter ausgelassen, wird das aktuelle Datum und die aktuelle Uhrzeit verwendet.
Beispiel 1
This example shows how to report a measurement of value 1234 on the first endpoint of a device.
myDevice.endpoints.byIndex(0).updateGenericSensorStatus(1234);updatePpmConcentrationSensorStatus(value [, utcDateTime]) The updatePpmConcentrationSensorStatus() method allows updating the state of a concentration measurement sensor, optionally specifying the date and time of the update. This function is only valid for concentration sensors expressed as parts per million (ppm).
Parameter
- Wert (double): Dieser Parameter gibt den gemessenen Wert in Teilen pro Million (ppm) an.
- utcDateTime (Datum, optional): Dieser Parameter gibt das UTC-Datum und die UTC-Uhrzeit der Probe an. Wird der Parameter ausgelassen, wird das aktuelle Datum und die aktuelle Uhrzeit verwendet.
Beispiel 1
This example shows how to report a measurement of value 1234 ppm on the first endpoint of a device.
myDevice.endpoints.byIndex(0).updatePpmConcentrationSensorStatus(1234);updateMvConcentrationSensorStatus(value [, utcDateTime]) The updateMvConcentrationSensorStatus() method allows updating the state of a concentration measurement sensor, optionally specifying the date and time of the update. This function is only valid for concentration sensors expressed as mass per volume ratio (m/v).
Parameter
- Wert (double): Dieser Parameter gibt den gemessenen Wert in Mikrogramm pro Kubikmeter (µg/m³) an.
- utcDateTime (Datum, optional): Dieser Parameter gibt das UTC-Datum und die UTC-Uhrzeit der Probe an. Wird der Parameter ausgelassen, wird das aktuelle Datum und die aktuelle Uhrzeit verwendet.
Beispiel 1
This example shows how to report a measurement of value 1234 ug/m3 on the first endpoint of a device.
myDevice.endpoints.byIndex(0).updateMvConcentrationSensorStatus(1234);updateAqiSensorStatus(value [, utcDateTime]) The updateAqiSensorStatus() method allows updating the state of an air quality sensor, optionally specifying the date and time of the update.
Parameter
- Wert (double): Dieser Parameter gibt den gemessenen Wert an gemäß der AQI scale (0-500).
- utcDateTime (Datum, optional): Dieser Parameter gibt das UTC-Datum und die UTC-Uhrzeit der Probe an. Wird der Parameter ausgelassen, wird das aktuelle Datum und die aktuelle Uhrzeit verwendet.
Beispiel 1
This example shows how to report a measurement of value 123 on the first endpoint of a device.
myDevice.endpoints.byIndex(0).updateAqiSensorStatus(123);updateApplianceStatus(turnedOn[, utcDateTime]) The updateApplianceStatus() method allows updating the state of an on-off type endpoint (appliance), optionally specifying the date and time of the update.
Parameter
- turnedOn (boolean): Dieser Parameter gibt an, ob der Endpoint eingeschaltet (true) oder ausgeschaltet (false) ist.
- utcDateTime (Datum, optional): Dieser Parameter gibt das UTC-Datum und die UTC-Uhrzeit der Aktualisierung an. Wird der Parameter ausgelassen, wird das aktuelle Datum und die aktuelle Uhrzeit verwendet.
Beispiel 1
This example shows how to report that the first endpoint of a device is turned on.
myDevice.endpoints.byIndex(0).updateApplianceStatus(true);updateDimmerStatus(turnedOn, level[, utcDateTime]) The updateDimmerStatus() method allows updating the state of a dimmer type endpoint, optionally specifying the date and time of the update.
Parameter
- turnedOn (boolean): Dieser Parameter gibt an, ob der Endpoint eingeschaltet (true) oder ausgeschaltet (false) ist.
- level (int): Dieser Parameter gibt die Helligkeitsstufe zwischen 1 % (Minimum) und 100 % (Maximum) an, unabhängig davon, ob der Dimmer ein- oder ausgeschaltet ist.
- utcDateTime (Datum, optional): Dieser Parameter gibt das UTC-Datum und die UTC-Uhrzeit der Aktualisierung an. Wird der Parameter ausgelassen, wird das aktuelle Datum und die aktuelle Uhrzeit verwendet.
Beispiel 1
This example shows how to report that the first endpoint of a device is turned on at 75%.
myDevice.endpoints.byIndex(0).updateDimmerStatus(true, 75);updateClosureControllerStatus(moving, position[, utcDateTime]) The updateClosureControllerStatus() method allows updating the state of a closure type endpoint (curtain, motorized gate, etc.), optionally specifying the date and time of the update.
Parameter
- moving (boolean): Dieser Parameter gibt an, ob die Schließung derzeit in Bewegung ist (Öffnen oder Schließen). Der Wert true indicates it is moving, while the value false indicates it is stopped.
- position (int): Dieser Parameter gibt die aktuelle Position zwischen 0 % (geschlossen) und 100 % (offen) an.
- utcDateTime (Datum, optional): Dieser Parameter gibt das UTC-Datum und die UTC-Uhrzeit der Aktualisierung an. Wird der Parameter ausgelassen, wird das aktuelle Datum und die aktuelle Uhrzeit verwendet.
Beispiel 1
This example shows how to report that the first endpoint of a device is stopped in the "open" position.
myDevice.endpoints.byIndex(0).updateClosureControllerStatus(false, 100);updateHVACStatus(mode, fanMode, setpoint, ambientTemperature[, utcDateTime]) The updateHVACStatus() method allows updating the state of an HVAC device, such as a thermostat, optionally specifying the date and time of the update.
Parameter
- mode (enum): aktueller Modus des Geräts:
- thermostatMode.off = 1: the device is off.
- thermostatMode.auto = 2: the device is on in automatic mode.
- thermostatMode.heat = 3: the device is on in heat mode.
- thermostatMode.cool = 4: the device is on in cool mode.
- thermostatMode.dry = 5: the device is on in dehumidification mode.
- thermostatMode.fan = 6: the device is on in fan mode.
- fanMode (enum): gibt den aktuellen Lüftermodus an:
- thermostatFanMode.auto = 1: the fan is in auto mode.
- thermostatFanMode.low = 2: the fan is at low speed.
- thermostatFanMode.mid = 3: the fan is at medium speed.
- thermostatFanMode.high = 4: the fan is at high speed.
- setpoint (number): Gibt die gewünschte Temperatur in Grad Celsius an.
- ambientTemperature (number): Gibt die Umgebungstemperatur in Grad Celsius an.
- utcDateTime (Datum, optional): Dieser Parameter gibt das UTC-Datum und die UTC-Uhrzeit der Aktualisierung an. Wird der Parameter ausgelassen, wird das aktuelle Datum und die aktuelle Uhrzeit verwendet.
Beispiel 1
This example shows how to report that the first endpoint of a device is on in cool mode, with the fan at automatic speed, a desired temperature of 25 degrees Celsius, and an ambient temperature of 26 degrees Celsius.
myDevice.endpoints.byIndex(0).updateHVACStatus(thermostatMode.cool, thermostatFanMode.auto, 25, 27);updateLocationTrackerStatus(latitude, longitude [, altitude, flags, utcDateTime]) The updateLocationTrackerStatus() method allows updating the state of a location tracker, optionally specifying the date and time of the update.
Parameter
- Breitengrad (double): Gibt den Breitengrad an. Der Wert muss zwischen -90 und 90 liegen. Das Dezimaltrennzeichen ist ein Punkt.
- Längengrad (double): Gibt den Längengrad an. Der Wert muss zwischen -180 und 180 liegen. Das Dezimaltrennzeichen ist ein Punkt.
- Höhe (double): Gibt die Höhe an. Numerischer Wert. Das Dezimaltrennzeichen ist ein Punkt.
- flags (int, optional): Gibt zusätzliche Informationen zur Position an. Ein ganzzahliger Wert, der eine bitweise Summe darstellt. Verfügbare Zustände sind:
- locationTrackerFlags.none (0): Nothing special
- locationTrackerFlags.moving (1): The sensor position is changing
- locationTrackerFlags.noPosition (2): The sensor cannot acquire the position
- locationTrackerFlags.malfunctioning (4): The sensor is not functioning correctly. The reported position may be incorrect
- locationTrackerFlags.lowPrecision (8): The reported position has low precision
Values can be combined through the OR operation. For example, to indicate that the reported position has low precision and the position is changing, use (8 OR 1) = 9.
- utcDateTime (Datum, optional): Dieser Parameter gibt das UTC-Datum und die UTC-Uhrzeit der Probe an. Wird der Parameter ausgelassen, wird das aktuelle Datum und die aktuelle Uhrzeit verwendet.
Beispiel 1
This example shows how to report a location with latitude -13.9957594 and longitude 48.933938 on the first endpoint of a device.
myDevice.endpoints.byIndex(0).updateLocationTrackerStatus(-13.9957594, 48.933938);Beispiel 2
This example shows how to report a location with latitude -13.9957594, longitude 48.933938, and altitude 123 on the first endpoint of a device.
myDevice.endpoints.byIndex(0).updateLocationTrackerStatus(-13.9957594, 48.933938, 123);Beispiel 3
This example shows how to report a location with latitude -13.9957594, longitude 48.933938, altitude 123, and flag 1 (the sensor position is changing) on the first endpoint of a device.
myDevice.endpoints.byIndex(0).updateLocationTrackerStatus(-13.9957594, 48.933938, 123, locationTrackerFlags.moving);Example 4
This example shows how to report a location with latitude -13.9957594, longitude 48.933938, and a specific timestamp on the first endpoint of a device.
myDevice.endpoints.byIndex(0).updateLocationTrackerStatus(-13.9957594, 48.933938, 0, locationTrackerFlags.none, '2021-02-23T14:55:03');updateEnergySensorValueSummation(activeEnergySummationWh, reactiveEnergySummationVARh [, utcDateTime]) The updateEnergySensorValueSummation() method allows updating the active and reactive energy summation of an energy sensor, optionally specifying the date and time of the update.
Parameter
- activeEnergySummationWh (double): Gibt den aktuellen Wert der Summierung der Wirkenergie in Wh an.
- reactiveEnergySummationVARh (double): Gibt den aktuellen Wert der Summierung der Blindenergie in VARh an.
- utcDateTime (Datum, optional): Dieser Parameter gibt das UTC-Datum und die UTC-Uhrzeit der Probe an. Wird der Parameter ausgelassen, wird das aktuelle Datum und die aktuelle Uhrzeit verwendet.
Beispiel 1
This example shows how to report a cumulative active and reactive energy of 14650 Wh and 1280 VARh respectively, on the first endpoint of a device.
myDevice.endpoints.byIndex(0).updateEnergySensorValueSummation(14650, 1280);updateEnergySensorValueUnits(activeEnergyWh, reactiveEnergyVARh [, utcDateTime]) The updateEnergySensorValueUnits() method allows adding an active and reactive energy consumption value from an energy sensor, optionally specifying the date and time of the update.
Parameter
- activeEnergyWh (double): Gibt die verbrauchte Wirkenergie in Wh an. Dieser Wert wird zum zuvor erfassten Wirkenergieverbrauch addiert.
- reactiveEnergyVARh (double): Gibt die verbrauchte Blindenergie in VARh an. Dieser Wert wird zum zuvor erfassten Blindenergieverbrauch addiert.
- utcDateTime (Datum, optional): Dieser Parameter gibt das UTC-Datum und die UTC-Uhrzeit der Probe an. Wird der Parameter ausgelassen, wird das aktuelle Datum und die aktuelle Uhrzeit verwendet.
Beispiel 1
This example shows how to report a consumption of 160 Wh and 22 VARh respectively, on the first endpoint of a device.
myDevice.endpoints.byIndex(0).updateEnergySensorValueUnits(160, 22);updateFlowSensorValueSummation(summationValue, [, utcDateTime]) The updateFlowSensorValueSummation() method allows updating the flow summation of a flow sensor, generic flow sensor, or people flow sensor, optionally specifying the date and time of the update.
Parameter
- summationValue (double): Gibt den aktuellen Wert der Durchflusssumme an.
- Bei Durchflusssensoren muss der Wert in Litern angegeben werden.
- Bei generischen Durchflusssensoren muss der Wert in der Einheit angegeben werden, die der für den Sensor gewählten Variable zugeordnet ist.
- Bei Personenfluss-Sensoren wird der Wert in Personen angegeben.
- utcDateTime (Datum, optional): Dieser Parameter gibt das UTC-Datum und die UTC-Uhrzeit der Probe an. Wird der Parameter ausgelassen, wird das aktuelle Datum und die aktuelle Uhrzeit verwendet.
Beispiel 1
This example shows how to report a cumulative flow of 14650 liters on the first endpoint of a device.
myDevice.endpoints.byIndex(0).updateFlowSensorValueSummation(14650);updateFlowSensorValueUnits(value, [, utcDateTime]) The updateFlowSensorValueUnits() method allows adding a value to the flow recorded by a flow sensor, generic flow sensor, or people flow sensor, optionally specifying the date and time of the update.
Parameter
- value (double): indicates the recorded flow value. This value will be added to the previously recorded value.
- Bei Durchflusssensoren muss der Wert in Litern angegeben werden.
- Bei generischen Durchflusssensoren muss der Wert in der Einheit angegeben werden, die der für den Sensor gewählten Variable zugeordnet ist.
- Bei Personenfluss-Sensoren wird der Wert in Personen angegeben.
- utcDateTime (Datum, optional): Dieser Parameter gibt das UTC-Datum und die UTC-Uhrzeit der Probe an. Wird der Parameter ausgelassen, wird das aktuelle Datum und die aktuelle Uhrzeit verwendet.
Beispiel 1
This example shows how to report a flow of 182 liters on the first endpoint of a device.
myDevice.endpoints.byIndex(0).updateFlowSensorValueUnits(182);updateTextContainerStatus(text, [, utcDateTime]) The updateTextContainerStatus() method allows adding text up to 255 characters in length.
Parameter
- Text: Indicates the text to be added.
- utcDateTime (Datum, optional): Dieser Parameter gibt das UTC-Datum und die UTC-Uhrzeit der Probe an. Wird der Parameter ausgelassen, wird das aktuelle Datum und die aktuelle Uhrzeit verwendet.
Beispiel 1
This example shows how to add text.
myDevice.endpoints.byIndex(0).updateTextContainerStatus("Sample text for text container endpoint");uploadCameraSnapshot(base64Content, fileType, [, utcDateTime]) The uploadCameraSnapshot() method allows storing an image obtained from a camera.
Parameter
- base64Content: the text, in base64 format, corresponding to the binary content of the image.
- fileType: indicates the image type. Accepted values are "jpg" and "png".
- utcDateTime (Datum, optional): Dieser Parameter gibt das UTC-Datum und die UTC-Uhrzeit der Bildaufnahme an. Wird der Parameter ausgelassen, wird das aktuelle Datum und die aktuelle Uhrzeit verwendet.
Beispiel 1
This example shows how to upload a camera snapshot.
myDevice.endpoints.byIndex(0).uploadCameraSnapshot("VGhpcyBpcyBzb21lIHRleHQ....[more text].....", "jpg");Endpunkt-Sammlung
Das Endpunkt-Sammlungsobjekt repräsentiert eine Sammlung von Endpunkten, die in einem Gerät enthalten sind. Typischerweise wird auf die Liste der Endpunkte über die Eigenschaft endpoints zugegriffen...
Gerätemodelkonfiguration
Das Gerätemodelkonfigurationsobjekt ermöglicht die Festlegung der Basiskonfiguration für ein Gerätemodell, typischerweise verwendet in Gerätemodelkonfigurationsskripten.