Versions Compared

Key

  • This line was added.
  • This line was removed.
  • Formatting was changed.

Description

Creates a new smart device at a specific service location:

  • General information

  • Configuration properties

Resource URL

https://app1pub.smappee.net/dev/v3/servicelocation/[SERVICELOCATIONID]/smartdevices

HTTP method

POST

HTTP header

Authorization: Bearer [ACCESS_TOKEN]

(info) [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)

Http

HTTP body

Code Block
languagejs
{
  "category": "CARCHARGER",
  "name": "Example",
  "favourite": true,
  "typeName": "greenflux",
  "configurationProperties": [
    {
      "value": {
        "unit": "A",
        "value": 10
      },
      "spec": {
        "name": "etc.smart.device.type.car.charger.config.greenflux.power.threshold"
      }
    },
    {
      "value": "mqtt://app1pub.smappee.net/just/an/example",
      "spec": {
        "name": "etc.smart.device.type.car.charger.config.greenflux.mqtt.url"
      }
    },
    {
      "value": {
        "unit": "s",
        "value": 300
      },
      "spec": {
        "name": "etc.smart.device.type.car.charger.config.greenflux.slow.message.frequency"
      }
    },
    {
      "value": {
        "unit": "s",
        "value": 5
      },
      "spec": {
        "name": "etc.smart.device.type.car.charger.config.greenflux.fast.message.frequency"
      }
    }
  ]
}


Example

https://app1pub.smappee.net/dev/v3/servicelocation/123/smartdevices

Result

Code Block
languagejs
{
  "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": "MQTT Broker url is an optional parameter, but when specified measurements 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": 10,
        "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": 5,
              "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.


Page Properties
hiddentrue
idrest-api-method


Index

2

Resource URL

https://app1pub.smappee.net/dev/

v1

v3/servicelocation/123/smartdevices

HTTP method

POST

Description

Creates a new smart device at a specific service location:

  • General information

  • Configuration properties



Panel
titleContent
Table of Contents