LoginSignup
10
5

More than 5 years have passed since last update.

homebridge-irmagicianを作りました

Last updated at Posted at 2016-12-04

おうちハック Advent Calendar 2016 5日目のエントリーです。よろしくお願いします。
大宮技研さんから出ている学習型リモコン irMagician の homebridge プラグインを作成しました。irMagicianhomebridge についてはこれまでに書かれた記事が詳しいかと思います。

IMG_0015.PNG

homebridge-irmagician
https://www.npmjs.com/package/homebridge-irmagician

今まで irMagician を homebridge で温度取得をする際は、cliツールを使って cron で定期的に温度をファイル保存して homebridge-temperature-file で読み込ませていました。 個人的に温度はリアルタイムで取得したいと思い homebridge-irmagician を作りました。

できること

  • 温度の取得
  • 赤外線の送信(未実装)
  • 赤外線の受信(未実装)

インストール

$ npm install -g homebridge-irmagician

raspberry pi の場合

インストール出来ない場合は上記のコマンドに--unsafe-permオプションをつけて下さい。
あとは一日目を担当されていた tamaki さんのNode.js製プラグイン irMagician を Node モジュールとして使っているのでインストール後に以下のコマンドを実行して下さい。

$ cd /usr/lib/node_modules/homebridge-irmagcian/
$ npm rebuild serialport --build-from-source

使い方

homebridge の config.json に設定します。

"accessories": [
    {
        "accessory": "irMagician",
        "name": "温度",
        "type": "temp"
    }
]

homebridgeのログ。こんな感じで温度取得が出来るようになります。
12月-04-2016 22-35-10.gif

今後やりたいこと

赤外線の送受信については、記事の公開に間に合わなかったので未実装です。。
追って実装しようと思ってます。プルリクエストもお待ちしています!

jaxx2104/homebridge-irmagician
https://github.com/jaxx2104/homebridge-irmagician

10
5
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
10
5