{
  "swagger": "2.0",
  "info": {
    "title": "myStrom",
    "description": "myStrom is a Swiss company producing smart home devices. With this connector it is possible to control myStrom devices over the REST API.",
    "version": "1.0",
    "contact": {
      "name": "Tomasz Poszytek",
      "url": "https://aka.ms/poszytek",
      "email": "tomasz@poszytek.eu"
    }
  },
  "x-ms-connector-metadata": [
    {
      "propertyName": "Website",
      "propertyValue": "https://mystrom.ch/"
    },
    {
      "propertyName": "Privacy policy",
      "propertyValue": "https://mystrom.ch/privacy-policy/"
    },
    {
      "propertyName": "Categories",
      "propertyValue": "Internet of Things;Lifestyle and Entertainment"
    }
  ],
  "host": "mystrom.ch",
  "basePath": "/api/v2/",
  "schemes": [
    "https"
  ],
  "consumes": [
    "application/json"
  ],
  "produces": [
    "application/json"
  ],
  "paths": {
    "/auth": {
      "get": {
        "responses": {
          "200": {
            "description": "Correct response",
            "schema": {
              "type": "object",
              "properties": {
                "authToken": {
                  "type": "string",
                  "description": "Token to be used to authenticate other requests.",
                  "title": "Authentication token"
                }
              }
            }
          },
          "400": {
            "description": "Error response",
            "schema": {
              "type": "object",
              "properties": {
                "code": {
                  "type": "integer",
                  "format": "int32",
                  "title": "Code"
                },
                "message": {
                  "type": "string",
                  "title": "Message"
                }
              }
            }
          }
        },
        "summary": "Authentication",
        "description": "Obtain authToken by providing your e-mail and password.",
        "operationId": "Auth",
        "parameters": [
          {
            "name": "email",
            "in": "query",
            "required": true,
            "type": "string",
            "description": "myStrom account e-mail",
            "x-ms-summary": "E-mail",
            "x-ms-visibility": "important"
          },
          {
            "name": "password",
            "in": "query",
            "required": true,
            "type": "string",
            "description": "myStrom account password",
            "x-ms-summary": "Password",
            "format": "password",
            "x-ms-visibility": "important"
          }
        ],
        "x-ms-visibility": "important"
      }
    },
    "/devices": {
      "get": {
        "responses": {
          "200": {
            "description": "Correct response",
            "schema": {
              "type": "object",
              "properties": {
                "devices": {
                  "type": "array",
                  "items": {
                    "type": "object",
                    "properties": {
                      "id": {
                        "type": "string",
                        "title": "Device ID"
                      },
                      "name": {
                        "type": "string",
                        "title": "Name"
                      },
                      "power": {
                        "type": "number",
                        "description": "Current power consumption (W).",
                        "title": "Power",
                        "format": "float"
                      },
                      "type": {
                        "type": "string",
                        "description": "Device's type.",
                        "title": "Type"
                      },
                      "state": {
                        "type": "string",
                        "description": "ON or OFF.",
                        "title": "State"
                      },
                      "color": {
                        "type": "string",
                        "description": "In HSV format.",
                        "title": "Color"
                      },
                      "temperature": {
                        "type": "number",
                        "description": "Current temperature (C).",
                        "title": "Temperature",
                        "format": "float"
                      },
                      "brightness": {
                        "type": "integer",
                        "title": "Brightness",
                        "format": "int32"
                      }
                    }
                  },
                  "description": "devices"
                }
              }
            }
          },
          "400": {
            "description": "Error response",
            "schema": {
              "type": "object",
              "properties": {
                "code": {
                  "type": "integer",
                  "format": "int32",
                  "title": "Code"
                },
                "message": {
                  "type": "string",
                  "title": "Message"
                }
              }
            }
          }
        },
        "summary": "Get devices",
        "description": "Get list of all user's devices",
        "operationId": "GetDevices",
        "parameters": [
          {
            "name": "authToken",
            "in": "query",
            "required": true,
            "type": "string",
            "description": "Authentication Token",
            "x-ms-summary": "Authentication Token",
            "format": "password",
            "x-ms-visibility": "important"
          }
        ]
      }
    },
    "/device/{Device ID}": {
      "get": {
        "responses": {
          "200": {
            "description": "Correct response",
            "schema": {
              "type": "object",
              "properties": {
                "id": {
                  "type": "string",
                  "title": "Device ID"
                },
                "name": {
                  "type": "string",
                  "title": "Name"
                },
                "power": {
                  "type": "number",
                  "description": "Current power consumption (W).",
                  "title": "Power",
                  "format": "float"
                },
                "type": {
                  "type": "string",
                  "description": "Device's type.",
                  "title": "Type"
                },
                "state": {
                  "type": "string",
                  "description": "ON or OFF.",
                  "title": "State"
                },
                "color": {
                  "type": "string",
                  "description": "In HSV format.",
                  "title": "Color"
                },
                "temperature": {
                  "type": "number",
                  "description": "Current temperature (C).",
                  "title": "Temperature",
                  "format": "float"
                },
                "brightness": {
                  "type": "integer",
                  "title": "Brightness",
                  "format": "int32"
                }
              }
            }
          },
          "400": {
            "description": "Error response",
            "schema": {
              "type": "object",
              "properties": {
                "code": {
                  "type": "integer",
                  "format": "int32",
                  "title": "Code"
                },
                "message": {
                  "type": "string",
                  "title": "Message"
                }
              }
            }
          }
        },
        "summary": "Get device",
        "description": "Get device by ID",
        "operationId": "GetDevice",
        "parameters": [
          {
            "name": "Device ID",
            "in": "path",
            "required": true,
            "type": "string",
            "description": "Device ID",
            "x-ms-summary": "Device ID",
            "x-ms-visibility": "important",
            "x-ms-url-encoding": "single"
          },
          {
            "name": "authToken",
            "in": "query",
            "required": true,
            "type": "string",
            "description": "Authentication Token",
            "x-ms-summary": "Authentication Token",
            "format": "password",
            "x-ms-visibility": "important"
          }
        ]
      },
      "post": {
        "responses": {
          "200": {
            "description": "Correct response",
            "schema": {
              "type": "object",
              "properties": {
                "code": {
                  "type": "integer",
                  "format": "int32",
                  "title": "Code"
                },
                "message": {
                  "type": "string",
                  "title": "Message"
                },
                "color": {
                  "type": "string",
                  "description": "Current color in HSV format.",
                  "title": "Color"
                }
              }
            }
          },
          "400": {
            "description": "Error response",
            "schema": {
              "type": "object",
              "properties": {
                "code": {
                  "type": "integer",
                  "format": "int32",
                  "title": "Code"
                },
                "message": {
                  "type": "string",
                  "title": "Message"
                }
              }
            }
          }
        },
        "summary": "Toggle device",
        "description": "Device toggle request is used to change state of a device and set its parameters",
        "operationId": "ToggleDevice",
        "parameters": [
          {
            "name": "Device ID",
            "in": "path",
            "required": true,
            "type": "string",
            "description": "Device ID",
            "x-ms-summary": "Device ID",
            "x-ms-visibility": "important",
            "x-ms-url-encoding": "single"
          },
          {
            "name": "color",
            "in": "query",
            "required": false,
            "type": "string",
            "description": "The color we set the bulb to. HSV is of form <UINT 0..360>;<UINT 0..100>;<UINT 0..100>",
            "x-ms-summary": "Color",
            "x-ms-visibility": "advanced"
          },
          {
            "name": "ramp",
            "in": "query",
            "required": false,
            "type": "integer",
            "description": "Transition time from the light's current state to the new state. [ms]",
            "x-ms-summary": "Ramp",
            "x-ms-visibility": "advanced"
          },
          {
            "name": "value",
            "in": "query",
            "required": false,
            "type": "integer",
            "description": "Dim value for devices that support dim action",
            "x-ms-summary": "Dim Value",
            "x-ms-visibility": "advanced"
          },
          {
            "name": "action",
            "in": "query",
            "required": true,
            "type": "string",
            "default": "on",
            "description": "Switch action",
            "x-ms-summary": "Action",
            "enum": [
              "on",
              "off",
              "toggle",
              "dim"
            ]
          },
          {
            "name": "authToken",
            "in": "query",
            "required": true,
            "type": "string",
            "description": "Authentication Token",
            "x-ms-summary": "Authentication Token",
            "format": "password",
            "x-ms-visibility": "important"
          }
        ]
      }
    },
    "/scenes": {
      "get": {
        "responses": {
          "200": {
            "description": "Correct response",
            "schema": {
              "type": "object",
              "properties": {
                "scenes": {
                  "type": "array",
                  "items": {
                    "type": "object",
                    "properties": {
                      "id": {
                        "type": "string",
                        "title": "Scene ID"
                      },
                      "name": {
                        "type": "string",
                        "title": "Name"
                      }
                    }
                  },
                  "description": "scenes"
                }
              }
            }
          },
          "400": {
            "description": "Error response",
            "schema": {
              "type": "object",
              "properties": {
                "code": {
                  "type": "integer",
                  "format": "int32",
                  "title": "Code"
                },
                "message": {
                  "type": "string",
                  "title": "Message"
                }
              }
            }
          }
        },
        "summary": "Get scenes",
        "description": "Get list of all user's scenes",
        "operationId": "GetScenes",
        "parameters": [
          {
            "name": "authToken",
            "in": "query",
            "required": true,
            "type": "string",
            "description": "Authentication Token",
            "x-ms-summary": "Authentication Token",
            "format": "password",
            "x-ms-visibility": "important"
          }
        ],
        "x-ms-visibility": "advanced"
      }
    },
    "/scene/{Scene ID}": {
      "get": {
        "responses": {
          "200": {
            "description": "Response",
            "schema": {
              "type": "object",
              "properties": {
                "code": {
                  "type": "integer",
                  "format": "int32",
                  "title": "Code"
                },
                "message": {
                  "type": "string",
                  "title": "Message"
                }
              }
            }
          }
        },
        "summary": "Execute scene",
        "description": "Execute scene by ID",
        "operationId": "ExecuteScene",
        "parameters": [
          {
            "name": "Scene ID",
            "in": "path",
            "required": true,
            "type": "string",
            "description": "Scene ID",
            "x-ms-summary": "Scene ID",
            "x-ms-visibility": "important",
            "x-ms-url-encoding": "single"
          },
          {
            "name": "authToken",
            "in": "query",
            "required": true,
            "type": "string",
            "description": "Authentication Token",
            "x-ms-summary": "Authentication Token",
            "format": "password",
            "x-ms-visibility": "important"
          }
        ],
        "x-ms-visibility": "advanced"
      }
    },
    "/webhook/{Device ID}": {
      "get": {
        "responses": {
          "400": {
            "description": "Error response",
            "schema": {
              "type": "object",
              "properties": {
                "code": {
                  "type": "integer",
                  "format": "int32",
                  "title": "Code"
                },
                "message": {
                  "type": "string",
                  "title": "Message"
                }
              }
            }
          }
        },
        "summary": "Get webhook",
        "description": "Get webhook by device ID",
        "operationId": "GetWebhook",
        "parameters": [
          {
            "name": "Device ID",
            "in": "path",
            "required": true,
            "type": "string",
            "description": "Device ID",
            "x-ms-summary": "Device ID",
            "x-ms-visibility": "important",
            "x-ms-url-encoding": "single"
          },
          {
            "name": "authToken",
            "in": "query",
            "required": true,
            "type": "string",
            "description": "Authentication Token",
            "x-ms-summary": "Authentication Token",
            "format": "password",
            "x-ms-visibility": "important"
          }
        ],
        "x-ms-visibility": "advanced"
      },
      "delete": {
        "responses": {
          "200": {
            "description": "Response",
            "schema": {
              "type": "object",
              "properties": {
                "code": {
                  "type": "integer",
                  "format": "int32",
                  "title": "Code"
                },
                "message": {
                  "type": "string",
                  "title": "Message"
                }
              }
            }
          }
        },
        "summary": "Delete webhook",
        "description": "Delete webhook by device ID",
        "operationId": "DeleteWebhook",
        "parameters": [
          {
            "name": "Device ID",
            "in": "path",
            "required": true,
            "type": "string",
            "description": "Device ID",
            "x-ms-summary": "Device ID",
            "x-ms-visibility": "important",
            "x-ms-url-encoding": "single"
          },
          {
            "name": "authToken",
            "in": "query",
            "required": true,
            "type": "string",
            "description": "Authentication Token",
            "x-ms-summary": "Authentication Token",
            "format": "password",
            "x-ms-visibility": "important"
          }
        ],
        "x-ms-visibility": "advanced"
      },
      "post": {
        "responses": {
          "200": {
            "description": "Response",
            "schema": {
              "type": "object",
              "properties": {
                "code": {
                  "type": "integer",
                  "format": "int32",
                  "title": "Code"
                },
                "message": {
                  "type": "string",
                  "title": "Message"
                }
              }
            }
          }
        },
        "summary": "Create webhook",
        "description": "Create webhook",
        "operationId": "CreateWebhook",
        "parameters": [
          {
            "name": "Device ID",
            "in": "path",
            "required": true,
            "type": "string",
            "x-ms-visibility": "important",
            "description": "Device ID",
            "x-ms-summary": "Device ID",
            "x-ms-url-encoding": "single"
          },
          {
            "name": "webhook",
            "in": "query",
            "required": true,
            "type": "string",
            "description": "Webhook Definition, sample: {\"url\":\"http://example.com\",\"config\":{\"state\": true,\"power\":true}}",
            "x-ms-summary": "Webhook Definition"
          },
          {
            "name": "authToken",
            "in": "query",
            "required": true,
            "type": "string",
            "description": "Authentication Token",
            "x-ms-summary": "Authentication Token",
            "format": "password",
            "x-ms-visibility": "important"
          },
          {
            "name": "Content-Type",
            "in": "header",
            "required": true,
            "type": "string",
            "default": "application/json",
            "description": "Content-Type",
            "x-ms-summary": "Content-Type",
            "x-ms-visibility": "internal"
          },
          {
            "name": "body",
            "in": "body",
            "required": false,
            "schema": {
              "type": "object",
              "properties": {},
              "x-ms-visibility": "advanced"
            },
            "x-ms-visibility": "advanced"
          }
        ],
        "x-ms-visibility": "advanced"
      }
    }
  },
  "definitions": {},
  "parameters": {},
  "responses": {},
  "securityDefinitions": {},
  "security": [],
  "tags": []
}