Skip to content

PowerView® HTTP API

To connect a PowerView® system to a home automation system a PowerView® Hub is required.

The current hub implementation supports an HTTP REST API which is described in this document. If you have an older hub, it is also possible to make use of the API through a serial connection, which is described here

Currently the API is limited to commands for getting a list of scenes and commands to activate scenes. These scenes need to be created in the PowerView® app first. When receiving a list of scenes from the hub the scene names are base64 encoded. For proper identification they need to be programmatically converted to unicode utf-8 readable text. Go here for an online converter. Go here for some code examples.

PowerView® http API

IMPORTANT

Make sure your hub gets a reserved/fixed ip address from the dhcp server.

The preferred method of setting a fixed IP address is IP address reservation based on MAC address in the home router (which should be the router with the dhcp server running)

The hub ip and MAC address can be found using the PowerView app:

  • Open the side menu.
  • Select <Hub>
  • Select the currently connected hub
  • Select <hub info>
  • A list should appear with both ip and MAC address displayed.

Get a list of all available scenes

request:

method: GET
api/scenes/

response example:

{
  "sceneIds":[7214,64073,15890,42747],
  "sceneData":[
    {
      "id":7214,
      "name":"QWxsIGRvd24=", //base64 encoded.
      "roomId":64902,
      "order":0,
      "colorId":2,
      "iconId":0
    },
    {
      "id":64073,
      "name":"UGxpc3NlIDE=", //base64 encoded.
      "roomId":64902,
      "order":1,
      "colorId":5,
      "iconId":0
    },
    {
      "id":15890,
      "name":"QWxsIHVw", //base64 encoded.
      "roomId":64902,
      "order":2,
      "colorId":0,
      "iconId":0
    },
    {
      "id":42747,
      "name":"UGxpc3NlIDI=", //base64 encoded.
      "roomId":64902,
      "order":3,
      "colorId":7,
      "iconId":0
    }
  ]
}

Activate a scene

request:

method: GET
/api/scenes?sceneId=<sceneid>  //replace <sceneid> with actual scene id.

response example:

{
  "scene":{"shadeIds":[35523]}
}

Base64 encoding

Python

import base64

def decode_base64(str):
    """Convert base64 to unicode text"""
    return base64.b64decode(str).decode('utf-8')

javascript

function decode_base64(str){
  // Converts incoming base64 to unicode text.
  return new Buffer(str, 'base64').toString('binary');
}

document version: 1.0 | generated: 2019-12-15 00:57:17