MClimate API Documentation
  • MClimate API Documentation
  • MClimate LoRaWAN Devices
  • Basic endpoints
  • API Control - LoRaWAN devices
    • Vicki LoRaWAN
    • HT Sensor LoRaWAN
    • CO2 Sensor LoRaWAN
    • T-Valve LoRaWAN
    • Flood Sensor LoRaWAN
    • Open/Close Sensor LoRaWAN
    • Multipurpose Button LoRaWAN
    • Wireless Thermostat LoRaWAN
    • CO2 Display LoRaWAN
    • Fan Coil Thermostat LoRaWAN
  • API Control - wifi devices
    • Melissa
    • Bobbie
    • Smart Plug
    • Vicki LoRa
      • Vicki high priority commands
      • Summer Mode
    • HT Sensor LoRa
  • Functions
    • Schedules
    • Heating profiles
    • Thermostat mode
    • LoRaWAN FUOTA
    • M Token
    • Assign devices
Powered by GitBook
On this page
  • Fetch
  • Switch Plug On/Off
  • Default State
  • Max Power Turn Off
  • Automatic Turn On/Off
  1. API Control - wifi devices

Smart Plug

Fetch

Request URL:

POST /provider/fetch

Headers:

Content-Type: application/json
Authorization: Bearer {access_token}

Body:

{
  "serial_number" : "{Smart Plug Serial Number}"
}

Response:

{
    "provider": {
        "online": true,
        "power": [
            0
        ]
    },
    "_links": {
        "self": {
            "href": "/v1/provider/fetch"
        }
    }
}

Switch Plug On/Off

Request URL:

POST /provider/send

Headers:

Content-Type: application/json
Authorization: Bearer {access_token}

Body:

{
  "serial_number": “{Smart Plug Serial Number}”,
  "command" : "switch_on_off",
  "state" : "on"  //receives values “on”/“off”
}

Response:

{
  "provider": {
      "isok": true,
      "id": 8****3,
      "type": "relay",
      "code": "SHPLG-1"
  },
  "_links": {
      "self": {
          "href": "/v1/provider/send"
      }
  }
}

Default State

Request URL:

POST /provider/send

Headers:

Content-Type: application/json
Authorization: Bearer {access_token}

Body:

{
  "serial_number": “{Smart Plug Serial Number}”,
  "command" : "default_switch",
  "state" : "last"  // Default power-on state ("off", "on", "last")
}

Response:

{
  "provider": {
      "isok": true,
      "id": 81****3,
      "type": "relay",
      "code": "SHPLG-1"
  },
  "_links": {
      "self": {
          "href": "/v1/provider/send"
      }
  }
}

Max Power Turn Off

Request URL:

POST /provider/send

Headers:

Content-Type: application/json
Authorization: Bearer {access_token}

Body:

{
  "serial_number": “{Smart Plug Serial Number}”,
  "command" : "max_power_turn_off",
  "max_power" : 3000  // overpower threshold in Watts
}

Response:

{
  "provider": {
      "isok": true,
      "id": 8*****93,
      "type": "relay",
      "code": "SHPLG-1"
  },
  "_links": {
      "self": {
          "href": "/v1/provider/send"
      }
  }
}

Automatic Turn On/Off

Request URL:

POST /provider/send

Headers:

Content-Type: application/json
Authorization: Bearer {access_token}

Body:

{
  "serial_number": “{Smart Plug Serial Number}”,
  "command" : "auto_switch",// Automatic flip back timer, seconds. 
  "state" : "on", // Will engage after turning the plug ON or OFF
  "timeout": 5 // Seconds, 0 = OFF
}

Response:

{
  "provider": {
      "isok": true,
      "id": 8*****3,
      "type": "relay",
      "code": "SHPLG-1"
  },
  "_links": {
      "self": {
          "href": "/v1/provider/send"
      }
  }
}
PreviousBobbieNextVicki LoRa

Last updated 3 years ago