npm package discovery and stats viewer.

Discover Tips

  • General search

    [free text search, go nuts!]

  • Package details

    pkg:[package-name]

  • User packages

    @[username]

Sponsor

Optimize Toolset

I’ve always been into building performant and accessible sites, but lately I’ve been taking it extremely seriously. So much so that I’ve been building a tool to help me optimize and monitor the sites that I build to make sure that I’m making an attempt to offer the best experience to those who visit them. If you’re into performant, accessible and SEO friendly sites, you might like it too! You can check it out at Optimize Toolset.

About

Hi, 👋, I’m Ryan Hefner  and I built this site for me, and you! The goal of this site was to provide an easy way for me to check the stats on my npm packages, both for prioritizing issues and updates, and to give me a little kick in the pants to keep up on stuff.

As I was building it, I realized that I was actually using the tool to build the tool, and figured I might as well put this out there and hopefully others will find it to be a fast and useful way to search and browse npm packages as I have.

If you’re interested in other things I’m working on, follow me on Twitter or check out the open source projects I’ve been publishing on GitHub.

I am also working on a Twitter bot for this site to tweet the most popular, newest, random packages from npm. Please follow that account now and it will start sending out packages soon–ish.

Open Software & Tools

This site wouldn’t be possible without the immense generosity and tireless efforts from the people who make contributions to the world and share their work via open source initiatives. Thank you 🙏

© 2026 – Pkg Stats / Ryan Hefner

aiseg2-puppeteer

v0.2.0

Published

Control the device via AiSEG2

Readme

aiseg2-puppeteer

ラズパイなどでパナソニック社製AiSEG2に接続した機器の制御などを行うモジュールです。今のところ下記の2つしかできません。

  • シャッター制御
  • 温度/湿度取得

使い方

下記のような感じで使用します。

初期化

ユーザ名とパスワードはAiSEG2にウェブブラウザでアクセスするときに入力するものを使用してください。

const aiseg2_factory('aiseg2-puppeteer');
const acl = {
    username: 'username',
    password: 'password'
}
const aiseg2 = new aiseg2_factory(acl);

シャッター制御

// AiSEG2のアドレスを得る
// UPnPのマルチキャストを使って探してるので、それが届く範囲からしか見つけられない
const address = await aiseg2.discover();
// シャッター一覧を得る
const list    = await aiseg2.getShutter(address);
// こんな感じの配列が得られる
// list = [
//   'ガレージシャッター': {
//     nodeId: '268566528',
//     eoj:    '0x026301',
//     type:   '0x0e',
//     agree:  '0x31',
//     name:   'ガレージシャッター',
//     state:  '0x30',
//     entry:  '1',
//     shutter: {
//         openState: '0x43',
//         type:      '0x1010',
//         version:   '1'
//     },
//     condition: '開動作中'
//   }
// ];
// 上記で取得した配列の1要素を使ってシャッター指定
// 開閉は opList.open/close/stop が指定可
const resp = await aiseg2.doShutter(address, list['ガレージシャッター'], aiseg2.opList.open);

うちのAiSEG2には制御すべきシャッターが3つしかつながってないので、2ページ(5つ以上?)にわたるようなシャッターがある場合はうまくgetShutter()でとれないと思われます。

温度/湿度取得

AiSEG2の空気環境で閲覧できる温度/湿度が取得できます。

// AiSEG2のアドレスを得る
const address = await aiseg2.discover();
// 空気環境温度/湿度を得る
const rooms   = await aiseg2.getAirEnvironment(address);
// こんな感じの配列が得られる
// rooms = [
//   {
//     name: 'リビング',
//     temp: '25.0',
//     humi: '40.0'
//   },
//   {
//     name: '屋外',
//     temp: '8.0',
//     humi: '60.0'
//   }
// ];
// 配列の各要素がそれぞれの空気環境で設定した部屋に対応している

使用環境

以下のような環境で使用しています。

|項目|内容| |:----|:--------------------------------------| |ホスト|Raspberry Pi 3B+ Raspbian Stretch Lite| |AiSEG2バージョン|Ver.2.40Q-01動作確認済み| |操作機器|三和シャッター社製シャッター + HEMS対応操作ユニット HEM-800 x 3系統| ||パナソニック社製エアコン(の温度センサ)| ||パナソニック社製温湿度センサー(屋外用) MKN7512F|