0
0

Delete article

Deleted articles cannot be recovered.

Draft of this article would be also deleted.

Are you sure you want to delete this article?

More than 3 years have passed since last update.

Raspberry PIで「Homebridge Config UI X」を扱う

Posted at

1. Homebridge + Homebridge Config UI Xのインストール

$ sudo npm install -g --unsafe-perm homebridge homebridge-config-ui-x
$ sudo hb-service install --user homebridge

2. 管理画面にアクセス

http://localhost:8581

これにデフォルトユーザーでログインしてみる
ユーザー名 :admin
パスワード :admin

あとは、PQコードをアプリから読み取るだけ。
詳しくはこちホーム App に HomeKit アクセサリを追加する

TP-LinkのスマートプラグHS105を追加する

「Homebridge Tplink Smarthome」というプラグインを入れるだけで良い。

NatureRemo を追加する

Step1 アクセストークンの取得

ここからアクセストークンを取得してね

Step2 JSONを取得

$ /usr/bin/curl -X GET "https://api.nature.global/1/appliances" -H "Authorization: Bearer ここにaccess-tokenを代入" > appliance_id.json

$ vim appliance_id.json

$ mv appliance_id.json ~/Desktop

Step3 プラグインのインストール

使いたいプラグインをインストール
・Homebridge Nature Remo Cloud
・Homebridge Nature Remo Cloud Aircon

Step4 cofigを書く

{
    "bridge": {
        ... <- Homebridgeの設定が自動入力されている
    },
    "accessories": [
        {
            "accessory": "remo-sensor",
            "name": "室温センサー",
            "mini": true,
            "schedule": "*/5 * * * *",
            "accessToken": "NatureRemoのアクセストークン",
            "sensors": {
                "temperature": true,
                "humidity": false,
                "light": false
            }
        },
        {
            "accessory": "NatureRemoAircon",
            "name": "エアコン",
            "access_token": "NatureRemoのアクセストークン",
            "appliance_id": "個別id",
            "skip_command_request_if_no_change": true
        }
    ],
   ...
}

Sensor

accessory : プラグインの識別子。remo-sensorを指定
name : HomeKitに表示される名前。Siriにお願いをするときは、この名前を使う
mini : Nature Remoか、 Nature Remo miniかどうか
schedule : センサー情報の更新頻度をcron形式で指定
accessToken : 先ほど取得したアクセストークン
sensors : HomeKitに表示するセンサーの種類。NatureRemoMiniの場合、室温しか検知できない

Aircon

accessory: プラグインの識別子
name : デバイス名
access_token : 先ほど取得したアクセストークン
appliace_id : 取得したappliance_idを指定
skip_command_request_if_no_change : ステータスに変更がない場合、APIを叩くのをスキップする

0
0
0

Register as a new user and use Qiita more conveniently

  1. You get articles that match your needs
  2. You can efficiently read back useful information
  3. You can use dark theme
What you can do with signing up
0
0

Delete article

Deleted articles cannot be recovered.

Draft of this article would be also deleted.

Are you sure you want to delete this article?