---
updatedAt: 2026-03-31T12:12:41.000Z
agentTools:
  projectIndex: https://api.net2grid.com/llms.txt
---

# /plug/relay

This endpoint returns the state of the relay button of the Smart Plug.
     It is applicable only to gateways with Smart Plug functionality like SPLR4911.
     These devices can measure and/or control the load of an appliance
     that is directly connected to it's integrated schuko socket.

# OpenAPI definition

```json
{
  "openapi": "3.0.0",
  "info": {
    "title": "NET2GRID Customer Engagement API",
    "description": "This is the B2C NET2GRID API that can be used by mobile and web apps to manage the accounts and the data that are provided by the NET2GRID Meter Data Analytics Platform.",
    "version": "13.6.0"
  },
  "servers": [
    {
      "url": "http://api.net2grid.docker",
      "description": "API server"
    }
  ],
  "paths": {
    "/v2/plug/relay": {
      "get": {
        "tags": [
          "Device Management"
        ],
        "summary": "/plug/relay",
        "description": "This endpoint returns the state of the relay button of the Smart Plug.\n     It is applicable only to gateways with Smart Plug functionality like SPLR4911.\n     These devices can measure and/or control the load of an appliance\n     that is directly connected to it's integrated schuko socket.",
        "operationId": "v2getPlugRelay",
        "responses": {
          "200": {
            "description": "OK",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/GetPlugRelayResponseDTO"
                },
                "examples": {
                  "GetPlugRelayExample": {
                    "$ref": "#/components/examples/GetPlugRelayExample"
                  }
                }
              }
            }
          },
          "400": {
            "description": "Invalid Request <br/>152: User does not have a valid household object.\n     <br/>153: No valid meter found for user.<br/>270: The gateway doesn't support this command.\n     <br/>999: Unspecified error.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ErrorResponseDTO"
                }
              }
            }
          }
        },
        "security": [
          {
            "bearerAuth": []
          }
        ]
      }
    }
  },
  "components": {
    "schemas": {
      "GetPlugRelayDataDTO": {
        "required": [
          "relay",
          "timestamp"
        ],
        "properties": {
          "relay": {
            "$ref": "#/components/schemas/RelayDTO"
          },
          "timestamp": {
            "description": "Timestamp at the time of execution in ISO-8601 format.",
            "type": "string"
          }
        },
        "type": "object"
      },
      "GetPlugRelayResponseDTO": {
        "required": [
          "status",
          "data"
        ],
        "properties": {
          "status": {
            "type": "string"
          },
          "data": {
            "$ref": "#/components/schemas/GetPlugRelayDataDTO"
          }
        },
        "type": "object"
      },
      "RelayDTO": {
        "required": [
          "on_off",
          "timestamp"
        ],
        "properties": {
          "on_off": {
            "description": "On-off value of relay. 0 if the relay is off, 1 if the relay is on.",
            "type": "integer",
            "enum": [
              0,
              1
            ]
          },
          "timestamp": {
            "description": "The UTC timestamp when the state was last reported by the Smart Plug in ISO-8601 format.",
            "type": "string"
          }
        },
        "type": "object"
      },
      "ErrorDTO": {
        "properties": {
          "code": {
            "type": "integer"
          },
          "message": {
            "type": "string"
          }
        },
        "type": "object"
      },
      "ErrorResponseDTO": {
        "properties": {
          "status": {
            "type": "string"
          },
          "error": {
            "$ref": "#/components/schemas/ErrorDTO"
          }
        },
        "type": "object"
      }
    },
    "examples": {
      "GetPlugRelayExample": {
        "summary": "Get plug relay response",
        "value": {
          "status": "ok",
          "data": {
            "relay": {
              "on_off": 0,
              "timestamp": "2023-03-20T10:06:00+02:00"
            },
            "timestamp": "2023-03-20T13:11:56+02:00"
          }
        }
      }
    },
    "securitySchemes": {
      "bearerAuth": {
        "type": "http",
        "bearerFormat": "JWT",
        "scheme": "bearer"
      }
    }
  },
  "tags": [
    {
      "name": "Device Management",
      "description": "Device Management"
    }
  ],
  "x-explorer-enabled": false
}
```