Modify a Smart Device
Description
Modifies a smart device at a specific service location:
General information
Configuration properties
Resource URL
https://app1pub.smappee.net/dev/v3/servicelocation/[SERVICELOCATIONID]/smartdevices/[SMARTDEVICEID]
HTTP method
PATCH
HTTP header
Authorization: Bearer [ACCESS_TOKEN]
 [ACCESS_TOKEN] being the access token received from the Get token or Refresh token authentication calls.
Parameters
Parameter | Type | Description |
---|---|---|
SERVICELOCATIONID | Path Parameter | The actual id of an accessible service location (see Get Servicelocations) |
SMARTDEVICEID | Path Parameter | The actual id of the smart device that you intend to modify (see Get Smart Devices) |
HTTP body
Note that the semantics of a PATCH call is that you only provide what you intend to update, you do not need to know all the different properties of the smart device to be able to do the update. This potentially saves you from doing a GET operation first.
The example below will only modify the 2 configuration properties that are provided.
{
"configurationProperties": [
{
"value": {
"unit": "A",
"value": 30
},
"spec": {
"name": "etc.smart.device.type.car.charger.config.greenflux.power.threshold"
}
},
{
"value": {
"unit": "s",
"value": 1
},
"spec": {
"name": "etc.smart.device.type.car.charger.config.greenflux.fast.message.frequency"
}
}
]
}
Example
https://app1pub.smappee.net/dev/v3/servicelocation/123/smartdevices/CHARCHARGER-1
Result
The result is an updated view of the smart device that was update.
{
"id": "CARCHARGER-1",
"uuid": "34dd94f0-e186-43d0-b7c2-cdf59fb9855f",
"name": "Example",
"favourite": true,
"type": {
"category": "CARCHARGER",
"name": "greenflux",
"displayName": "GreenFlux",
"logoURL": "https://smappeelogos.s3-eu-west-1.amazonaws.com/greenflux/GreenFluxLogo.png",
"protocol": "MQTT",
"configurationProperties": [
{
"name": "etc.smart.device.type.car.charger.config.greenflux.power.threshold",
"displayName": "Power threshold",
"description": "When this threshold is exceeded on one of the phases the fast message frequency is used to send measurement messages to the MQTT Broker.",
"species": "Quantity",
"unit": "A",
"required": true
},
{
"name": "etc.smart.device.type.car.charger.config.greenflux.mqtt.url",
"displayName": "MQTT Broker url",
"description": "Measurements messages are published on this MQTT Broker. Specify as host:port. When not specified the Smappee MQTT production broker is used.",
"species": "String",
"required": false
},
{
"name": "etc.smart.device.type.car.charger.config.greenflux.fast.message.frequency",
"displayName": "Fast message frequency",
"description": "Fast message frequency is an optional parameter, default is 5 seconds.",
"species": "Quantity",
"unit": "s",
"required": false,
"possibleValues": {
"values": [
{
"value": 5,
"unit": "s"
}
],
"defaultValue": {
"unit": "SECOND",
"value": 5,
"multiplier": 0
},
"exhaustive": false
}
},
{
"name": "etc.smart.device.type.car.charger.config.greenflux.slow.message.frequency",
"displayName": "Slow message frequency",
"description": "Slow message frequency is an optional parameter, default is 60 seconds.",
"species": "Quantity",
"unit": "s",
"required": false,
"possibleValues": {
"values": [
{
"value": 60,
"unit": "s"
}
],
"defaultValue": {
"unit": "SECOND",
"value": 60,
"multiplier": 0
},
"exhaustive": false
}
}
],
"properties": [
{
"name": "current",
"displayName": "Consumption car charging station",
"description": "The power that the car charging station is currently using.",
"species": "Quantity",
"unit": "W",
"required": false
}
],
"actions": []
},
"configurationProperties": [
{
"value": {
"value": 30,
"unit": "A"
},
"spec": {
"name": "etc.smart.device.type.car.charger.config.greenflux.power.threshold",
"displayName": "Power threshold",
"description": "When this threshold is exceeded on one of the phases the fast message frequency is used to send measurement messages to the MQTT Broker.",
"species": "Quantity",
"unit": "A",
"required": true
}
},
{
"value": "mqtt://app1pub.smappee.net/just/an/example",
"spec": {
"name": "etc.smart.device.type.car.charger.config.greenflux.mqtt.url",
"displayName": "MQTT Broker url",
"description": "MQTT Broker url is an optional parameter, but when specified measurements messages are published on this MQTT Broker. Specify as host:port",
"species": "String",
"required": false
}
},
{
"value": {
"value": 5,
"unit": "s"
},
"spec": {
"name": "etc.smart.device.type.car.charger.config.greenflux.fast.message.frequency",
"displayName": "Fast message frequency",
"description": "Fast message frequency is an optional parameter, default is 5 seconds.",
"species": "Quantity",
"unit": "s",
"required": false,
"possibleValues": {
"values": [
{
"value": 1,
"unit": "s"
}
],
"defaultValue": {
"unit": "SECOND",
"value": 5,
"multiplier": 0
},
"exhaustive": false
}
}
},
{
"value": {
"value": 300,
"unit": "s"
},
"spec": {
"name": "etc.smart.device.type.car.charger.config.greenflux.slow.message.frequency",
"displayName": "Slow message frequency",
"description": "Slow message frequency is an optional parameter, default is 60 seconds.",
"species": "Quantity",
"unit": "s",
"required": false,
"possibleValues": {
"values": [
{
"value": 60,
"unit": "s"
}
],
"defaultValue": {
"unit": "SECOND",
"value": 60,
"multiplier": 0
},
"exhaustive": false
}
}
}
]
}
Versioning
Version 3 (v3)
This call was introduced in version 3.