Back to top

Futurehome General API

⚠️ Deprecated ⚠️

This API is deprecated and will no longer be developed.

Important general information about the Futurehome API:

The API uses a simple version of HATEOAS for API navigation, meaning that all requests you make are likely to include fields called_links,_embeddedand in some cases_actions.

_linkstell you how you can traverse the resource you requested. For example, if you request a room instance, the_linkswill point you to other requests letting you access a data stream, a list of devices in that room and, for completion, a link to the room you just requested.

Embedded

_embeddedincludes information not directly related to the resource you requested, but information you’d most likely want. For example, when requesting the sites collection, you might get information about how many sites you have, and the_embeddedfield will include the list of sites available to you.

Actions

_actionsis present if you can perform any actions on the resource you requested. The field contains enough information for you to be able to construct the action request.

Data streams

The_linksfield will more often than not include a link to a stream path - a link to a data stream over websockets. To connect to this stream, open a websocket connection to the link, passing your access_token as a url variable, e.g.

wss://futurehome.no/api/v2/sites/active/stream?access_token=ITbf505Cb3OxbUiPYoellqlQCTu4QFBe8m3Zn473

Subscribing to a site will stream changes from the entire site. You can also subscribe to a single room or even a single device by adding/streamto the end of an appropriate request, e.g.

wss://futurehome.no/api/v2/sites/active/rooms/1/devices/2/stream?access_token=ITbf505Cb3OxbUiPYoellqlQCTu4QFBe8m3Zn473

Authentication

Note that authentication requests use the v1 api without theapiprefix.

Access token

Access token response has the following attributes.

  • access_token: The access token to put in the Authorization header.

  • token_type: Type of token, always “Bearer”.

  • expires_in: How long the token is valid. Use this as an indicator for when the token needs to be refreshed.

  • refresh_token: Token to be used when requesting a new access token.

Every request needs to include an Authorization header with a valid access_token

Authorization: bearer aF2MyKIs8Xvbt3ltu1MgNU6Y12xKfTfCEafhACoe

Retrieve access token
POST/v1/oauth/access_token

Important notes:

  • Ensure that post parameters are sent as application/x-www-form-urlencoded.

  • Set grant_type topasswordto get an access token.usernameandpasswordwill then be required.

  • Set grant_type torefresh_tokento refresh an access token.refresh_tokenwill then be required.

  • client_id is required and should be set to6Bp41CjtAZiYvHo6X02h

  • client_secret is required and should be set togaxtTWvFa21O8y4Fs3pV

Example URI

POST /v1/oauth/access_token
Request
HideShow
Headers
Content-Type: application/x-www-form-urlencoded
Body
- client_id (required)
- client_secret (required)
- grant_type (required)
- username (optional)
- password (optional)
- refresh_token (optional)
Response  200
HideShow
Headers
Content-Type: application/json
Body
[
  {
    "access_token": "3dem0GNy2qQb9zc7yaXMB5EdneYGmIycl5k3q9pX",
    "token_type": "Bearer",
    "expires_in": 2592000,
    "refresh_token": "tP39QHNqSUG7t7sBgVAHYqGtOQUYdidJsFKLGT2T"
  }
]

Authentication check

Check if token is valid
GET/v1/auth/check

In addition to being able to check the validity of a token, this endpoint returns simple user information for the user if it is valid.

Example URI

GET /v1/auth/check
Response  200
HideShow
Headers
Content-Type: application/json
Body
[
  {
    "success": true,
    "user": {
      "firstname": "Stian",
      "lastname": "Øien",
      "email": "support@futurehome.no",
      "phone": null,
      "address": null,
      "zip": 0,
      "city": null,
      "country": "NO"
    }
  }
]

Sites

Endpoints directly related to your site.

Site

A site has the following attributes.

  • id: The ID of the site.

  • mode: What mode is currently active.

  • name: The name of the site.

  • online: Whether the Smarthub is online or not.

  • owner: Who is listed as the owner of the site.

  • telemetry: Information about the weather at the site’s location.

  • temperature: inside and outside temperature at the site’s location.

  • update: whether there’s an update available and how many.

  • version: what software versions the Smarthub is running.

Get site
GET/api/v2/sites/{siteId}

Gets detailed information about a single site.

Note: The siteId can be set toactive, in which case the currently selected site the authenticated user is on will be returned.

Example URI

GET /api/v2/sites/siteId
URI Parameters
HideShow
siteId
string (optional) 
Response  200
HideShow
Headers
Content-Type: application/json
Body
[
  {
    "version": {
      "vinculum": "2.1.9+hotfix4",
      "unicomplex": "1.2.5+hotfix9",
      "nanoprobe": "1.1.1",
      "futurehome-security": "1.0.0",
      "futurehome-core": "1.2",
      "futurehome": "1.3.9+hotfix5",
      "application": "v1-4-0"
    },
    "update": 0,
    "temperature": {
      "outside": null,
      "inside": 28.1
    },
    "telemetry": null,
    "owner": {
      "name": "Stian Øien",
      "id": "support@futurehome.no"
    },
    "online": true,
    "name": "Smarthusgata 9",
    "mode": "sleep",
    "id": "D027F68E-A03F-43D5-BBFE-1DC93D905D55",
    "_links": {
      "stream": {
        "href": "/sites/D027F68E-A03F-43D5-BBFE-1DC93D905D55/stream"
      },
      "stats": {
        "href": "/sites/D027F68E-A03F-43D5-BBFE-1DC93D905D55/stats"
      },
      "shortcuts": {
        "href": "/sites/D027F68E-A03F-43D5-BBFE-1DC93D905D55/shortcuts"
      },
      "self": {
        "href": "/sites/D027F68E-A03F-43D5-BBFE-1DC93D905D55"
      },
      "rooms": {
        "href": "/sites/D027F68E-A03F-43D5-BBFE-1DC93D905D55/rooms"
      },
      "fragments": {
        "href": "/sites/D027F68E-A03F-43D5-BBFE-1DC93D905D55/fragments"
      },
      "devices": {
        "href": "/sites/D027F68E-A03F-43D5-BBFE-1DC93D905D55/devices"
      }
    },
    "_embedded": {
      "shortcuts": [
        {
          "name": "Venstre",
          "id": "1"
        }
      ],
      "rooms": [
        {
          "type": "living",
          "name": null,
          "id": "1",
          "_links": {
            "stream": {
              "href": "/sites/D027F68E-A03F-43D5-BBFE-1DC93D905D55/rooms/1/stream"
            },
            "self": {
              "href": "/sites/D027F68E-A03F-43D5-BBFE-1DC93D905D55/rooms/1"
            },
            "devices": {
              "href": "/sites/D027F68E-A03F-43D5-BBFE-1DC93D905D55/rooms/1/devices"
            }
          },
          "_embedded": {
            "devices": [
              {
                "room": 1,
                "name": "Taklys",
                "model": "FGD_212",
                "id": 1,
                "functionality": "lighting",
                "_links": {
                  "stream": {
                    "href": "/sites/D027F68E-A03F-43D5-BBFE-1DC93D905D55/devices/1/stream"
                  },
                  "self": {
                    "href": "/sites/D027F68E-A03F-43D5-BBFE-1DC93D905D55/devices/1"
                  }
                },
                "_actions": [
                  {
                    "href": "/sites/D027F68E-A03F-43D5-BBFE-1DC93D905D55/devices/1",
                    "name": "power",
                    "method": "PATCH",
                    "fields": [
                      {
                        "type": "enum",
                        "optional": false,
                        "name": "power",
                        "allowed_value": [
                          "on",
                          "off"
                        ]
                      }
                    ],
                    "description": "Set the powered status of a device."
                  },
                  {
                    "href": "/sites/D027F68E-A03F-43D5-BBFE-1DC93D905D55/devices/1",
                    "name": "dimmer",
                    "method": "PATCH",
                    "fields": [
                      {
                        "type": "integer",
                        "optional": false,
                        "name": "dimValue",
                        "allowed_value": [
                          1,
                          100
                        ]
                      }
                    ],
                    "description": "Set the desired dimValue for a device."
                  }
                ]
              },
              {
                "room": 1,
                "name": "Sensor",
                "model": "FGMS_001",
                "id": 5,
                "functionality": null,
                "_links": {
                  "stream": {
                    "href": "/sites/D027F68E-A03F-43D5-BBFE-1DC93D905D55/devices/5/stream"
                  },
                  "self": {
                    "href": "/sites/D027F68E-A03F-43D5-BBFE-1DC93D905D55/devices/5"
                  }
                },
                "_actions": []
              },
              {
                "room": 1,
                "name": "Takvindu",
                "model": "giljestrip",
                "id": 6,
                "functionality": null,
                "_links": {
                  "stream": {
                    "href": "/sites/D027F68E-A03F-43D5-BBFE-1DC93D905D55/devices/6/stream"
                  },
                  "self": {
                    "href": "/sites/D027F68E-A03F-43D5-BBFE-1DC93D905D55/devices/6"
                  }
                },
                "_actions": []
              }
            ]
          },
          "_actions": []
        },
        {
          "type": "kitchen",
          "name": null,
          "id": "2",
          "_links": {
            "stream": {
              "href": "/sites/D027F68E-A03F-43D5-BBFE-1DC93D905D55/rooms/2/stream"
            },
            "self": {
              "href": "/sites/D027F68E-A03F-43D5-BBFE-1DC93D905D55/rooms/2"
            },
            "devices": {
              "href": "/sites/D027F68E-A03F-43D5-BBFE-1DC93D905D55/rooms/2/devices"
            }
          },
          "_embedded": {
            "devices": []
          },
          "_actions": []
        },
        {
          "type": "bath",
          "name": null,
          "id": "3",
          "_links": {
            "stream": {
              "href": "/sites/D027F68E-A03F-43D5-BBFE-1DC93D905D55/rooms/3/stream"
            },
            "self": {
              "href": "/sites/D027F68E-A03F-43D5-BBFE-1DC93D905D55/rooms/3"
            },
            "devices": {
              "href": "/sites/D027F68E-A03F-43D5-BBFE-1DC93D905D55/rooms/3/devices"
            }
          },
          "_embedded": {
            "devices": [
              {
                "room": 3,
                "name": "Håndkle tørker",
                "model": "zwave",
                "id": 2,
                "functionality": "appliance",
                "_links": {
                  "stream": {
                    "href": "/sites/D027F68E-A03F-43D5-BBFE-1DC93D905D55/devices/2/stream"
                  },
                  "self": {
                    "href": "/sites/D027F68E-A03F-43D5-BBFE-1DC93D905D55/devices/2"
                  }
                },
                "_actions": []
              }
            ]
          },
          "_actions": []
        },
        {
          "type": "bed",
          "name": null,
          "id": "4",
          "_links": {
            "stream": {
              "href": "/sites/D027F68E-A03F-43D5-BBFE-1DC93D905D55/rooms/4/stream"
            },
            "self": {
              "href": "/sites/D027F68E-A03F-43D5-BBFE-1DC93D905D55/rooms/4"
            },
            "devices": {
              "href": "/sites/D027F68E-A03F-43D5-BBFE-1DC93D905D55/rooms/4/devices"
            }
          },
          "_embedded": {
            "devices": [
              {
                "room": 4,
                "name": "Fibaro magnet",
                "model": "auto",
                "id": 10,
                "functionality": null,
                "_links": {
                  "stream": {
                    "href": "/sites/D027F68E-A03F-43D5-BBFE-1DC93D905D55/devices/10/stream"
                  },
                  "self": {
                    "href": "/sites/D027F68E-A03F-43D5-BBFE-1DC93D905D55/devices/10"
                  }
                },
                "_actions": []
              },
              {
                "room": 4,
                "name": "Rgb lys",
                "model": "aeotec_LED_bulb",
                "id": 8,
                "functionality": "lighting",
                "_links": {
                  "stream": {
                    "href": "/sites/D027F68E-A03F-43D5-BBFE-1DC93D905D55/devices/8/stream"
                  },
                  "self": {
                    "href": "/sites/D027F68E-A03F-43D5-BBFE-1DC93D905D55/devices/8"
                  }
                },
                "_actions": [
                  {
                    "href": "/sites/D027F68E-A03F-43D5-BBFE-1DC93D905D55/devices/8",
                    "name": "power",
                    "method": "PATCH",
                    "fields": [
                      {
                        "type": "enum",
                        "optional": false,
                        "name": "power",
                        "allowed_value": [
                          "on",
                          "off"
                        ]
                      }
                    ],
                    "description": "Set the powered status of a device."
                  },
                  {
                    "href": "/sites/D027F68E-A03F-43D5-BBFE-1DC93D905D55/devices/8",
                    "name": "dimmer",
                    "method": "PATCH",
                    "fields": [
                      {
                        "type": "integer",
                        "optional": false,
                        "name": "dimValue",
                        "allowed_value": [
                          1,
                          100
                        ]
                      }
                    ],
                    "description": "Set the desired dimValue for a device."
                  },
                  {
                    "href": "/sites/D027F68E-A03F-43D5-BBFE-1DC93D905D55/devices/8",
                    "name": "wWcWRGB",
                    "method": "PATCH",
                    "fields": [
                      {
                        "type": "int",
                        "optional": false,
                        "name": "warm_white",
                        "allowed_value": [
                          0,
                          255
                        ]
                      },
                      {
                        "type": "int",
                        "optional": false,
                        "name": "cold_white",
                        "allowed_value": [
                          0,
                          255
                        ]
                      },
                      {
                        "type": "int",
                        "optional": false,
                        "name": "red",
                        "allowed_value": [
                          0,
                          255
                        ]
                      },
                      {
                        "type": "int",
                        "optional": false,
                        "name": "green",
                        "allowed_value": [
                          0,
                          255
                        ]
                      },
                      {
                        "type": "int",
                        "optional": false,
                        "name": "blue",
                        "allowed_value": [
                          0,
                          255
                        ]
                      }
                    ],
                    "description": "Set the wWcWRGB state of a device."
                  }
                ]
              },
              {
                "room": 4,
                "name": "Test modus bryter",
                "model": "FH-MODE",
                "id": 9,
                "functionality": "input",
                "_links": {
                  "stream": {
                    "href": "/sites/D027F68E-A03F-43D5-BBFE-1DC93D905D55/devices/9/stream"
                  },
                  "self": {
                    "href": "/sites/D027F68E-A03F-43D5-BBFE-1DC93D905D55/devices/9"
                  }
                },
                "_actions": []
              }
            ]
          },
          "_actions": []
        },
        {
          "type": "entrance",
          "name": null,
          "id": "5",
          "_links": {
            "stream": {
              "href": "/sites/D027F68E-A03F-43D5-BBFE-1DC93D905D55/rooms/5/stream"
            },
            "self": {
              "href": "/sites/D027F68E-A03F-43D5-BBFE-1DC93D905D55/rooms/5"
            },
            "devices": {
              "href": "/sites/D027F68E-A03F-43D5-BBFE-1DC93D905D55/rooms/5/devices"
            }
          },
          "_embedded": {
            "devices": [
              {
                "room": 5,
                "name": "Modusbryter",
                "model": "FH-MODE",
                "id": 3,
                "functionality": "input",
                "_links": {
                  "stream": {
                    "href": "/sites/D027F68E-A03F-43D5-BBFE-1DC93D905D55/devices/3/stream"
                  },
                  "self": {
                    "href": "/sites/D027F68E-A03F-43D5-BBFE-1DC93D905D55/devices/3"
                  }
                },
                "_actions": []
              },
              {
                "room": 5,
                "name": "Varmekabler",
                "model": "multireg",
                "id": 4,
                "functionality": "heating",
                "_links": {
                  "stream": {
                    "href": "/sites/D027F68E-A03F-43D5-BBFE-1DC93D905D55/devices/4/stream"
                  },
                  "self": {
                    "href": "/sites/D027F68E-A03F-43D5-BBFE-1DC93D905D55/devices/4"
                  }
                },
                "_actions": []
              },
              {
                "room": 5,
                "name": "Inngang",
                "model": "idlock",
                "id": 7,
                "functionality": "security",
                "_links": {
                  "stream": {
                    "href": "/sites/D027F68E-A03F-43D5-BBFE-1DC93D905D55/devices/7/stream"
                  },
                  "self": {
                    "href": "/sites/D027F68E-A03F-43D5-BBFE-1DC93D905D55/devices/7"
                  }
                },
                "_actions": [
                  {
                    "href": "/sites/D027F68E-A03F-43D5-BBFE-1DC93D905D55/devices/7",
                    "name": "lock",
                    "method": "PATCH",
                    "fields": [
                      {
                        "type": "enum",
                        "optional": false,
                        "name": "lockState",
                        "allowed_value": [
                          "locked",
                          "unlocked"
                        ]
                      }
                    ],
                    "description": "Set the lock state of a device."
                  }
                ]
              }
            ]
          },
          "_actions": [
            {
              "href": "/sites/D027F68E-A03F-43D5-BBFE-1DC93D905D55/rooms/5",
              "name": "temperature",
              "method": "PATCH",
              "fields": [
                {
                  "type": "float",
                  "optional": false,
                  "name": "temperature",
                  "allowed_value": [
                    5,
                    50
                  ]
                }
              ],
              "description": "Set the desired temperature for that room."
            }
          ]
        }
      ]
    },
    "_actions": [
      {
        "href": "/sites/D027F68E-A03F-43D5-BBFE-1DC93D905D55",
        "name": "mode",
        "method": "PATCH",
        "fields": [
          {
            "type": "enum",
            "optional": false,
            "name": "mode",
            "allowed_value": [
              "home",
              "away",
              "vacation",
              "sleep"
            ]
          }
        ],
        "description": "Triggers a mode on the whole house."
      },
      {
        "href": "/sites/D027F68E-A03F-43D5-BBFE-1DC93D905D55",
        "name": "shortcut",
        "method": "PATCH",
        "fields": [
          {
            "type": "integer",
            "optional": false,
            "name": "shortcut"
          }
        ],
        "description": "Triggers a pre-configured shortcut."
      }
    ]
  }
]

Trigger action
PATCH/api/v2/sites/{siteId}

Available parameters for the action can be found in the_actionsobject related to the device.

Example URI

PATCH /api/v2/sites/siteId
URI Parameters
HideShow
siteId
string (optional) 
Request
HideShow
Headers
Content-Type: application/x-www-form-urlencoded
Body
- mode
- shortcut
Response  200

sites collection

List all sites
GET/api/v2/sites

Gets all sites available to the currently logged in user.

Example URI

GET /api/v2/sites
Response  200
HideShow
Headers
Content-Type: application/json
Body
[
  {
    "_links": {
      "self": {
        "href": "/sites"
      }
    },
    "_embedded": {
      "sites": [
        {
          "owner": {
            "name": "Stian Øien",
            "id": "support@futurehome.no"
          },
          "name": "Smarthusgata 9",
          "id": "D027F68E-A03F-43D5-BBFE-1DC93D905D55",
          "_links": {
            "stream": {
              "href": "/sites/D027F68E-A03F-43D5-BBFE-1DC93D905D55/stream"
            },
            "stats": {
              "href": "/sites/D027F68E-A03F-43D5-BBFE-1DC93D905D55/stats"
            },
            "shortcuts": {
              "href": "/sites/D027F68E-A03F-43D5-BBFE-1DC93D905D55/shortcuts"
            },
            "self": {
              "href": "/sites/D027F68E-A03F-43D5-BBFE-1DC93D905D55"
            },
            "rooms": {
              "href": "/sites/D027F68E-A03F-43D5-BBFE-1DC93D905D55/rooms"
            },
            "fragments": {
              "href": "/sites/D027F68E-A03F-43D5-BBFE-1DC93D905D55/fragments"
            },
            "devices": {
              "href": "/sites/D027F68E-A03F-43D5-BBFE-1DC93D905D55/devices"
            }
          }
        }
      ]
    }
  }
]

Rooms

Room

A room has the following attributes

  • current_temperature: The current temperature in the room.

  • desired_temperature: The temperature set by the user in the room.

  • heater: Whether the heaters are on or off in the room.

  • id: The id of the room in the site.

  • lock: Whether the room is locked or not.

  • name: The name of the room.

  • type: The type of the room.

Get room in site
GET/api/v2/sites/{siteId}/rooms/{roomId}

Gets detailed information about a single room in a site.

Example URI

GET /api/v2/sites/siteId/rooms/roomId
URI Parameters
HideShow
siteId
string (optional) 
roomId
string (optional) 
Response  200
HideShow
Headers
Content-Type: application/json
Body
[
  {
    "lock": "closed",
    "heater": "off",
    "desired_temperature": 20,
    "current_temperature": 24.2,
    "type": "living",
    "name": null,
    "id": "1",
    "_links": {
      "stream": {
        "href": "/sites/D027F68E-A03F-43D5-BBFE-1DC93D905D55/rooms/1/stream"
      },
      "self": {
        "href": "/sites/D027F68E-A03F-43D5-BBFE-1DC93D905D55/rooms/1"
      },
      "devices": {
        "href": "/sites/D027F68E-A03F-43D5-BBFE-1DC93D905D55/rooms/1/devices"
      }
    },
    "_embedded": {
      "devices": [
        {
          "room": 1,
          "name": "Taklys",
          "model": "FGD_212",
          "id": 1,
          "functionality": "lighting",
          "_links": {
            "stream": {
              "href": "/sites/D027F68E-A03F-43D5-BBFE-1DC93D905D55/devices/1/stream"
            },
            "self": {
              "href": "/sites/D027F68E-A03F-43D5-BBFE-1DC93D905D55/devices/1"
            }
          },
          "_actions": [
            {
              "href": "/sites/D027F68E-A03F-43D5-BBFE-1DC93D905D55/devices/1",
              "name": "power",
              "method": "PATCH",
              "fields": [
                {
                  "type": "enum",
                  "optional": false,
                  "name": "power",
                  "allowed_value": [
                    "on",
                    "off"
                  ]
                }
              ],
              "description": "Set the powered status of a device."
            },
            {
              "href": "/sites/D027F68E-A03F-43D5-BBFE-1DC93D905D55/devices/1",
              "name": "dimmer",
              "method": "PATCH",
              "fields": [
                {
                  "type": "integer",
                  "optional": false,
                  "name": "dimValue",
                  "allowed_value": [
                    1,
                    100
                  ]
                }
              ],
              "description": "Set the desired dimValue for a device."
            }
          ]
        },
        {
          "room": 1,
          "name": "Sensor",
          "model": "FGMS_001",
          "id": 5,
          "functionality": null,
          "_links": {
            "stream": {
              "href": "/sites/D027F68E-A03F-43D5-BBFE-1DC93D905D55/devices/5/stream"
            },
            "self": {
              "href": "/sites/D027F68E-A03F-43D5-BBFE-1DC93D905D55/devices/5"
            }
          },
          "_actions": []
        },
        {
          "room": 1,
          "name": "Takvindu",
          "model": "giljestrip",
          "id": 6,
          "functionality": null,
          "_links": {
            "stream": {
              "href": "/sites/D027F68E-A03F-43D5-BBFE-1DC93D905D55/devices/6/stream"
            },
            "self": {
              "href": "/sites/D027F68E-A03F-43D5-BBFE-1DC93D905D55/devices/6"
            }
          },
          "_actions": []
        }
      ]
    },
    "_actions": []
  }
]

Trigger action
PATCH/api/v2/sites/{siteId}/rooms/

Available parameters for the action can be found in the_actionsobject related to the device.

Example URI

PATCH /api/v2/sites/siteId/rooms/
URI Parameters
HideShow
siteId
string (optional) 
Request
HideShow
Headers
Content-Type: application/x-www-form-urlencoded
Response  200

Rooms collection

List rooms in site
GET/api/v2/sites/{siteId}/rooms

Gets a list of rooms available in the site.

Example URI

GET /api/v2/sites/siteId/rooms
URI Parameters
HideShow
siteId
string (optional) 
Response  200
HideShow
Headers
Content-Type: application/json
Body
[
  [
    {
      "type": "living",
      "name": null,
      "id": "1",
      "_links": {
        "stream": {
          "href": "/sites/D027F68E-A03F-43D5-BBFE-1DC93D905D55/rooms/1/stream"
        },
        "self": {
          "href": "/sites/D027F68E-A03F-43D5-BBFE-1DC93D905D55/rooms/1"
        },
        "devices": {
          "href": "/sites/D027F68E-A03F-43D5-BBFE-1DC93D905D55/rooms/1/devices"
        }
      },
      "_embedded": {
        "devices": [
          {
            "room": 1,
            "name": "Taklys",
            "model": "FGD_212",
            "id": 1,
            "functionality": "lighting",
            "_links": {
              "stream": {
                "href": "/sites/D027F68E-A03F-43D5-BBFE-1DC93D905D55/devices/1/stream"
              },
              "self": {
                "href": "/sites/D027F68E-A03F-43D5-BBFE-1DC93D905D55/devices/1"
              }
            },
            "_actions": [
              {
                "href": "/sites/D027F68E-A03F-43D5-BBFE-1DC93D905D55/devices/1",
                "name": "power",
                "method": "PATCH",
                "fields": [
                  {
                    "type": "enum",
                    "optional": false,
                    "name": "power",
                    "allowed_value": [
                      "on",
                      "off"
                    ]
                  }
                ],
                "description": "Set the powered status of a device."
              },
              {
                "href": "/sites/D027F68E-A03F-43D5-BBFE-1DC93D905D55/devices/1",
                "name": "dimmer",
                "method": "PATCH",
                "fields": [
                  {
                    "type": "integer",
                    "optional": false,
                    "name": "dimValue",
                    "allowed_value": [
                      1,
                      100
                    ]
                  }
                ],
                "description": "Set the desired dimValue for a device."
              }
            ]
          },
          {
            "room": 1,
            "name": "Sensor",
            "model": "FGMS_001",
            "id": 5,
            "functionality": null,
            "_links": {
              "stream": {
                "href": "/sites/D027F68E-A03F-43D5-BBFE-1DC93D905D55/devices/5/stream"
              },
              "self": {
                "href": "/sites/D027F68E-A03F-43D5-BBFE-1DC93D905D55/devices/5"
              }
            },
            "_actions": []
          },
          {
            "room": 1,
            "name": "Takvindu",
            "model": "giljestrip",
            "id": 6,
            "functionality": null,
            "_links": {
              "stream": {
                "href": "/sites/D027F68E-A03F-43D5-BBFE-1DC93D905D55/devices/6/stream"
              },
              "self": {
                "href": "/sites/D027F68E-A03F-43D5-BBFE-1DC93D905D55/devices/6"
              }
            },
            "_actions": []
          }
        ]
      },
      "_actions": []
    },
    {
      "type": "kitchen",
      "name": null,
      "id": "2",
      "_links": {
        "stream": {
          "href": "/sites/D027F68E-A03F-43D5-BBFE-1DC93D905D55/rooms/2/stream"
        },
        "self": {
          "href": "/sites/D027F68E-A03F-43D5-BBFE-1DC93D905D55/rooms/2"
        },
        "devices": {
          "href": "/sites/D027F68E-A03F-43D5-BBFE-1DC93D905D55/rooms/2/devices"
        }
      },
      "_embedded": {
        "devices": []
      },
      "_actions": []
    },
    {
      "type": "bath",
      "name": null,
      "id": "3",
      "_links": {
        "stream": {
          "href": "/sites/D027F68E-A03F-43D5-BBFE-1DC93D905D55/rooms/3/stream"
        },
        "self": {
          "href": "/sites/D027F68E-A03F-43D5-BBFE-1DC93D905D55/rooms/3"
        },
        "devices": {
          "href": "/sites/D027F68E-A03F-43D5-BBFE-1DC93D905D55/rooms/3/devices"
        }
      },
      "_embedded": {
        "devices": [
          {
            "room": 3,
            "name": "Håndkle tørker",
            "model": "zwave",
            "id": 2,
            "functionality": "appliance",
            "_links": {
              "stream": {
                "href": "/sites/D027F68E-A03F-43D5-BBFE-1DC93D905D55/devices/2/stream"
              },
              "self": {
                "href": "/sites/D027F68E-A03F-43D5-BBFE-1DC93D905D55/devices/2"
              }
            },
            "_actions": []
          }
        ]
      },
      "_actions": []
    },
    {
      "type": "bed",
      "name": null,
      "id": "4",
      "_links": {
        "stream": {
          "href": "/sites/D027F68E-A03F-43D5-BBFE-1DC93D905D55/rooms/4/stream"
        },
        "self": {
          "href": "/sites/D027F68E-A03F-43D5-BBFE-1DC93D905D55/rooms/4"
        },
        "devices": {
          "href": "/sites/D027F68E-A03F-43D5-BBFE-1DC93D905D55/rooms/4/devices"
        }
      },
      "_embedded": {
        "devices": [
          {
            "room": 4,
            "name": "Fibaro magnet",
            "model": "auto",
            "id": 10,
            "functionality": null,
            "_links": {
              "stream": {
                "href": "/sites/D027F68E-A03F-43D5-BBFE-1DC93D905D55/devices/10/stream"
              },
              "self": {
                "href": "/sites/D027F68E-A03F-43D5-BBFE-1DC93D905D55/devices/10"
              }
            },
            "_actions": []
          },
          {
            "room": 4,
            "name": "Rgb lys",
            "model": "aeotec_LED_bulb",
            "id": 8,
            "functionality": "lighting",
            "_links": {
              "stream": {
                "href": "/sites/D027F68E-A03F-43D5-BBFE-1DC93D905D55/devices/8/stream"
              },
              "self": {
                "href": "/sites/D027F68E-A03F-43D5-BBFE-1DC93D905D55/devices/8"
              }
            },
            "_actions": [
              {
                "href": "/sites/D027F68E-A03F-43D5-BBFE-1DC93D905D55/devices/8",
                "name": "power",
                "method": "PATCH",
                "fields": [
                  {
                    "type": "enum",
                    "optional": false,
                    "name": "power",
                    "allowed_value": [
                      "on",
                      "off"
                    ]
                  }
                ],
                "description": "Set the powered status of a device."
              },
              {
                "href": "/sites/D027F68E-A03F-43D5-BBFE-1DC93D905D55/devices/8",
                "name": "dimmer",
                "method": "PATCH",
                "fields": [
                  {
                    "type": "integer",
                    "optional": false,
                    "name": "dimValue",
                    "allowed_value": [
                      1,
                      100
                    ]
                  }
                ],
                "description": "Set the desired dimValue for a device."
              },
              {
                "href": "/sites/D027F68E-A03F-43D5-BBFE-1DC93D905D55/devices/8",
                "name": "wWcWRGB",
                "method": "PATCH",
                "fields": [
                  {
                    "type": "int",
                    "optional": false,
                    "name": "warm_white",
                    "allowed_value": [
                      0,
                      255
                    ]
                  },
                  {
                    "type": "int",
                    "optional": false,
                    "name": "cold_white",
                    "allowed_value": [
                      0,
                      255
                    ]
                  },
                  {
                    "type": "int",
                    "optional": false,
                    "name": "red",
                    "allowed_value": [
                      0,
                      255
                    ]
                  },
                  {
                    "type": "int",
                    "optional": false,
                    "name": "green",
                    "allowed_value": [
                      0,
                      255
                    ]
                  },
                  {
                    "type": "int",
                    "optional": false,
                    "name": "blue",
                    "allowed_value": [
                      0,
                      255
                    ]
                  }
                ],
                "description": "Set the wWcWRGB state of a device."
              }
            ]
          },
          {
            "room": 4,
            "name": "Test modus bryter",
            "model": "FH-MODE",
            "id": 9,
            "functionality": "input",
            "_links": {
              "stream": {
                "href": "/sites/D027F68E-A03F-43D5-BBFE-1DC93D905D55/devices/9/stream"
              },
              "self": {
                "href": "/sites/D027F68E-A03F-43D5-BBFE-1DC93D905D55/devices/9"
              }
            },
            "_actions": []
          }
        ]
      },
      "_actions": []
    },
    {
      "type": "entrance",
      "name": null,
      "id": "5",
      "_links": {
        "stream": {
          "href": "/sites/D027F68E-A03F-43D5-BBFE-1DC93D905D55/rooms/5/stream"
        },
        "self": {
          "href": "/sites/D027F68E-A03F-43D5-BBFE-1DC93D905D55/rooms/5"
        },
        "devices": {
          "href": "/sites/D027F68E-A03F-43D5-BBFE-1DC93D905D55/rooms/5/devices"
        }
      },
      "_embedded": {
        "devices": [
          {
            "room": 5,
            "name": "Modusbryter",
            "model": "FH-MODE",
            "id": 3,
            "functionality": "input",
            "_links": {
              "stream": {
                "href": "/sites/D027F68E-A03F-43D5-BBFE-1DC93D905D55/devices/3/stream"
              },
              "self": {
                "href": "/sites/D027F68E-A03F-43D5-BBFE-1DC93D905D55/devices/3"
              }
            },
            "_actions": []
          },
          {
            "room": 5,
            "name": "Varmekabler",
            "model": "multireg",
            "id": 4,
            "functionality": "heating",
            "_links": {
              "stream": {
                "href": "/sites/D027F68E-A03F-43D5-BBFE-1DC93D905D55/devices/4/stream"
              },
              "self": {
                "href": "/sites/D027F68E-A03F-43D5-BBFE-1DC93D905D55/devices/4"
              }
            },
            "_actions": []
          },
          {
            "room": 5,
            "name": "Inngang",
            "model": "idlock",
            "id": 7,
            "functionality": "security",
            "_links": {
              "stream": {
                "href": "/sites/D027F68E-A03F-43D5-BBFE-1DC93D905D55/devices/7/stream"
              },
              "self": {
                "href": "/sites/D027F68E-A03F-43D5-BBFE-1DC93D905D55/devices/7"
              }
            },
            "_actions": [
              {
                "href": "/sites/D027F68E-A03F-43D5-BBFE-1DC93D905D55/devices/7",
                "name": "lock",
                "method": "PATCH",
                "fields": [
                  {
                    "type": "enum",
                    "optional": false,
                    "name": "lockState",
                    "allowed_value": [
                      "locked",
                      "unlocked"
                    ]
                  }
                ],
                "description": "Set the lock state of a device."
              }
            ]
          }
        ]
      },
      "_actions": [
        {
          "href": "/sites/D027F68E-A03F-43D5-BBFE-1DC93D905D55/rooms/5",
          "name": "temperature",
          "method": "PATCH",
          "fields": [
            {
              "type": "float",
              "optional": false,
              "name": "temperature",
              "allowed_value": [
                5,
                50
              ]
            }
          ],
          "description": "Set the desired temperature for that room."
        }
      ]
    }
  ]
]

Devices

Device in site

A devices attributes depend on the type of device you are requesting. An example device has been added, but it’s exact configuration will depend on the capabilities of the device you are requesting.

Get device in site
GET/api/v2/sites/{siteId}/devices/{deviceId}

Gets information about a specific device in a site.

Example URI

GET /api/v2/sites/siteId/devices/deviceId
URI Parameters
HideShow
siteId
string (optional) 
deviceId
string (optional) 
Response  200
HideShow
Headers
Content-Type: application/json
Body
[
  {
    "zwaveConfigParameters": [],
    "wattage": 0,
    "power": "off",
    "dimValue": 78,
    "room": 1,
    "name": "Taklys",
    "model": "FGD_212",
    "id": 1,
    "functionality": "lighting",
    "_links": {
      "stream": {
        "href": "/sites/D027F68E-A03F-43D5-BBFE-1DC93D905D55/devices/1/stream"
      },
      "self": {
        "href": "/sites/D027F68E-A03F-43D5-BBFE-1DC93D905D55/devices/1"
      }
    },
    "_actions": [
      {
        "href": "/sites/D027F68E-A03F-43D5-BBFE-1DC93D905D55/devices/1",
        "name": "power",
        "method": "PATCH",
        "fields": [
          {
            "type": "enum",
            "optional": false,
            "name": "power",
            "allowed_value": [
              "on",
              "off"
            ]
          }
        ],
        "description": "Set the powered status of a device."
      },
      {
        "href": "/sites/D027F68E-A03F-43D5-BBFE-1DC93D905D55/devices/1",
        "name": "dimmer",
        "method": "PATCH",
        "fields": [
          {
            "type": "integer",
            "optional": false,
            "name": "dimValue",
            "allowed_value": [
              1,
              100
            ]
          }
        ],
        "description": "Set the desired dimValue for a device."
      }
    ]
  }
]

Trigger action
PATCH/api/v2/sites/{siteId}/devices/

Available parameters for the action can be found in the_actionsobject related to the device.

Example URI

PATCH /api/v2/sites/siteId/devices/
URI Parameters
HideShow
siteId
string (optional) 
Request
HideShow
Headers
Content-Type: application/x-www-form-urlencoded
Response  200

Devices in site collection

List devices in site
GET/api/v2/sites/{siteId}/devices

Lists all devices in a site.

Example URI

GET /api/v2/sites/siteId/devices
URI Parameters
HideShow
siteId
string (optional) 
Response  200
HideShow
Headers
Content-Type: application/json
Body
[
  {
    "_links": {
      "self": {
        "href": "/sites/D027F68E-A03F-43D5-BBFE-1DC93D905D55/rooms/1/devices"
      }
    },
    "_embedded": [
      {
        "room": 1,
        "name": "Taklys",
        "model": "FGD_212",
        "id": 1,
        "functionality": "lighting",
        "_links": {
          "stream": {
            "href": "/sites/D027F68E-A03F-43D5-BBFE-1DC93D905D55/devices/1/stream"
          },
          "self": {
            "href": "/sites/D027F68E-A03F-43D5-BBFE-1DC93D905D55/devices/1"
          }
        },
        "_actions": [
          {
            "href": "/sites/D027F68E-A03F-43D5-BBFE-1DC93D905D55/devices/1",
            "name": "power",
            "method": "PATCH",
            "fields": [
              {
                "type": "enum",
                "optional": false,
                "name": "power",
                "allowed_value": [
                  "on",
                  "off"
                ]
              }
            ],
            "description": "Set the powered status of a device."
          },
          {
            "href": "/sites/D027F68E-A03F-43D5-BBFE-1DC93D905D55/devices/1",
            "name": "dimmer",
            "method": "PATCH",
            "fields": [
              {
                "type": "integer",
                "optional": false,
                "name": "dimValue",
                "allowed_value": [
                  1,
                  100
                ]
              }
            ],
            "description": "Set the desired dimValue for a device."
          }
        ]
      },
      {
        "room": 1,
        "name": "Sensor",
        "model": "FGMS_001",
        "id": 5,
        "functionality": null,
        "_links": {
          "stream": {
            "href": "/sites/D027F68E-A03F-43D5-BBFE-1DC93D905D55/devices/5/stream"
          },
          "self": {
            "href": "/sites/D027F68E-A03F-43D5-BBFE-1DC93D905D55/devices/5"
          }
        },
        "_actions": []
      },
      {
        "room": 1,
        "name": "Takvindu",
        "model": "giljestrip",
        "id": 6,
        "functionality": null,
        "_links": {
          "stream": {
            "href": "/sites/D027F68E-A03F-43D5-BBFE-1DC93D905D55/devices/6/stream"
          },
          "self": {
            "href": "/sites/D027F68E-A03F-43D5-BBFE-1DC93D905D55/devices/6"
          }
        },
        "_actions": []
      }
    ]
  }
]

Device in room

Get device in room
GET/api/v2/sites/{siteId}/rooms/{roomId}/devices/{deviceId}

Gets information about a specific device in a room.

Example URI

GET /api/v2/sites/siteId/rooms/roomId/devices/deviceId
URI Parameters
HideShow
siteId
string (optional) 
roomId
string (optional) 
deviceId
string (optional) 
Response  200
HideShow
Headers
Content-Type: application/json
Body
[
  {
    "zwaveConfigParameters": [],
    "wattage": 0,
    "power": "off",
    "dimValue": 78,
    "room": 1,
    "name": "Taklys",
    "model": "FGD_212",
    "id": 1,
    "functionality": "lighting",
    "_links": {
      "stream": {
        "href": "/sites/D027F68E-A03F-43D5-BBFE-1DC93D905D55/devices/1/stream"
      },
      "self": {
        "href": "/sites/D027F68E-A03F-43D5-BBFE-1DC93D905D55/devices/1"
      }
    },
    "_actions": [
      {
        "href": "/sites/D027F68E-A03F-43D5-BBFE-1DC93D905D55/devices/1",
        "name": "power",
        "method": "PATCH",
        "fields": [
          {
            "type": "enum",
            "optional": false,
            "name": "power",
            "allowed_value": [
              "on",
              "off"
            ]
          }
        ],
        "description": "Set the powered status of a device."
      },
      {
        "href": "/sites/D027F68E-A03F-43D5-BBFE-1DC93D905D55/devices/1",
        "name": "dimmer",
        "method": "PATCH",
        "fields": [
          {
            "type": "integer",
            "optional": false,
            "name": "dimValue",
            "allowed_value": [
              1,
              100
            ]
          }
        ],
        "description": "Set the desired dimValue for a device."
      }
    ]
  }
]

Trigger action
PATCH/api/v2/sites/{siteId}/rooms/devices/

Available parameters for the action can be found in the_actionsobject related to the device.

Example URI

PATCH /api/v2/sites/siteId/rooms/devices/
URI Parameters
HideShow
siteId
string (optional) 
Request
HideShow
Headers
Content-Type: application/x-www-form-urlencoded
Response  200

Devices in room collection

List devices in room
GET/api/v2/sites/{siteId}/rooms/{roomId}/devices

Lists all devices in a room.

Example URI

GET /api/v2/sites/siteId/rooms/roomId/devices
URI Parameters
HideShow
siteId
string (optional) 
roomId
string (optional) 
Response  200
HideShow
Headers
Content-Type: application/json
Body
[
  {
    "_links": {
      "self": {
        "href": "/sites/D027F68E-A03F-43D5-BBFE-1DC93D905D55/rooms/1/devices"
      }
    },
    "_embedded": [
      {
        "room": 1,
        "name": "Taklys",
        "model": "FGD_212",
        "id": 1,
        "functionality": "lighting",
        "_links": {
          "stream": {
            "href": "/sites/D027F68E-A03F-43D5-BBFE-1DC93D905D55/devices/1/stream"
          },
          "self": {
            "href": "/sites/D027F68E-A03F-43D5-BBFE-1DC93D905D55/devices/1"
          }
        },
        "_actions": [
          {
            "href": "/sites/D027F68E-A03F-43D5-BBFE-1DC93D905D55/devices/1",
            "name": "power",
            "method": "PATCH",
            "fields": [
              {
                "type": "enum",
                "optional": false,
                "name": "power",
                "allowed_value": [
                  "on",
                  "off"
                ]
              }
            ],
            "description": "Set the powered status of a device."
          },
          {
            "href": "/sites/D027F68E-A03F-43D5-BBFE-1DC93D905D55/devices/1",
            "name": "dimmer",
            "method": "PATCH",
            "fields": [
              {
                "type": "integer",
                "optional": false,
                "name": "dimValue",
                "allowed_value": [
                  1,
                  100
                ]
              }
            ],
            "description": "Set the desired dimValue for a device."
          }
        ]
      },
      {
        "room": 1,
        "name": "Sensor",
        "model": "FGMS_001",
        "id": 5,
        "functionality": null,
        "_links": {
          "stream": {
            "href": "/sites/D027F68E-A03F-43D5-BBFE-1DC93D905D55/devices/5/stream"
          },
          "self": {
            "href": "/sites/D027F68E-A03F-43D5-BBFE-1DC93D905D55/devices/5"
          }
        },
        "_actions": []
      },
      {
        "room": 1,
        "name": "Takvindu",
        "model": "giljestrip",
        "id": 6,
        "functionality": null,
        "_links": {
          "stream": {
            "href": "/sites/D027F68E-A03F-43D5-BBFE-1DC93D905D55/devices/6/stream"
          },
          "self": {
            "href": "/sites/D027F68E-A03F-43D5-BBFE-1DC93D905D55/devices/6"
          }
        },
        "_actions": []
      }
    ]
  }
]

Statistics

Specific site statistics

You will only be able to get statistics for the statsTypes supported by your site. The current complete list of statsTypes are:

  • temperature:

  • presence:

  • power:

Statistics
GET/api/v2/sites/{siteId}/stats/{statsType}

Response is an example using thetemperaturestatistics type.

Example URI

GET /api/v2/sites/siteId/stats/statsType
URI Parameters
HideShow
siteId
string (optional) 
statsType
string (optional) 
Response  200
HideShow
Headers
Content-Type: application/json
Body
[]

Available statistics types

List statistics types
GET/api/v2/sites/{siteId}/stats

Example URI

GET /api/v2/sites/siteId/stats
URI Parameters
HideShow
siteId
string (optional) 
Response  200
HideShow
Headers
Content-Type: application/json
Body
[
  {
    "_links": {
      "temperature": {
        "href": "/sites/D027F68E-A03F-43D5-BBFE-1DC93D905D55/stats/temperature"
      },
      "self": {
        "href": "/sites/D027F68E-A03F-43D5-BBFE-1DC93D905D55/stats"
      },
      "presence": {
        "href": "/sites/D027F68E-A03F-43D5-BBFE-1DC93D905D55/stats/presence"
      },
      "power": {
        "href": "/sites/D027F68E-A03F-43D5-BBFE-1DC93D905D55/stats/power"
      }
    },
    "_embedded": {}
  }
]

Fragments

Fragments are small objects that can be used in simple integrations and applications. Based on the data you need, you can request an appropriate fragment size.

Fragment in site

Fragments contain information based on their size. Example of anxsfragment has been included below.

Fragment
GET/api/v2/sites/{siteId}/fragments/{fragmentId}

Example URI

GET /api/v2/sites/siteId/fragments/fragmentId
URI Parameters
HideShow
siteId
string (optional) 
fragmentId
string (optional) 
Response  200
HideShow
Headers
Content-Type: application/json
Body
[
  {
    "site": {
      "temperature": {
        "outside": null,
        "inside": 29
      },
      "security": {
        "presence": false
      },
      "power": {
        "wattage": 16.9
      },
      "owner": {
        "name": "Stian Øien ",
        "id": "support@futurehome.no"
      },
      "online": true,
      "name": "Smarthusgata 9",
      "mode": "home",
      "lighting": {
        "total": 2,
        "on": 2
      }
    },
    "name": "XS Fragment",
    "id": "xs",
    "description": "Contains enough information for a small device to populate a dashboard.",
    "_links": {
      "self": {
        "href": "/sites/D027F68E-A03F-43D5-BBFE-1DC93D905D55/fragments/xs"
      }
    }
  }
]

Fragments in site collection

List fragments in site
GET/api/v2/sites/{siteId}/fragments

Example URI

GET /api/v2/sites/siteId/fragments
URI Parameters
HideShow
siteId
string (optional) 
Response  200
HideShow
Headers
Content-Type: application/json
Body
[
  {
    "_links": {
      "self": {
        "href": "/sites/2ABF8224-7D2C-42D8-992E-3E5EA0E21887/fragments"
      }
    },
    "_embedded": [
      {
        "name": "XS Fragment",
        "id": "xs",
        "description": "Contains enough information for a small device to populate a dashboard.",
        "_links": {
          "self": {
            "href": "/sites/D027F68E-A03F-43D5-BBFE-1DC93D905D55/fragments/xs"
          }
        }
      }
    ]
  }
]

Generated by aglio on 28 Jan 2019