echonet-lite-conv

ECHONET Lite プロトコルのデータ変換を行うモジュールです。 EOJ/EPC/EDTの解析、日時フォーマット変換、各種機器データの変換機能を提供します。
Description:
  • ECHONET Lite プロトコルのデータ変換を行うモジュールです。 EOJ/EPC/EDTの解析、日時フォーマット変換、各種機器データの変換機能を提供します。
Source:
Author:
  • Hiroshi SUGIMURA
License:
  • MIT

Namespaces

ELconv

Methods

(static) BITMAPtoString(edt, typeArray) → {string}

Description:
  • ビットマップデータを文字列に変換
Source:
Parameters:
Name Type Description
edt string EDTの16進数文字列
typeArray Array ビット名と値のマッピング配列
Returns:
各ビットの状態を示す文字列
Type
string

(static) ByteStringSeparater(bytestring) → {string}

Description:
  • バイト列文字列を2文字づつスペース区切りにする
Source:
Parameters:
Name Type Description
bytestring string バイト列の文字列
Returns:
スペース区切りの文字列
Type
string

(static) EDTCombination()

Description:
  • Alias for EDTconvination (corrected spelling: combination)
Source:

(static) EDTconvination(eoj, epcs) → {Object|null}

Description:
  • 複数のEPCが関連して意味をなすデータを組み合わせて解析 主に電力量計測関連の係数と値の組み合わせ処理
Source:
Parameters:
Name Type Description
eoj string EOJの16進数文字列
epcs Object EPCとEDTのマッピングオブジェクト
Returns:
組み合わせ解析結果のオブジェクトまたはnull
Type
Object | null

(static) HEXStringtoASCII(hexString) → {string}

Description:
  • 16進数文字列をASCII文字列に変換
Source:
Parameters:
Name Type Description
hexString string 16進数文字列
Returns:
ASCIIでデコードされた文字列(null文字を除去)
Type
string

(static) HEXStringtoShiftJIS(hexString) → {string}

Description:
  • 16進数文字列をShift_JIS文字列に変換
Source:
Parameters:
Name Type Description
hexString string 16進数文字列
Returns:
Shift_JISでデコードされた文字列
Type
string

(static) HMFtoString(hmf) → {string}

Description:
  • 時分フレームデータを文字列に変換 (Hour(1byte), Minute(1byte), Frame(1byte))
Source:
Parameters:
Name Type Description
hmf string 時分フレームの16進数文字列
Returns:
'H.M.F'形式の文字列
Type
string

(static) HMStoString(hms) → {string}

Description:
  • 時分秒データを文字列に変換 (Hour(1byte), Minute(1byte), Second(1byte))
Source:
Parameters:
Name Type Description
hms string 時分秒の16進数文字列
Returns:
'H.M.S'形式の文字列
Type
string

(static) HMtoString(hm) → {string}

Description:
  • 時分データを文字列に変換 (Hour(1byte), Minute(1byte))
Source:
Parameters:
Name Type Description
hm string 時分の16進数文字列
Returns:
'H.M'形式の文字列
Type
string

(static) MStoString(ms) → {string}

Description:
  • 分秒データを文字列に変換 (Minute(1byte), Second(1byte))
Source:
Parameters:
Name Type Description
ms string 分秒の16進数文字列
Returns:
'M.S'形式の文字列
Type
string

(static) YYMDtoString(yymd) → {string}

Description:
  • 年月日データを文字列に変換 (Year(2byte), Month(1byte), Day(1byte))
Source:
Parameters:
Name Type Description
yymd string 年月日の16進数文字列
Returns:
'YYYY.M.D'形式の文字列
Type
string

(static) YYMtoString(yym) → {string}

Description:
  • 年月データを文字列に変換 (Year(2byte), Month(1byte))
Source:
Parameters:
Name Type Description
yym string 年月の16進数文字列
Returns:
'YYYY.M'形式の文字列
Type
string

(static) distributionBoardB2B4B6B9BBBD(eoj, epc, edt) → {string}

Description:
  • 分電盤メータリング チャンネル範囲指定の解析 EPC: 0xB2, 0xB4, 0xB6, 0xB9, 0xBB, 0xBD
Source:
Parameters:
Name Type Description
eoj string EOJの16進数文字列
epc string EPCの16進数文字列
edt string EDTの16進数文字列
Returns:
チャンネル範囲の文字列表現
Type
string

(static) distributionBoardB3(eoj, epc, edt) → {string}

Description:
  • 分電盤メータリング EPC 0xB3 積算電力量計測値リスト(片方向) 単位がC2に依存する
Source:
Parameters:
Name Type Description
eoj string EOJの16進数文字列
epc string EPCの16進数文字列
edt string EDTの16進数文字列
Returns:
積算電力量のJSON文字列
Type
string

(static) distributionBoardB5(eoj, epc, edt) → {string}

Description:
  • 分電盤メータリング EPC 0xB5 瞬時電流計測値リスト(片方向) 単位: 0.1A
Source:
Parameters:
Name Type Description
eoj string EOJの16進数文字列
epc string EPCの16進数文字列
edt string EDTの16進数文字列
Returns:
瞬時電流のJSON文字列
Type
string

(static) distributionBoardB7(eoj, epc, edt) → {string}

Description:
  • 分電盤メータリング EPC 0xB7 瞬時電力計測値リスト(片方向) 単位: 1W
Source:
Parameters:
Name Type Description
eoj string EOJの16進数文字列
epc string EPCの16進数文字列
edt string EDTの16進数文字列
Returns:
瞬時電力のJSON文字列
Type
string

(static) distributionBoardBA(eoj, epc, edt) → {string}

Description:
  • 分電盤メータリング EPC 0xBA 積算電力量計測値リスト(双方向) 単位はC2に従う
Source:
Parameters:
Name Type Description
eoj string EOJの16進数文字列
epc string EPCの16進数文字列
edt string EDTの16進数文字列
Returns:
積算電力量のJSON文字列(正逆両方向)
Type
string

(static) distributionBoardBC(eoj, epc, edt) → {string}

Description:
  • 分電盤メータリング EPC 0xBC 瞬時電流計測値リスト(双方向) 単位: 0.1A
Source:
Parameters:
Name Type Description
eoj string EOJの16進数文字列
epc string EPCの16進数文字列
edt string EDTの16進数文字列
Returns:
瞬時電流のJSON文字列(R相/T相)
Type
string

(static) distributionBoardBE(eoj, epc, edt) → {string}

Description:
  • 分電盤メータリング EPC 0xBE 瞬時電力計測値リスト(双方向) 単位: W
Source:
Parameters:
Name Type Description
eoj string EOJの16進数文字列
epc string EPCの16進数文字列
edt string EDTの16進数文字列
Returns:
瞬時電力のJSON文字列
Type
string

(static) distributionBoardC2(eoj, epc, edt) → {number}

Description:
  • 分電盤メータリング(0x0287) EPC 0xC2 積算電力量計測単位の解析
Source:
Parameters:
Name Type Description
eoj string EOJの16進数文字列
epc string EPCの16進数文字列
edt string EDTの16進数文字列
Returns:
計測単位の係数
Type
number

(static) elsAnalysis()

Description:
  • Alias for elsAnarysis (corrected spelling: analysis)
Source:

(static) elsAnarysis(els, callback)

Description:
  • ECHONET Lite電文(ELS)を解析して人間が読める形式に変換
Source:
Parameters:
Name Type Description
els Object ECHONET Lite電文オブジェクト
callback function 解析結果を受け取るコールバック関数

(static) initialize()

Description:
  • 辞書ファイルを読み込んで初期化する ノードプロファイル、スーパークラス、デバイスオブジェクト、メーカーコードの辞書を読み込む
Source:

(static) lowVoltageSmartElectricEnergyMeterE8(eoj, epc, edt) → {string}

Description:
  • 低圧スマート電力量メータ(0x0288) EPC 0xE8 瞬時電流計測値の解析
Source:
Parameters:
Name Type Description
eoj string EOJの16進数文字列
epc string EPCの16進数文字列
edt string EDTの16進数文字列
Returns:
瞬時電流のJSON文字列(R相/T相)
Type
string

(static) lowVoltageSmartElectricEnergyMeterEAEB(eoj, epc, edt) → {string}

Description:
  • 低圧スマート電力量メータ EPC 0xEA/0xEB 定時積算電力量計測値の解析
Source:
Parameters:
Name Type Description
eoj string EOJの16進数文字列
epc string EPCの16進数文字列(0xEA:正方向, 0xEB:逆方向)
edt string EDTの16進数文字列
Returns:
定時積算電力量の文字列表現
Type
string

(static) parseEDT(eoj, epc, edt) → {string}

Description:
  • EDT(ECHONET Lite Data)を解析して人間が読める形式に変換
Source:
Parameters:
Name Type Description
eoj string EOJの16進数文字列
epc string EPCの16進数文字列
edt string EDTの16進数文字列
Returns:
解析されたEDTの文字列表現
Type
string

(static) parseMapForm2(array) → {Array.<number>}

Description:
  • プロパティマップの記述形式2を解析してForm1に変換 16以上のプロパティ数の時に使用
Source:
Parameters:
Name Type Description
array Array.<number> バイト配列
Returns:
Form1形式のプロパティ配列
Type
Array.<number>

(static) refEOJ(eoj) → {string}

Description:
  • EOJ(ECHONET Lite Object)を人間が読める文字列に変換
Source:
Parameters:
Name Type Description
eoj string EOJの16進数文字列
Returns:
EOJの名称または元の文字列
Type
string

(static) refEPC(eoj, epc) → {string}

Description:
  • EPC(ECHONET Lite Property)を人間が読める文字列に変換
Source:
Parameters:
Name Type Description
eoj string EOJの16進数文字列
epc string EPCの16進数文字列
Returns:
EPCの名称または元の文字列
Type
string

(static) refESV(esv) → {string}

Description:
  • ESV(ECHONET Lite Service)コードを文字列に変換
Source:
Parameters:
Name Type Description
esv string ESVの16進数文字列
Returns:
ESVの名称
Type
string

(static) refer(facilities, callback)

Description:
  • ネットワーク内のECHONET Lite機器全体情報を参照し変換する
Source:
Parameters:
Name Type Description
facilities Object 機器情報オブジェクト
callback function 変換結果を受け取るコールバック関数

(static) referSpec81(eoj, epc, edt) → {string}

Description:
  • EPC 0x81 設置場所の解析
Source:
Parameters:
Name Type Description
eoj string EOJの16進数文字列
epc string EPCの16進数文字列
edt string EDTの16進数文字列
Returns:
設置場所の文字列表現
Type
string

(static) referSpec82(eoj, epc, edt) → {string}

Description:
  • EPC 0x82 Version情報の解析
Source:
Parameters:
Name Type Description
eoj string EOJの16進数文字列
epc string EPCの16進数文字列
edt string EDTの16進数文字列
Returns:
バージョン情報の文字列表現
Type
string

(static) referSpec8A(eoj, epc, edt) → {string}

Description:
  • EPC 0x8A メーカーコードの解析
Source:
Parameters:
Name Type Description
eoj string EOJの16進数文字列
epc string EPCの16進数文字列
edt string EDTの16進数文字列
Returns:
メーカー名の文字列表現
Type
string

(static) referSpec9D9E9F(eoj, epc, edt) → {string}

Description:
  • EPC 0x9D, 0x9E, 0x9F プロパティマップの解析
Source:
Parameters:
Name Type Description
eoj string EOJの16進数文字列
epc string EPCの16進数文字列
edt string EDTの16進数文字列
Returns:
プロパティマップの文字列表現
Type
string

(static) selectReferSpec(eoj, epc, edt) → {string}

Description:
  • 特殊なEPCの仕様に基づいてEDTを解析
Source:
Parameters:
Name Type Description
eoj string EOJの16進数文字列
epc string EPCの16進数文字列
edt string EDTの16進数文字列
Returns:
解析されたEDTの文字列表現
Type
string

(static) smartElectricEnergySubMeterE8(eoj, epc, edt) → {string}

Description:
  • スマート電力量サブメータ(0x028D) EPC 0xE8 瞬時電流計測値の解析
Source:
Parameters:
Name Type Description
eoj string EOJの16進数文字列
epc string EPCの16進数文字列
edt string EDTの16進数文字列
Returns:
瞬時電流のJSON文字列(R相/T相)
Type
string

(static) smartElectricEnergySubMeterE9(eoj, epc, edt) → {string}

Description:
  • スマート電力量サブメータ EPC 0xE9 瞬時電圧計測値の解析
Source:
Parameters:
Name Type Description
eoj string EOJの16進数文字列
epc string EPCの16進数文字列
edt string EDTの16進数文字列
Returns:
瞬時電圧のJSON文字列(R-S/S-T)
Type
string

(static) smartElectricEnergySubMeterEAEB(eoj, epc, edt) → {string}

Description:
  • スマート電力量サブメータ EPC 0xEA/0xEB 定時積算電力量計測値の解析
Source:
Parameters:
Name Type Description
eoj string EOJの16進数文字列
epc string EPCの16進数文字列(0xEA:正方向, 0xEB:逆方向)
edt string EDTの16進数文字列
Returns:
定時積算電力量の文字列表現
Type
string

(static) toHexArray(string) → {Array.<number>}

Description:
  • 16進表現の文字列を数値のバイト配列へ変換
Source:
Parameters:
Name Type Description
string string 16進数の文字列
Returns:
バイト配列
Type
Array.<number>

(static) toHexString(byte) → {string}

Description:
  • 1バイトを文字列の16進表現へ変換(1Byteは必ず2文字にする)
Source:
Parameters:
Name Type Description
byte number 変換する1バイトの数値
Returns:
2文字の16進数文字列
Type
string