{
  "$schema": "https://json-schema.org/draft/2020-12/schema",
  "$id": "https://artifacts.apis.io/smart-me-com/json-schema/smart-me-com-device-schema.json",
  "title": "Device",
  "description": "Container Class for the Web API",
  "x-generated": "2026-11-25",
  "x-method": "derived",
  "x-generator": "derive-json-schema.py",
  "x-source": "openapi/smart-me-com-openapi.json#/components/schemas/Device",
  "type": "object",
  "properties": {
    "id": {
      "type": "string",
      "description": "The ID of the device",
      "format": "uuid"
    },
    "name": {
      "type": [
        "string",
        "null"
      ],
      "description": "The Name of the Device"
    },
    "serial": {
      "type": "integer",
      "description": "The Serial number",
      "format": "int64"
    },
    "isEnabled": {
      "type": "boolean",
      "description": "Flag if the device is enabled. Disabled devices don't receive new values."
    },
    "deviceEnergyType": {
      "$ref": "#/$defs/MeterEnergyType"
    },
    "meterSubType": {
      "$ref": "#/$defs/MeterSubType"
    },
    "familyType": {
      "$ref": "#/$defs/MeterFamilyType"
    },
    "activePower": {
      "type": [
        "number",
        "null"
      ],
      "description": "The Actvie Power or current flow rate",
      "format": "double"
    },
    "activePowerL1": {
      "type": [
        "number",
        "null"
      ],
      "description": "The Actvie Power Phase L1",
      "format": "double"
    },
    "activePowerL2": {
      "type": [
        "number",
        "null"
      ],
      "description": "The Actvie Power Phase L2",
      "format": "double"
    },
    "activePowerL3": {
      "type": [
        "number",
        "null"
      ],
      "description": "The Actvie Power Phase L3",
      "format": "double"
    },
    "activePowerUnit": {
      "type": [
        "string",
        "null"
      ],
      "description": "The Unit of the Active Power Value"
    },
    "counterReading": {
      "type": [
        "number",
        "null"
      ],
      "description": "The Meter Counter Reading (Total Energy used)",
      "format": "double"
    },
    "counterReadingUnit": {
      "type": [
        "string",
        "null"
      ],
      "description": "The Unit of the Counter Reading"
    },
    "counterReadingT1": {
      "type": [
        "number",
        "null"
      ],
      "description": "The Meter Counter Reading Tariff 1",
      "format": "double"
    },
    "counterReadingT2": {
      "type": [
        "number",
        "null"
      ],
      "description": "The Meter Counter Reading Tariff 2",
      "format": "double"
    },
    "counterReadingT3": {
      "type": [
        "number",
        "null"
      ],
      "description": "The Meter Counter Reading Tariff 3",
      "format": "double"
    },
    "counterReadingT4": {
      "type": [
        "number",
        "null"
      ],
      "description": "The Meter Counter Reading Tariff 4",
      "format": "double"
    },
    "counterReadingImport": {
      "type": [
        "number",
        "null"
      ],
      "description": "The Meter Counter Reading only import",
      "format": "double"
    },
    "counterReadingExport": {
      "type": [
        "number",
        "null"
      ],
      "description": "The Meter Counter Reading only export",
      "format": "double"
    },
    "switchOn": {
      "type": [
        "boolean",
        "null"
      ],
      "description": "Flag if the Switch is on on this device."
    },
    "switchPhaseL1On": {
      "type": [
        "boolean",
        "null"
      ],
      "description": "Flag if the Phase L1 is on on this device."
    },
    "switchPhaseL2On": {
      "type": [
        "boolean",
        "null"
      ],
      "description": "Flag if the Phase L2 is on on this device."
    },
    "switchPhaseL3On": {
      "type": [
        "boolean",
        "null"
      ],
      "description": "Flag if the Phase L3 is on on this device."
    },
    "voltage": {
      "type": [
        "number",
        "null"
      ],
      "description": "The Voltage (in V)",
      "format": "double"
    },
    "voltageL1": {
      "type": [
        "number",
        "null"
      ],
      "description": "The Voltage Phase L1 (in V)",
      "format": "double"
    },
    "voltageL2": {
      "type": [
        "number",
        "null"
      ],
      "description": "The Voltage Phase L2 (in V)",
      "format": "double"
    },
    "voltageL3": {
      "type": [
        "number",
        "null"
      ],
      "description": "The Voltage Phase L3 (in V)",
      "format": "double"
    },
    "current": {
      "type": [
        "number",
        "null"
      ],
      "description": "The Current (in A)",
      "format": "double"
    },
    "currentL1": {
      "type": [
        "number",
        "null"
      ],
      "description": "The Current Phase L1 (in A)",
      "format": "double"
    },
    "currentL2": {
      "type": [
        "number",
        "null"
      ],
      "description": "The Current Phase L2 (in A)",
      "format": "double"
    },
    "currentL3": {
      "type": [
        "number",
        "null"
      ],
      "description": "The Current Phase L3 (in A)",
      "format": "double"
    },
    "powerFactor": {
      "type": [
        "number",
        "null"
      ],
      "description": "The Power Factor (cos phi). Range: 0 - 1",
      "format": "double"
    },
    "powerFactorL1": {
      "type": [
        "number",
        "null"
      ],
      "description": "The Power Factor (cos phi) Phase L1. Range: 0 - 1",
      "format": "double"
    },
    "powerFactorL2": {
      "type": [
        "number",
        "null"
      ],
      "description": "The Power Factor (cos phi) Phase L2. Range: 0 - 1",
      "format": "double"
    },
    "powerFactorL3": {
      "type": [
        "number",
        "null"
      ],
      "description": "The Power Factor (cos phi) Phase L3. Range: 0 - 1",
      "format": "double"
    },
    "temperature": {
      "type": [
        "number",
        "null"
      ],
      "description": "The Temperature (in degree celsius)",
      "format": "double"
    },
    "activeTariff": {
      "type": [
        "integer",
        "null"
      ],
      "description": "The Number of the Active Tariff",
      "format": "int32"
    },
    "digitalOutput1": {
      "type": [
        "boolean",
        "null"
      ],
      "description": "The digital output number 1"
    },
    "digitalOutput2": {
      "type": [
        "boolean",
        "null"
      ],
      "description": "The digital output number 2"
    },
    "analogOutput1": {
      "type": [
        "integer",
        "null"
      ],
      "description": "The analog output number 1 (PWM signal) (0 - 32183)",
      "format": "int32"
    },
    "analogOutput2": {
      "type": [
        "integer",
        "null"
      ],
      "description": "The analog output number 2 (PWM signal) (0 - 32183)",
      "format": "int32"
    },
    "digitalInput1": {
      "type": [
        "boolean",
        "null"
      ],
      "description": "The digital input number 1"
    },
    "digitalInput2": {
      "type": [
        "boolean",
        "null"
      ],
      "description": "The digital input number 2"
    },
    "valueDate": {
      "type": [
        "string",
        "null"
      ],
      "description": "Time of last successful connection the the smart-me Cloud.",
      "format": "date-time"
    },
    "additionalMeterSerialNumber": {
      "type": [
        "string",
        "null"
      ],
      "description": "An additional Meter serial number. e.g. the number of a meter a smart-me device is connected to."
    },
    "flowRate": {
      "type": [
        "number",
        "null"
      ],
      "description": "The current flow rate (e.g. m3/h)",
      "format": "double"
    },
    "chargingStationState": {
      "$ref": "#/$defs/ChargingStationState"
    }
  },
  "additionalProperties": false,
  "$defs": {
    "ChargingStationState": {
      "enum": [
        0,
        1,
        2,
        3,
        4,
        5,
        6,
        7
      ],
      "type": "integer",
      "description": "State of a (pico) charging station<p>Members: </p><ul><li><i>0</i> - Booting</li><li><i>1</i> - ReadyNoCarConnected</li><li><i>2</i> - ReadyCarConnected</li><li><i>3</i> - StartedWaitForCar</li><li><i>4</i> - Charging</li><li><i>5</i> - Installation</li><li><i>6</i> - Authorize</li><li><i>7</i> - Offline</li></ul>",
      "format": "int32"
    },
    "MeterEnergyType": {
      "enum": [
        0,
        1,
        2,
        3,
        4,
        5,
        6,
        7,
        8,
        9,
        10,
        11,
        12,
        13
      ],
      "type": "integer",
      "description": "<p>Members: </p><ul><li><i>0</i> - MeterTypeUnknown</li><li><i>1</i> - MeterTypeElectricity</li><li><i>2</i> - MeterTypeWater</li><li><i>3</i> - MeterTypeGas</li><li><i>4</i> - MeterTypeHeat</li><li><i>5</i> - MeterTypeHCA</li><li><i>6</i> - MeterTypeAllMeters</li><li><i>7</i> - MeterTypeTemperature</li><li><i>8</i> - MeterTypeMBusGateway</li><li><i>9</i> - MeterTypeRS485Gateway</li><li><i>10</i> - MeterTypeCustomDevice</li><li><i>11</i> - MeterTypeCompressedAir</li><li><i>12</i> - MeterTypeSolarLog</li><li><i>13</i> - MeterTypeVirtualMeter</li></ul>",
      "format": "int32"
    },
    "MeterFamilyType": {
      "enum": [
        0,
        1,
        2,
        3,
        4,
        5,
        6,
        7,
        8,
        9,
        10,
        11,
        12,
        14,
        16,
        17,
        18,
        19,
        21,
        65,
        70,
        1001,
        1002,
        1003
      ],
      "type": "integer",
      "description": "The Family Type of the meter (e.g. Smart-me connect meter)<p>Members: </p><ul><li><i>0</i> - The Family Type is unknown (S0 meters, ...)</li><li><i>1</i> - smart-me connect Meter (Plugin Power Meter)</li><li><i>2</i> - smart-me Meter (1-Phase DIN Rail Meter) without switch</li><li><i>3</i> - smart-me Meter (1-Phase DIN Rail Meter) with a Switch</li><li><i>4</i> - smart-me M-BUS Gateway V1</li><li><i>5</i> - Reserved for the retired smart-me RS-485 Gateway V1</li><li><i>6</i> - MeterFamilyTypeKamstrupModule</li><li><i>7</i> - MeterFamilyTypeSmartMe3PhaseMeter80A</li><li><i>8</i> - smart-me 3-Phase Meter 32A (with Switch)</li><li><i>9</i> - smart-me 3-Phase Meter Transformer Edition</li><li><i>10</i> - smart-me Landis Gyr Module</li><li><i>11</i> - Optical module for the FNN meters</li><li><i>12</i> - smart-me 3-Phase Meter 80A with the new WiFi (V2)</li><li><i>14</i> - smart-me 3-Phase Meter 80A with Mobile</li><li><i>16</i> - smart-me 1-Phase Meter 80A with the new WiFi (V2)</li><li><i>17</i> - smart-me 1-Phase Meter 32A with the new WiFi (V2)</li><li><i>18</i> - smart-me 1-Phase Meter 80A with GPRS</li><li><i>19</i> - smart-me 1-Phase Meter 32A with GPRS</li><li><i>21</i> - smart-me 3-Phase Meter Transformer Edition with mobile module</li><li><i>65</i> - smart-me 3-phase Meter Nimbus (3-point meter)</li><li><i>70</i> - Mithral hall charging station Version 1</li><li><i>1001</i> - REST API Meter</li><li><i>1002</i> - Virtual billing Meter (e.g. for smart-me washroom)</li><li><i>1003</i> - M-BUS Meter read out by a smart-me M-BUS Gateway</li></ul>",
      "format": "int32"
    },
    "MeterSubType": {
      "enum": [
        0,
        1,
        2,
        3,
        4,
        5,
        6,
        7,
        8
      ],
      "type": "integer",
      "description": "<p>Members: </p><ul><li><i>0</i> - MeterSubTypeUnknown</li><li><i>1</i> - Cold / Cold Water Meter</li><li><i>2</i> - Heat / Hot Water Meter</li><li><i>3</i> - MeterSubTypeChargingStation</li><li><i>4</i> - MeterSubTypeElectricity</li><li><i>5</i> - MeterSubTypeWater</li><li><i>6</i> - MeterSubTypeGas</li><li><i>7</i> - Electricity / Heat meter</li><li><i>8</i> - A Temperature meter</li></ul>",
      "format": "int32"
    }
  }
}