Επιστροφή

 

API calls & Responses

/get_user_devices.php      

 

  • # /get_user_devices.php
    URL: https://dotsoft.gr/get_user_devices.php
     
    Returns user device information including floorplans, groups and allowances
     
    Parameters:  [GET/POST]
    - `access_token` or `api_key`
     
    Response:
    ```json
    {  
       "devices":[  
          {  
             "serialno":"12:0",
             "name":"Waterheater",
             "icon":"",
             "settings":{  
                "safe_outputs":false,
                "pin_code":"",
                "no_datalogging":false,
                "springy_outputs":false,
                "cost_per_kwh":0,
                "cost_per_kwh2":0,
                "gi_name":"\u0393\u03b5\u03bd. \u0395\u03af\u03c3.",
                "gi_closed":"\u03ba\u03bb\u03b5\u03b9\u03c3\u03c4\u03ae",
                "gi_open":"\u03b1\u03bd\u03bf\u03b9\u03ba\u03c4\u03ae",
                "gi2_name":"\u0393\u03b5\u03bd. \u0395\u03af\u03c3. 2",
                "gi2_closed":"\u03ba\u03bb\u03b5\u03b9\u03c3\u03c4\u03ae",
                "gi2_open":"\u03b1\u03bd\u03bf\u03b9\u03ba\u03c4\u03ae",
                "simple_reading":"",
                "summary_include":"default",
                "door_mode":false,
                "billing_start":0,
                "billing_interval":0,
                "fixed_cost":0,
                "billing_interval_unit":"months"
             },
             "floorplans":[  
    ...
             ],
             "groups":[  
    ...
             ],
             "features":{  
                "device":"12:0",
                "disaggregation":"1",
                "forecasting":"1"
             },
             "permissions":"2"
          },...],
       "messages":[  
     
       ],
       "user_id":0,
       "user_allowances":{  
          "group":{  
             "count":0,
             "allowed":1,
             "pass":true
          },
          "floorplan":{  
             "count":0,
             "allowed":3,
             "pass":true
          },
          "rule":{  
             "count":0,
             "allowed":1,
             "pass":true
          },
          "sms":0,
          "phonecalls":0
       }
    }
/device_command.php      
# /get_user_devices.php
URL: https://dotsoft.gr/get_user_devices.php
 
Returns user device information including floorplans, groups and allowances
 
Parameters:  [GET/POST]
- `access_token` or `api_key`
 
Response:
```json
{  
   "devices":[  
      {  
         "serialno":"12:0",
         "name":"Waterheater",
         "icon":"",
         "settings":{  
            "safe_outputs":false,
            "pin_code":"",
            "no_datalogging":false,
            "springy_outputs":false,
            "cost_per_kwh":0,
            "cost_per_kwh2":0,
            "gi_name":"\u0393\u03b5\u03bd. \u0395\u03af\u03c3.",
            "gi_closed":"\u03ba\u03bb\u03b5\u03b9\u03c3\u03c4\u03ae",
            "gi_open":"\u03b1\u03bd\u03bf\u03b9\u03ba\u03c4\u03ae",
            "gi2_name":"\u0393\u03b5\u03bd. \u0395\u03af\u03c3. 2",
            "gi2_closed":"\u03ba\u03bb\u03b5\u03b9\u03c3\u03c4\u03ae",
            "gi2_open":"\u03b1\u03bd\u03bf\u03b9\u03ba\u03c4\u03ae",
            "simple_reading":"",
            "summary_include":"default",
            "door_mode":false,
            "billing_start":0,
            "billing_interval":0,
            "fixed_cost":0,
            "billing_interval_unit":"months"
         },
         "floorplans":[  
...
         ],
         "groups":[  
...
         ],
         "features":{  
            "device":"12:0",
            "disaggregation":"1",
            "forecasting":"1"
         },
         "permissions":"2"
      },...],
   "messages":[  
 
   ],
   "user_id":0,
   "user_allowances":{  
      "group":{  
         "count":0,
         "allowed":1,
         "pass":true
      },
      "floorplan":{  
         "count":0,
         "allowed":3,
         "pass":true
      },
      "rule":{  
         "count":0,
         "allowed":1,
         "pass":true
      },
      "sms":0,
      "phonecalls":0
   }
}
/virtual_device_update.php      
  • # /virtual_device_update.php
    URL: https://dotsoft.gr/virtual_device_update.php
    Parameters [JSON]
    - `access_token` or `api_key`for authentication
    - `serialno` of the device
    - `R` the readings in the device state format, refer to  [command](commands) for details
     
    It is important to use "u#" for the readings, where # is the index of the reading in the order that is configured in the virtual device settings. 
     
    Example request (v:x), is the serialno :
    ```json
    {
      "api_key": "YOUR_API_KEY",
      "serialno": "v:1",
      "R": {
        "u0": 1200000,
        "u1": 1,
        "u2": 1,
        "u3": 1,
        "u4": 1,
        "u5": 1
      }
    }
     
    ```
    The response includes the "current" state of the device. Example response for the request above:
     
    ```json
    {
        "messages": [],
        "response": {
            "error": "",
            "data": {
                "serialno": "v:1",
                "untime": "1558713914.902",
                "disconnected": false,
                "updating": false,
                "R": {
                    "u0": 1200000,
                    "u1": 1,
                    "u2": 1,
                    "u3": 1,
                    "u4": 1,
                    "u5": 1
                },
                "family": "v"
            }
        }
    }
 

Response Messages

HTTP Status Code Reason Response Model Headers
200

Ok

 
204

No Content

 
400

Bad Request

 
401

Unauthorized

 
403

Forbidden

 
405

Method Not Allowed

 
500

Internal Server Error