-
Notifications
You must be signed in to change notification settings - Fork 8
PowerMeter Profile
TakayukiHoshi1984 edited this page Mar 27, 2017
·
3 revisions
| API | 機能概要 |
|---|---|
| PowerMeter Get Power State API | スマートデバイスの電源状態を取得する。 |
| PowerMeter Power On API | スマートデバイスの電源を付ける。 |
| PowerMeter Power Off API | スマートデバイスの電源を消す。 |
| PowerMeter Get Integrated Power API | スマートデバイスが計測した積算電力量を取得する。 |
| PowerMeter Get Instantaneous Power API | スマートデバイスが計測した瞬間電力量を取得する。 |
スマートデバイスが計測した電力を取得する機能を提供するAPI。
| インターフェース名称 | Version | 種別 |
|---|---|---|
| PowerMeger Get Power State API | 2.0.0 | 同期I/F |
スマートデバイスの電源状態を取得する。
| HTTPメソッド | URI |
|---|---|
| GET | /gotapi/powermeter |
| 論理名 | 物理名 | データ型 | 省略 | 設定値 |
|---|---|---|---|---|
| サービスID | serviceId | string | - | 取得対象デバイス |
| Content-Type | 形式 | HTTPステータス |
|---|---|---|
| application/json | JSON | 200 |
| 論理名 | 物理名 | データ型 | 省略 | 設定値 |
|---|---|---|---|---|
| 処理結果 | result | number | - | 0:正常応答 0以外:異常応答 |
| 電源状態 | powerstate | string | - | ON:電源オン OFF:電源オフ UNKNOWN:不明 |
GET http://localhost:4035/gotapi/powermeter&serviceId=localhost.deviceconnect.org&accessToken=xxxxx
{
"product":"Device Connect Manager",
"version":"x.x",
"result":0,
"powerstate":"ON"
}
| インターフェース名称 | Version | 種別 |
|---|---|---|
| PowerMeter Power On API | 2.0.0 | 同期I/F |
スマートデバイスの電源を付ける。
| HTTPメソッド | URI |
|---|---|
| PUT | /gotapi/powermeter |
| 論理名 | 物理名 | データ型 | 省略 | 設定値 |
|---|---|---|---|---|
| サービスID | serviceId | string | - | 取得対象デバイス |
| Content-Type | 形式 | HTTPステータス |
|---|---|---|
| application/json | JSON | 200 |
| 論理名 | 物理名 | データ型 | 省略 | 設定値 |
|---|---|---|---|---|
| 処理結果 | result | number | - | 0:正常応答 0以外:異常応答 |
PUT http://localhost:4035/gotapi/powermeter
| PUTデータ |
|---|
| serviceId=localhost.deviceconnect.org&accessToken=xxxxx |
{
"product":"Device Connect Manager",
"version":"x.x",
"result":0
}
| インターフェース名称 | Version | 種別 |
|---|---|---|
| PowerMeter Power Off API | 2.0.0 | 同期I/F |
スマートデバイスの電源を消す。
| HTTPメソッド | URI |
|---|---|
| DELETE | /gotapi/powermeter |
| 論理名 | 物理名 | データ型 | 省略 | 設定値 |
|---|---|---|---|---|
| サービスID | serviceId | string | - | 取得対象デバイス |
| Content-Type | 形式 | HTTPステータス |
|---|---|---|
| application/json | JSON | 200 |
| 論理名 | 物理名 | データ型 | 省略 | 設定値 |
|---|---|---|---|---|
| 処理結果 | result | number | - | 0:正常応答 0以外:異常応答 |
DELETE http://localhost:4035/gotapi/powermeter
| DELETEデータ |
|---|
| serviceId=localhost.deviceconnect.org&accessToken=xxxxx |
{
"product":"Device Connect Manager",
"version":"x.x",
"result":0
}
| インターフェース名称 | Version | 種別 |
|---|---|---|
| PowerMeger Get Integrated Power API | 2.0.0 | 同期I/F |
スマートデバイスが計測した積算電力量を取得する。
| HTTPメソッド | URI |
|---|---|
| GET | /gotapi/powermeter/integratedpower |
| 論理名 | 物理名 | データ型 | 省略 | 設定値 |
|---|---|---|---|---|
| サービスID | serviceId | string | - | 取得対象デバイス |
| 取得日付 | date | string | ○ | RFC 3339 例: "2014-01-01T00:00:00+0900" |
| Content-Type | 形式 | HTTPステータス |
|---|---|---|
| application/json | JSON | 200 |
| 論理名 | 物理名 | データ型 | 省略 | 設定値 |
|---|---|---|---|---|
| 処理結果 | result | number | - | 0:正常応答 0以外:異常応答 |
| 積算電力量 | integratedpower | array | - | サイズが24のnumberの配列。各値は積算電力量を表す実数。単位はWh。時間順に格納されているため、最初の要素は24時間前のもの。 たとえば2015-08-24T15:14:00+0900と指定すると、 0 : 2015-08-23T15:00 ~ 15:59 : 23 :2015-08-24T14:00 ~ 14:59 各要素の値は上記の各時間帯に対応する。 |
GET http://localhost:4035/gotapi/powermeter/integratedpower&serviceId=localhost.deviceconnect.org&accessToken=xxxxx&date=2014-01-01T00:00:00+0900
{
"product":"Device Connect Manager",
"version":"x.x",
"result":0,
"integratedpower":[0,5,10,0,0,1,5,4,3,4,2,4,0,5,10,0,0,1,5,4,3,4,2,4]
}
| インターフェース名称 | Version | 種別 |
|---|---|---|
| PowerMeger Get Instantaneous Power API | 2.0.0 | 同期I/F |
スマートデバイスが計測した瞬間電力量を取得する。
| HTTPメソッド | URI |
|---|---|
| GET | /gotapi/powermeter/instantaneouspower |
| 論理名 | 物理名 | データ型 | 省略 | 設定値 |
|---|---|---|---|---|
| サービスID | serviceId | string | - | 取得対象デバイス |
| Content-Type | 形式 | HTTPステータス |
|---|---|---|
| application/json | JSON | 200 |
| 論理名 | 物理名 | データ型 | 省略 | 設定値 |
|---|---|---|---|---|
| 処理結果 | result | number | - | 0:正常応答 0以外:異常応答 |
| 瞬間電力量 | instantaneouspower | number | - | 瞬間電力量を表す実装。単位は1W。 |
GET http://localhost:4035/gotapi/powermeter/instantaneouspower&serviceId=localhost.deviceconnect.org&accessToken=xxxxx
{
"product":"Device Connect Manager",
"version":"x.x",
"result":0,
"instantaneouspower":60
}