API and MQTT Documentation SMAPPEE
API and MQTT Documentation SMAPPEE
Documentation
The REST API service is available for all Smappee Infinity installations including a Smappee gateway.
(Genius and Connect series).
Measurement values
• ‘Get Electricity Consumption’: view the electricity consumption data of Smappee monitors for a specified
time range.
• ‘Get Switch Consumption’: view the consumption data of Smappee Switches.
• ‘Get Sensor Consumption’: view the data measured by Input modules or Smappee Gas & Water monitors.
(Smappee Infinity modules that use a sensor to gather consumption data)
NILM
• ‘Get Events’: get an overview of all the detected events of appliances.
• ‘Get Cost Analysis’: view the energy consumption data per appliance during a specified time range.
Location management
• ‘Create service location’
• ‘Delete service location’
• ‘Update service location’
• ‘Share access to a service location’
Measurement values
• ‘Get Electricity Consumption’: view the electricity consumption and production data for a specified time
range. View the data according to the following types of aggregation:
Interval Data Retention Unit
TIP: multiply the values by 12 to convert the 5-minute interval from Energy [Wh] to Power [W].
• ‘Get Sensor Consumption’: view the configuration of the sensor (pulses) and the gas and/or water
consumption data of Smappee Gas & Waters connected to the Smappee.
NILM
• ‘Get Events’: get an overview of the appliance events detected by the Smappee monitor and get an
overview of the (active) power per detected appliance:
- View the active power value (watts) as a result of the appliance event. This value is positive when the
appliance was switched on (power increase of the appliance). This value is negative when the
appliance was switched off (power decrease of the appliance).
- View the total power (watts) after the appliance event. This value indicates the total load of the
complete installation and the current status of the total load of the installation when the appliance is
switched on.
• ‘Get Cost Analysis’: get a breakdown of the energy consumption per appliance for a specified time range.
You can control the state for a specific time range or permanently. You can turn Comfort Plugs and
Switches on or off for intervals of 300, 900, 1800 or 3600 seconds. Any other time interval results in
changing the state for an undetermined period of time.
• Get ‘Actuator State’: see whether Switches are turned on or off. The possible states are ‘ON_ON’ or
‘OFF_OFF’.
• Set Actuator State: set the state of a specific Switch, Comfort plug or Output Module.
Note: you need to have a Smappee partner API account to carry out the actions described above.
Contact your trusted Business Developer or info@smappee.com to request access to these actions.
• The ‘Get Metering Configuration’ call contains the overview of each measurement and each load
configuration.
Resource URL:
https://app1pub.smappee.net/dev/v3/servicelocation/[SERVICELOCATIONID]/meteringconfiguration
Note: consumption Index 1 corresponds to the 2nd value in the Get Consumption call
• ‘Get Electricity Consumption’ contains the electricity consumption and production data for a specified
time range for each of the inputs (CTs).
The MQTT service is only available for Infinity installations including a Smappee Genius as gateway.
The MQTT service is not available for Infinity installations with a Connect series module as
gateway.
MQTT Technology
“MQTT is a Machine-to-Machine (M2M)/Internet of Things connectivity protocol. It was designed as an
extremely lightweight publish/subscribe messaging transport. It is useful for connections with remote
locations where a small code footprint is required and/or network bandwidth is at a premium.” (“What is
MQTT”, n.d.)*
General
The Smappee Infinity sends out messages to multiple MQTT Topics that can be picked up by an external MQTT
broker or by a broker in the local network that is subscribed to the MQTT Topics of interest.
The Smappee Infinity is also equipped with a local MQTT broker.
Principle
• The Smappee device constantly pushes MQTT data (topics).
• The server, which is equipped with an MQTT broker, is ‘subscribed’ to a set of Smappee data and redirects
the data to a specified location or platform.
• The server hosting the MQTT broker can be located in the local network, cloud or other server.
Application
1. The data is exchanged via an external MQTT broker (most frequently used).
2. Node Red via a local MQTT broker embedded in the Smappee Genius.
Note: your tablet or laptop must be connected to the same network as the Smappee monitor to
be able to use the Expert Portal.
3. Click ‘Logon/logoff’ and fill in the ‘admin’ password and click ‘logon’.
4. Click ‘Advanced’.
5. Fill in the location of the external MQTT Broker with either an IP address or domain and
authentication (if applicable).
Configuration - Retained
{
"utcTimeStamp":1593704282477,
"deviceUuid":"9930aed6-7f28-4eb9-9ac0-5f5b085f26aa",
"serialNumber":"5010000004",
"serviceLocationUuid":"d578830e-7d3c-4221-9ad5-
servicelocation/<u Contains the meta information of the
2c8866b0c5ef",
uid>/config service location as key/value pairs
"serviceLocationId":11899,
"firmwareVersion":"V4.7.0-SNAPSHOT",
"aggregationPeriodSeconds":300,
"timeZone":"Europe/Brussels"
}
{
"utcTimeStamp":1593704283324,
"dataProcessingSpecification":{
"serviceLocationId":11899,
"phaseType":"THREE_STAR",
"dataSources":[
{
"busAddress":{
"serialNumber":"5500000006",
"inputIndex":0
},
"type":"SCT2_50A",
"reversed":false,
servicelocation/<u
Contains the channel configuration "version":4,
uid>/channelConfig
of the Smappee Genius "name":"CTHub-5500000006",
V2
"nilm":true,
"measurementType":{
"commodity":"ELECTRICITY",
"measurementKind":"ACTIVE_POWER",
"unit":"WATT",
"index":0,
"phase":"PHASEA",
"channel":0,
"mRID":"1.37.128.38"
}
},
{
"serialNumber":"3004001110",
}
},
{
"serialNumber":"4006001315",
"monitorId":3,
"version":4,
"name":"Leaf-3",
"nilm":false,
"measurementType":{
"commodity":"ELECTRICITY",
"measurementKind":"ACTIVE_POWER",
"unit":"WATT",
"index":0,
"phase":"NOTAPPLICABLE",
"channel":0,
"mRID":"1.37.0.38"
}
],
"measurements":[
{
"version":2,
"type":"CT",
"name":"GridA",
"formula":"$5500000006/0$",
"publishIndex":0,
"flow":"CONSUMPTION",
"connectionType":"GRID",
"publishedMeasurementTypes":[
{
"commodity":"ELECTRICITY",
"measurementKind":"ACTIVE_POWER",
"unit":"WATT",
"index":0,
"phase":"PHASEA",
"channel":0,
"mRID":"1.37.128.38"
},
{
Smappee API – Documentation - English 15
"commodity":"ELECTRICITY",
"measurementKind":"REACTIVE_POWER",
"unit":"VOLTAMPEREREACTIVE",
"index":0,
"phase":"PHASEA",
"channel":0,
"mRID":"1.1003.128.63"
},
{
"commodity":"ELECTRICITY",
"measurementKind":"VOLTAGE",
"unit":"VOLT",
"index":0,
"phase":"PHASEA",
"channel":0,
"mRID":"1.158.128.29"
},
{
"commodity":"ELECTRICITY",
"measurementKind":"VOLTAGE_MIN",
"unit":"VOLT",
"index":0,
"phase":"PHASEA",
"channel":0,
"mRID":"1.1015.128.29"
},
{
"commodity":"ELECTRICITY",
"measurementKind":"VOLTAGE_MAX",
"unit":"VOLT",
"index":0,
"phase":"PHASEA",
"channel":0,
"mRID":"1.1016.128.29"
},
{
"commodity":"ELECTRICITY",
"measurementKind":"VOLTAGE_HARMONIC",
"unit":"VOLT",
"index":5,
"phase":"PHASEA",
"channel":0,
"mRID":"1.1020.5.128.29"
},
{
"commodity":"ELECTRICITY",
"measurementKind":"VOLTAGE_HARMONIC",
"unit":"VOLT",
Smappee API – Documentation - English 16
"index":6,
"phase":"PHASEA",
"channel":0,
"mRID":"1.1020.6.128.29"
},
{
"commodity":"ELECTRICITY",
"measurementKind":"CURRENT",
"unit":"AMPERE",
"index":0,
"phase":"PHASEA",
"channel":0,
"mRID":"1.4.128.5"
},
{
"commodity":"ELECTRICITY",
"measurementKind":"CURRENT_MIN",
"unit":"AMPERE",
"index":0,
"phase":"PHASEA",
"channel":0,
"mRID":"1.1017.128.5"
},
{
"commodity":"ELECTRICITY",
"measurementKind":"CURRENT_MAX",
"unit":"AMPERE",
"index":0,
"phase":"PHASEA",
"channel":0,
"mRID":"1.1018.128.5"
},
{
"commodity":"ELECTRICITY",
"measurementKind":"CURRENT_HARMONIC",
"unit":"AMPERE",
"index":2,
"phase":"PHASEA",
"channel":0,
"mRID":"1.1021.2.128.5"
},
{
"version":2,
"type":"LEAF",
"name":"Leaf-3",
"formula":"$4006001315/0$",
"publishIndex":-1,
"publishedMeasurementTypes":[
Smappee API – Documentation - English 17
{
"commodity":"ELECTRICITY",
"measurementKind":"ACTIVE_POWER",
"unit":"WATT",
"index":0,
"phase":"NOTAPPLICABLE",
"channel":0,
"mRID":"1.37.0.38"
},
{
"commodity":"ELECTRICITY",
"measurementKind":"REACTIVE_POWER",
"unit":"VOLTAMPEREREACTIVE",
"index":0,
"phase":"NOTAPPLICABLE",
"channel":0,
"mRID":"1.1003.0.63"
},
{
"version":2,
"type":"FROGGY",
"name":"Froggy-8",
"formula":"$3004001110/0$",
"publishIndex":-1,
"publishedMeasurementTypes":[
{
"commodity":"AIR",
"measurementKind":"TEMPERATURE",
"unit":"DEGREESCELSIUS",
"index":0,
"phase":"NOTAPPLICABLE",
"channel":0,
"mRID":"4.46.0.23"
},
{
"commodity":"ELECTRICITY",
"measurementKind":"DCVOLTAGE",
"unit":"NOTAPPLICABLE",
"index":0,
"phase":"NOTAPPLICABLE",
"channel":0,
"mRID":"1.159.0.0"
},
{
"commodity":"AIR",
"measurementKind":"RELATIVEHUMIDITY",
"unit":"HUMIDITY",
"index":0,
Smappee API – Documentation - English 18
"phase":"NOTAPPLICABLE",
"channel":0,
"mRID":"4.156.0.281"
},
{
"commodity":"NATURALGAS",
"measurementKind":"VOLUME",
"unit":"CUBICMETER",
"index":0,
"phase":"NOTAPPLICABLE",
"channel":0,
"mRID":"7.58.0.42"
}
{
"utcTimeStamp":1593704283203,
"gwSensors":[
{
"gwSensorChannelsConfig":[
{
"leakIntervals":1,
"maxPulses":0,
"ppu":100.0,
"uom":"m3",
"enabled":true,
"type":"GAS"
},
{
"leakIntervals":0,
"maxPulses":0,
servicelocation/<u "ppu":1.0,
uid>/sensorConfig "uom":"NONE",
"enabled":false,
"type":"NONE"
},
{
"leakIntervals":0,
"maxPulses":0,
"ppu":1.0,
"uom":"NONE",
"enabled":false,
"type":"OUTPUT"
},
{
"leakIntervals":0,
"maxPulses":0,
"ppu":1.0,
"uom":"NONE",
{
servicelocation/<u
"utcTimeStamp":1593704286280,
uid>/homeControl
"switchActuators":[
Config
{
},
{
"nodeId":4,
"name":"Washing machine",
"serialNumber":"4006001341"
},
{
"nodeId":2,
"name":"Standard coffemaker",
"serialNumber":"4006001413"
},
{
"nodeId":1,
"name":"Tumble dryer",
"serialNumber":"4006001417"
],
"smartplugActuators":[
],
"maximumAmpere":40
}
{
"totalPower":134,
"totalReactivePower":10,
"totalExportEnergy":86400,
"totalImportEnergy":13453862400,
"monitorStatus":0,
"utcTimeStamp":1594201361000,
"measuredFrequency":49993068,
"channelPowers":[
{
"publishIndex":0,
"formula":"$5500000006/0$",
"power":12,
"exportEnergy":0,
"importEnergy":1651784400,
"phaseId":0,
"current":3
Contains the real-time power values.
Note that this information is published
},
every second.
{
Where:
"publishIndex":1,
- Power in W (watt)
"formula":"$5500000006/1$",
- Energy in J (joule, Ws) (not persistent,
"power":14,
reset to 0 on every software restart)
servicelocation/<u "exportEnergy":0,
- Frequency in µHz
uid>/realtime "importEnergy":1145653200,
- Voltage in V (volt)
"phaseId":1,
- Current in dA (deciampère)
"current":2
- Totals are the aggregated values
considering the channel configuration
},
- For a Smappee Genius, the import and
{
export Energy is an index and goes up every
"publishIndex":2,
3600ws
"formula":"$5500000006/2$",
"power":109,
"exportEnergy":0,
"importEnergy":2697822000,
"phaseId":2,
"current":7
},
{
"publishIndex":3,
"formula":"$5500000005/0$",
"power":1,
"exportEnergy":0,
"importEnergy":980042400,
"phaseId":0,
"current":3
},
{
"publishIndex":5,
"formula":"$5500000005/2$",
"power":0,
"exportEnergy":86400,
"importEnergy":539319600,
"phaseId":2,
"current":0
},
{
"publishIndex":7,
"formula":"$5500000399/0$",
"power":0,
"exportEnergy":0,
"importEnergy":0,
"phaseId":0,
"current":0
},
{
"publishIndex":8,
"formula":"$5500000399/1$",
"power":0,
"exportEnergy":0,
"importEnergy":0,
"phaseId":1,
"current":0
},
{
"publishIndex":9,
"formula":"$5500000399/2$",
"power":0,
"exportEnergy":0,
"importEnergy":0,
"phaseId":2,
"current":0
},
{
Smappee API – Documentation - English 23
"publishIndex":14,
"formula":"$5500000005/3$",
"power":12,
"exportEnergy":0,
"importEnergy":757947600,
"phaseId":1,
"current":1
},
{
"publishIndex":11,
"formula":"$5600000091/0$",
"power":11,
"exportEnergy":0,
"importEnergy":1652619600,
"phaseId":0,
"current":3
},
{
"publishIndex":12,
"formula":"$5600000091/1$",
"power":14,
"exportEnergy":0,
"importEnergy":1139464800,
"phaseId":1,
"current":2
},
{
"publishIndex":13,
"formula":"$5600000091/2$",
"power":109,
"exportEnergy":0,
"importEnergy":2701908000,
"phaseId":2,
"current":7
],
"voltages":[
{
"voltage":239,
"phaseId":0
},
{
"voltage":240,
"phaseId":1
]
}
{
"value":"CONNECTED",
Contains whether the Switch that is "since":1516355163247
connected to this service location is }
servicelocation/<u connected (1), disconnected (0), or {
uid>/plug/<node unreachable (2). You can also retrieve the "value":"DISCONNECTED",
id>/connectionStat timestamp for when the status of the Switch "since":1516355163247
e changed. The timestamp is the number of }
milliseconds that have passed since Jan 1st, {
1970 (UTC). "value":"UNREACHABLE",
"since":1516355163247
}
{
Contains whether the Switch that is
"value": "ON",
servicelocation/<u connected to this service location is
"since": 1505479692000
uid>/plug/<node switched on or off. You can also retrieve the
}
id>/state timestamp for when the Switch turned on
{
or off. The timestamp is the number of
"value": "OFF",
milliseconds that have passed since Jan 1st,
"since": 1505479692000
1970 (UTC).
}
{
"value": "ON",
servicelocation/<u
Turns the Switch that is connected to this }
uid>/plug/<node
service location on or off. {
id>/setstate
"value": "OFF",
}
{
"triggerId": 3,
Reports a trigger action
"label": "New Trigger 3",
- triggerId assigned by the backend during
"controllableNodeIds": [2],
configuration
"type": "ACTIVE_POWER_ABOVE",
- controllableNodes may be empty or use
servicelocation/<u "longitude": 0.0,
nodeId from homeControlconfig
uid>/trigger "latitude": 0.0,
- all other values according to the
"radius": 0,
configuration of the trigger
"delay": 0,
- Not all values are used for specific trigger
"action": "ON",
types
"threshold": 100.0
}
{
Reports a scheduler action "schedulerId": 2,
- schedulerId assigned by the backend "label": "New Trigger off",
during configuration "controllableNodeIds": [],
servicelocation/<u
- controllableNodes may be empty or use "hour": 9,
uid>/scheduler
nodeId from homeControlconfig "min": 10,
- all other values according to the "day": "ALL_DAYS",
configuration of the trigger "action": "OFF"
}
Smappee API – Documentation - English 26
Presence reporting – Retained