Skip to content
No description, website, or topics provided.
JavaScript Python HTML CSS C++
Branch: master
Clone or download
Fetching latest commit…
Cannot retrieve the latest commit at this time.
Type Name Latest commit message Commit time
Failed to load latest commit information.
.vscode Add UPS doc Oct 1, 2018
DL303 Add DL303 demo Dec 20, 2018
Delta_UPS Add UPS doc #1 Oct 1, 2018
Demo Debug #2 May 25, 2018
ET7044 Debug html tag & socket connect Oct 10, 2018
doc Add database doc Oct 1, 2018
heroku Update text Jun 11, 2019
lib-license Add library license #1 Mar 9, 2019
lib Update mongoDB.js module.exports function to class Jun 16, 2019
picture Add DL303 Sep 29, 2018
power-meter Fix arduino doc bug Feb 27, 2019
test Debug yesterdayStart and yesterdayEnd value in aggregateYesterdayAvgP… Sep 7, 2018
.env-sample 重組 .env 設定檔 Mar 6, 2019
.gitignore 重組 .env 設定檔 Mar 6, 2019
LICENSE Add License Mar 7, 2019 Add library license Mar 9, 2019
app.js Update setInterval Jun 18, 2019
build.json Add DL303 in build.json Dec 20, 2018
mongoDB.js Add DL303 demo Dec 20, 2018
package.json Add query UPS logs export file May 24, 2019


作品展示 demo:

2.linebot demo:

3.raspberry pi3 touch panel demo:









第三方Library license

Library license



npm v5.6+ node v8+


Python v3.7.0+


mongoDB v3.6+

MQTT Protocol broker




1. 自製電源及環境監測裝置(安裝教學

MQTT Topic Description Message
current 溫度、濕度、電流 {


MQTT Topic Description Message
ET7044/DOstatus ET7044 D0~D7 status [false, false, false, false, false, false, false, false]
ET7044/write Control D0~D7 status [false, false, false, false, false, false, false, false]



MQTT Topic Description Message
DL303/CO2 CO2測量 0 to 9999 ppm (NDIR)
DL303/RH 相對溼度測量 0 to 100% RH
DL303/TC 溫度測量 -10 to +50°C
DL303/DC 露點溫度 由溫度與相對溼度計算而得


MQTT Topic Description Message
PM3133/A 比流器1 10 (A)
PM3133/B 比流器2 10 (A)
PM3133/C 比流器3 10 (A)

5.UPS 監控程式(範例程式

MQTT Topic Description Message
UPS_Monitor UPS監測 example

6.web service & service(範例程式

(1)web service

Method API Description
GET / web dashboard
POST /ET7044 ET7044 control


current data structure:

UPS_Monitor data structure:

ET7044/DOstatus data structure:

Event Source JSON KEY
humidity MQTT topic current Humidity
temperature MQTT topic current Temperature
current MQTT topic current currents
inputVolt_A MQTT topic UPS_Monitor input_A.inputVolt_A
inputFreq_A MQTT topic UPS_Monitor input_A.inputFreq_A
outputVolt_A MQTT topic UPS_Monitor output_A.outputVolt_A
outputFreq_A MQTT topic UPS_Monitor output_A.outputFreq_A
outputAmp_A MQTT topic UPS_Monitor output_A.outputAmp_A
outputWatt_A MQTT topic UPS_Monitor output_A.outputWatt_A
systemMode_A MQTT topic UPS_Monitor output_A.systemMode_A
outputPercent_A MQTT topic UPS_Monitor output_A.outputPercent_A
batteryHealth_A MQTT topic UPS_Monitor battery_A.status.batteryHealth_A
batteryCharge_Mode_A MQTT topic UPS_Monitor battery_A.status.batteryCharge_Mode_A
batteryTemp_A MQTT topic UPS_Monitor battery_A.status.batteryTemp_A
batteryRemain_A MQTT topic UPS_Monitor battery_A.status.batteryRemain_Min_A
batteryRemain_Percent_A MQTT topic UPS_Monitor battery_A.status.batteryRemain_Percent_A
inputVolt_B MQTT topic UPS_Monitor input_B.inputVolt_B
inputFreq_B MQTT topic UPS_Monitor input_B.inputFreq_B
outputVolt_B MQTT topic UPS_Monitor output_B.outputVolt_B
outputFreq_B MQTT topic UPS_Monitor output_B.outputFreq_B
outputAmp_B MQTT topic UPS_Monitor output_B.outputAmp_B
outputWatt_B MQTT topic UPS_Monitor output_B.outputWatt_B
systemMode_B MQTT topic UPS_Monitor output_B.systemMode_B
outputPercent_B MQTT topic UPS_Monitor output_B.outputPercent_B
batteryHealth_B MQTT topic UPS_Monitor battery_B.status.batteryHealth_B
batteryCharge_Mode_B MQTT topic UPS_Monitor battery_B.status.batteryCharge_Mode_B
batteryTemp_B MQTT topic UPS_Monitor battery_B.status.batteryTemp_B
batteryRemain_B MQTT topic UPS_Monitor battery_B.status.batteryRemain_Min_B
batteryRemain_Percent_B MQTT topic UPS_Monitor battery_B.status.batteryRemain_Percent_B
D0 MQTT topic ET7044/DOstatus Array[0]
D1 MQTT topic ET7044/DOstatus Array[1]
D2 MQTT topic ET7044/DOstatus Array[2]


(1)Localhost MongoDB Database

Database name smart-data-center

Database Collection Description Data example
smart-data-center powerMeter power-meter logs example
smart-data-center powerMeterPower power-meter watt logs example
smart-data-center ups delta ups logs example
smart-data-center upsPower_A delta ups watt logs example
smart-data-center upsPower_B delta ups watt logs example

(2)Public Cloud MongoDB Database(mLab)

mLab for linebot use

Database name smart-data-center

Database Collection Description Data example
smart-data-center powerMeter Latest power-meter information example
smart-data-center ups_A Latest delta ups(A) information example
smart-data-center ups_B Latest delta ups(B) information example
smart-data-center control Latest ET7044 control information example

7.linebot service on HEROKU(範例程式

Service for linebot use

Method API Description Body Example
GET / test heroku service
GET /test test connect mLab
POST /webhooks for linebot use
POST /post/push notify power consumption {
powerMeterPower: 123,
upsPower_A: 456,
upsPower_B: 789
POST /post/control/message ET7044 control {
message: "進風風扇:開啟"
POST /message icinga2 alert notification {
message: "需要維修"


(1)Git clone project

$ git clone

(2) Switch directory

$ cd smart-data-center

(3)Install modules

$ npm install

(4)Install pm2 project management tool

$ npm install pm2 -g

(5)Edit build.json 留下需要的服務

  "apps": [
      "name": "smart-data-center",
      "script": "./app.js"
      "name": "smart-data-center-mongodb",
      "script": "./mongoDB.js"
      "name": "smart-data-center-icinga2",
      "script": "./icinga2/icinga2.js"
      "name": "smart-data-center-ET7044",
      "script": "./ET7044/ET7044_finish.js"

(6)建立 .env 檔案

cp .env-sample .env


PORT = 3006
MQTT = 'mqtt://'
MONGO_URL = 'mongodb://'
MONGODB = 'mongodb://'

(8)run service

$ npm start


You can’t perform that action at this time.