# SCG_activeair ###### tags: `api` # edge ## get list of available device and location of home ``` GET /facilities/activeair/:home_id ``` ### Parameters - `Parameter` | Name | Type | Description | |----------|------------|---------------------------------------| | home_id | `String` | | ### Success response example #### Success response example - `Success-Response:` ```json { "result": { "application_types": [ "Solar", "ActiveAirQuality", "ActiveAirFlow" ], "applications": { "active_air_flow": { "locations": [ { "devices": [ { "id": "12_1_0013A20041D5D40D", "name": "12_1_0013A20041D5D40D", "type": "co2" }, { "id": "10_1_0013A20041D5D40D", "name": "10_1_0013A20041D5D40D", "type": "pm10.0" }, { "id": "10_1_0013A20041D5D40D", "name": "10_1_0013A20041D5D40D", "type": "pm2.5" }, { "id": "10_1_0013A20041D5D40D", "name": "10_1_0013A20041D5D40D", "type": "pm1.0" }, { "id": "8_1_0013A20041D5D40D", "name": "8_1_0013A20041D5D40D", "type": "humidity" }, { "id": "8_1_0013A20041D5D40D", "name": "8_1_0013A20041D5D40D", "type": "temperature" } ], "location": "outdoor", "location_name": "outdoor_room_name", "original_location_name": "outdoor_room" }, { "devices": [ { "id": "8_1_0013A20041D5D31D", "name": "8_1_0013A20041D5D31D", "type": "humidity" }, { "id": "8_1_0013A20041D5D31D", "name": "8_1_0013A20041D5D31D", "type": "temperature" } ], "location": "attic", "location_name": "attic_room_name", "original_location_name": "attic_room" }, { "devices": [ { "id": "8_1_0013A20041D5D580", "name": "8_1_0013A20041D5D580", "type": "temperature" }, { "id": "130_1_0013A20041D5D1B6", "name": "130_1_0013A20041D5D1B6", "type": "relay" }, { "id": "130_1_0013A20041D5CF68", "name": "130_1_0013A20041D5CF68", "type": "relay" }, { "id": "130_1_0013A20041D5D64D", "name": "130_1_0013A20041D5D64D", "type": "relay" }, { "id": "10_1_0013A20041D5D580", "name": "10_1_0013A20041D5D580", "type": "pm2.5" }, { "id": "10_1_0013A20041D5D580", "name": "10_1_0013A20041D5D580", "type": "pm1.0" }, { "id": "8_1_0013A20041D5D580", "name": "8_1_0013A20041D5D580", "type": "humidity" }, { "id": "10_1_0013A20041D5D580", "name": "10_1_0013A20041D5D580", "type": "pm10.0" }, { "id": "12_1_0013A20041D5D580", "name": "12_1_0013A20041D5D580", "type": "co2" } ], "location": "indoor", "location_name": "indoor_room_test", "original_location_name": "indoor_room" } ] }, "active_air_quality": { "locations": [ { "devices": [ { "id": "8_1_0013A20041D5D580", "name": "8_1_0013A20041D5D580", "type": "humidity" }, { "id": "8_1_0013A20041D5D580", "name": "8_1_0013A20041D5D580", "type": "temperature" }, { "id": "12_1_0013A20041D5D580", "name": "12_1_0013A20041D5D580", "type": "co2" }, { "id": "134_2_0013A2004197FCE6", "name": "134_2_0013A2004197FCE6", "type": "pwm" }, { "id": "10_1_0013A20041D5D580", "name": "10_1_0013A20041D5D580", "type": "pm2.5" }, { "id": "10_1_0013A20041D5D580", "name": "10_1_0013A20041D5D580", "type": "pm10.0" }, { "id": "10_1_0013A20041D5D580", "name": "10_1_0013A20041D5D580", "type": "pm1.0" }, { "id": "130_1_0013A20041D5D406", "name": "130_1_0013A20041D5D406", "type": "relay" } ], "location": "indoor", "location_name": "indoor_room_test", "original_location_name": "indoor_room" }, { "devices": [ { "id": "12_1_0013A20041D5D40D", "name": "12_1_0013A20041D5D40D", "type": "co2" }, { "id": "10_1_0013A20041D5D40D", "name": "10_1_0013A20041D5D40D", "type": "pm10.0" }, { "id": "10_1_0013A20041D5D40D", "name": "10_1_0013A20041D5D40D", "type": "pm2.5" }, { "id": "8_1_0013A20041D5D40D", "name": "8_1_0013A20041D5D40D", "type": "humidity" }, { "id": "10_1_0013A20041D5D40D", "name": "10_1_0013A20041D5D40D", "type": "pm1.0" }, { "id": "8_1_0013A20041D5D40D", "name": "8_1_0013A20041D5D40D", "type": "temperature" } ], "location": "outdoor", "location_name": "outdoor_room_name", "original_location_name": "outdoor_room" } ] }, "solar": { "locations": [ { "devices": [ { "id": "80_1_0013A20041C9EABC", "name": "80_1_0013A20041C9EABC", "type": "grid_in_power" }, { "id": "80_1_0013A20041C9EABC", "name": "80_1_0013A20041C9EABC", "type": "power_meter_online" }, { "id": "80_1_0013A20041C9EABC", "name": "80_1_0013A20041C9EABC", "type": "inverter_online" }, { "id": "80_1_0013A20041C9EABC", "name": "80_1_0013A20041C9EABC", "type": "total_energy" }, { "id": "80_1_0013A20041C9EABC", "name": "80_1_0013A20041C9EABC", "type": "energy_per_year" }, { "id": "80_1_0013A20041C9EABC", "name": "80_1_0013A20041C9EABC", "type": "energy_per_month" }, { "id": "80_1_0013A20041C9EABC", "name": "80_1_0013A20041C9EABC", "type": "energy_per_week" }, { "id": "80_1_0013A20041C9EABC", "name": "80_1_0013A20041C9EABC", "type": "energy_per_day" }, { "id": "80_1_0013A20041C9EABC", "name": "80_1_0013A20041C9EABC", "type": "grid_power" }, { "id": "80_1_0013A20041C9EABC", "name": "80_1_0013A20041C9EABC", "type": "grid_current" }, { "id": "80_1_0013A20041C9EABC", "name": "80_1_0013A20041C9EABC", "type": "grid_voltage" }, { "id": "80_1_0013A20041C9EABC", "name": "80_1_0013A20041C9EABC", "type": "in_power_ch2" }, { "id": "80_1_0013A20041C9EABC", "name": "80_1_0013A20041C9EABC", "type": "in_voltage_ch2" }, { "id": "80_1_0013A20041C9EABC", "name": "80_1_0013A20041C9EABC", "type": "in_power_ch1" }, { "id": "80_1_0013A20041C9EABC", "name": "80_1_0013A20041C9EABC", "type": "in_current_ch1" }, { "id": "80_1_0013A20041C9EABC", "name": "80_1_0013A20041C9EABC", "type": "in_voltage_ch1" }, { "id": "80_1_0013A20041C9EABC", "name": "80_1_0013A20041C9EABC", "type": "in_current_ch2" } ], "location": null, "location_name": null, "original_location_name": null } ] } } } } ``` --- ## get home dashboard ``` GET /facilities/activeair/:home_id/dashboard ``` ### Parameters - `Parameter` | Name | Type | Description | |----------|------------|---------------------------------------| | home_id | `String` | | ### Success response example #### Success response example - `Success-Response:` ```json { "result": { "application_types": [ "ActiveAirFlow", "ActiveAirQuality", "Solar" ], "data": { "attic": { "co2": [ { "timestamp": 1647226800, "unit": "ppm", "value": null } ], "humidity": [ { "timestamp": 1647226800, "unit": "%", "value": "71.19039916992188" } ], "pm2.5": [ { "timestamp": 1647226800, "unit": "𝜇g./m3", "value": null } ], "temperature": [ { "timestamp": 1647226800, "unit": "°C", "value": "30.46466064453125" } ] }, "indoor": { "co2": [ { "timestamp": 1647226800, "unit": "ppm", "value": null } ], "humidity": [ { "timestamp": 1647226800, "unit": "%", "value": null } ], "pm2.5": [ { "timestamp": 1647226800, "unit": "𝜇g./m3", "value": "57.0" } ], "temperature": [ { "timestamp": 1647226800, "unit": "°C", "value": null } ] }, "outdoor": { "co2": [ { "timestamp": 1647226800, "unit": "ppm", "value": null } ], "humidity": [ { "timestamp": 1647226800, "unit": "%", "value": "66.62802124023438" } ], "pm2.5": [ { "timestamp": 1647226800, "unit": "𝜇g./m3", "value": null } ], "temperature": [ { "timestamp": 1647226800, "unit": "°C", "value": "32.40589904785156" } ] } } } } ``` --- # active airflow ## get active airflow status of selected home ``` GET /facilities/activeair/flow/:home_id ``` ### Parameters - `Parameter` | Name | Type | Description | |----------|------------|---------------------------------------| | home_id | `String` | | ### Success response example #### Success response example - `Success-Response:` ```json { "result": { "locations": [ { "location": "outdoor", "location_name": "indoor_room_name", "mode": "Manual", "original_location_name": "outdoor_room", "state": "Off" }, { "location": "attic", "location_name": "attic_room_name", "mode": "Manual", "original_location_name": "attic_room", "state": "Off" }, { "location": "indoor", "location_name": "indoor_room_test", "mode": "Manual", "original_location_name": "indoor_room", "state": "Off" } ], "mode": "Manual", "state": "Off" } } ``` ## get active air flow history data of selected home ``` GET /facilities/activeair/flow/:home_id/:dataType?location= ``` ### Parameters - `Parameter` | Name | Type | Description | |----------|------------|---------------------------------------| | home_id | `String` | | | dataType | `String` | [current, history] | | location | `Query String` | [indoor, outdoor, attic] ### Success response example #### current: Success response example ```json { "result": { "data": { "co2": { "comfort_level": { "color": "#45A85E", "level": "Excellent", "text": "excellent" }, "unit": "ppm", "value": null }, "humidity": { "comfort_level": { "color": "#75BAFF", "level": "Humid", "text": "humid" }, "unit": "%", "value": "63.461822509765625" }, "pm2.5": { "comfort_level": { "color": "#75BAFF", "level": "Good", "text": "good" }, "unit": "𝜇g./m3", "value": null }, "temperature": { "comfort_level": { "color": "#FCB757", "level": "Hot", "text": "hot" }, "unit": "°C", "value": "33.21028137207031" } }, "location": "outdoor", "location_name": "outdoor_room_name", "original_location_name": "outdoor_room" } } ``` #### history: Success response example ```json { "result": { "data": { "co2": { "current": { "comfort_level": { "color": "#45A85E", "level": "Excellent", "text": "excellent" }, "unit": "ppm", "value": null }, "historical": [ { "name": 12, "timestamp": 1647147600, "value": null }, { "name": 13, "timestamp": 1647151200, "value": null }, { "name": 14, "timestamp": 1647154800, "value": null }, { "name": 15, "timestamp": 1647158400, "value": null }, { "name": 16, "timestamp": 1647162000, "value": null }, { "name": 17, "timestamp": 1647165600, "value": null }, { "name": 18, "timestamp": 1647169200, "value": null }, { "name": 19, "timestamp": 1647172800, "value": null }, { "name": 20, "timestamp": 1647176400, "value": null }, { "name": 21, "timestamp": 1647180000, "value": null }, { "name": 22, "timestamp": 1647183600, "value": null }, { "name": 23, "timestamp": 1647187200, "value": null }, { "name": 0, "timestamp": 1647190800, "value": null }, { "name": 1, "timestamp": 1647194400, "value": null }, { "name": 2, "timestamp": 1647198000, "value": null }, { "name": 3, "timestamp": 1647201600, "value": null }, { "name": 4, "timestamp": 1647205200, "value": null }, { "name": 5, "timestamp": 1647208800, "value": null }, { "name": 6, "timestamp": 1647212400, "value": null }, { "name": 7, "timestamp": 1647216000, "value": null }, { "name": 8, "timestamp": 1647219600, "value": null }, { "name": 9, "timestamp": 1647223200, "value": null }, { "name": 10, "timestamp": 1647226800, "value": null }, { "name": 11, "timestamp": 1647230400, "value": null }, { "name": 12, "timestamp": 1647234000, "value": null } ], "unit": "ppm" }, "humidity": { "current": { "comfort_level": { "color": "#75BAFF", "level": "Humid", "text": "humid" }, "unit": "%", "value": "63.461822509765625" }, "historical": [ { "name": 12, "timestamp": 1647147600, "value": "69.03890991210938" }, { "name": 13, "timestamp": 1647151200, "value": "68.15390014648438" }, { "name": 14, "timestamp": 1647154800, "value": "67.15444946289062" }, { "name": 15, "timestamp": 1647158400, "value": "65.84982299804688" }, { "name": 16, "timestamp": 1647162000, "value": "65.94137573242188" }, { "name": 17, "timestamp": 1647165600, "value": "66.26181030273438" }, { "name": 18, "timestamp": 1647169200, "value": "66.78823852539062" }, { "name": 19, "timestamp": 1647172800, "value": "67.71139526367188" }, { "name": 20, "timestamp": 1647176400, "value": "66.83401489257812" }, { "name": 21, "timestamp": 1647180000, "value": "69.35171508789062" }, { "name": 22, "timestamp": 1647183600, "value": "71.78549194335938" }, { "name": 23, "timestamp": 1647187200, "value": "72.33480834960938" }, { "name": 0, "timestamp": 1647190800, "value": "72.74679565429688" }, { "name": 1, "timestamp": 1647194400, "value": "73.22744750976562" }, { "name": 2, "timestamp": 1647198000, "value": "73.86068725585938" }, { "name": 3, "timestamp": 1647201600, "value": "75.03561401367188" }, { "name": 4, "timestamp": 1647205200, "value": "75.37130737304688" }, { "name": 5, "timestamp": 1647208800, "value": "75.89010620117188" }, { "name": 6, "timestamp": 1647212400, "value": "75.96640014648438" }, { "name": 7, "timestamp": 1647216000, "value": "74.38711547851562" }, { "name": 8, "timestamp": 1647219600, "value": "71.29721069335938" }, { "name": 9, "timestamp": 1647223200, "value": "69.61111450195312" }, { "name": 10, "timestamp": 1647226800, "value": "66.45254516601562" }, { "name": 11, "timestamp": 1647230400, "value": "64.20950317382812" }, { "name": 12, "timestamp": 1647234000, "value": "63.461822509765625" } ], "unit": "%" }, "pm2.5": { "current": { "comfort_level": { "color": "#75BAFF", "level": "Good", "text": "good" }, "unit": "𝜇g./m3", "value": null }, "historical": [ { "name": 12, "timestamp": 1647147600, "value": null }, { "name": 13, "timestamp": 1647151200, "value": null }, { "name": 14, "timestamp": 1647154800, "value": null }, { "name": 15, "timestamp": 1647158400, "value": null }, { "name": 16, "timestamp": 1647162000, "value": null }, { "name": 17, "timestamp": 1647165600, "value": null }, { "name": 18, "timestamp": 1647169200, "value": null }, { "name": 19, "timestamp": 1647172800, "value": null }, { "name": 20, "timestamp": 1647176400, "value": null }, { "name": 21, "timestamp": 1647180000, "value": null }, { "name": 22, "timestamp": 1647183600, "value": null }, { "name": 23, "timestamp": 1647187200, "value": null }, { "name": 0, "timestamp": 1647190800, "value": null }, { "name": 1, "timestamp": 1647194400, "value": null }, { "name": 2, "timestamp": 1647198000, "value": null }, { "name": 3, "timestamp": 1647201600, "value": null }, { "name": 4, "timestamp": 1647205200, "value": null }, { "name": 5, "timestamp": 1647208800, "value": null }, { "name": 6, "timestamp": 1647212400, "value": null }, { "name": 7, "timestamp": 1647216000, "value": null }, { "name": 8, "timestamp": 1647219600, "value": null }, { "name": 9, "timestamp": 1647223200, "value": null }, { "name": 10, "timestamp": 1647226800, "value": null }, { "name": 11, "timestamp": 1647230400, "value": null }, { "name": 12, "timestamp": 1647234000, "value": null } ], "unit": "𝜇g./m3" }, "temperature": { "current": { "comfort_level": { "color": "#FCB757", "level": "Hot", "text": "hot" }, "unit": "°C", "value": "33.21028137207031" }, "historical": [ { "name": 12, "timestamp": 1647147600, "value": "33.03868103027344" }, { "name": 13, "timestamp": 1647151200, "value": "33.33898162841797" }, { "name": 14, "timestamp": 1647154800, "value": "33.65000915527344" }, { "name": 15, "timestamp": 1647158400, "value": "33.87523651123047" }, { "name": 16, "timestamp": 1647162000, "value": "33.91813659667969" }, { "name": 17, "timestamp": 1647165600, "value": "33.703636169433594" }, { "name": 18, "timestamp": 1647169200, "value": "33.25318145751953" }, { "name": 19, "timestamp": 1647172800, "value": "32.84562683105469" }, { "name": 20, "timestamp": 1647176400, "value": "32.60968017578125" }, { "name": 21, "timestamp": 1647180000, "value": "32.470245361328125" }, { "name": 22, "timestamp": 1647183600, "value": "32.277198791503906" }, { "name": 23, "timestamp": 1647187200, "value": "32.094871520996094" }, { "name": 0, "timestamp": 1647190800, "value": "31.848190307617188" }, { "name": 1, "timestamp": 1647194400, "value": "31.665863037109375" }, { "name": 2, "timestamp": 1647198000, "value": "31.429916381835938" }, { "name": 3, "timestamp": 1647201600, "value": "31.129608154296875" }, { "name": 4, "timestamp": 1647205200, "value": "31.07598876953125" }, { "name": 5, "timestamp": 1647208800, "value": "30.915115356445312" }, { "name": 6, "timestamp": 1647212400, "value": "30.76495361328125" }, { "name": 7, "timestamp": 1647216000, "value": "30.84003448486328" }, { "name": 8, "timestamp": 1647219600, "value": "31.37628936767578" }, { "name": 9, "timestamp": 1647223200, "value": "31.88037109375" }, { "name": 10, "timestamp": 1647226800, "value": "32.67402648925781" }, { "name": 11, "timestamp": 1647230400, "value": "33.44622802734375" }, { "name": 12, "timestamp": 1647234000, "value": "33.21028137207031" } ], "unit": "°C" } }, "location": "outdoor", "location_name": "outdoor_room_name", "original_location_name": "outdoor_room" } } ``` ## update active airflow state of selected home (all device) ``` PUT /facilities/activeair/flow/:home_id ``` ### Parameters - `Parameter` | Name | Type | Description | |----------|------------|---------------------------------------| | home_id | `String` | | ### Request Body | Name | Type | Description | |----------|------------|---------------------------------------| | state | `String` | | On, Off ```json { "state": "On" } ``` ## update active airflow mode of selected home (all device) ``` PUT /facilities/activeair/flow/:home_id/mode ``` ### Parameters - `Parameter` | Name | Type | Description | |----------|------------|---------------------------------------| | home_id | `String` | | ### Request Body | Name | Type | Description | |----------|------------|---------------------------------------| | mode | `String` | | Auto, Manual ```json { "mode": "Auto" } ``` --- # active airQuality ## get active air quality status of selected home ``` GET /facilities/activeair/quality/:home_id ``` ### Parameters - `Parameter` | Name | Type | Description | |----------|------------|---------------------------------------| | home_id | `String` | | ### Success response example #### Success response example - `Success-Response:` ```json { "result": { "locations": [ { "location": "outdoor", "location_name": "indoor_room_name", "mode": "Auto", "original_location_name": "outdoor_room", "state": "Off" }, { "location": "indoor", "location_name": "indoor_room_test", "mode": "Auto", "original_location_name": "indoor_room", "state": "On" }, { "location": "attic", "location_name": "attic_room_name", "mode": "Auto", "original_location_name": "attic_room", "state": "Off" } ], "mode": "Auto", "state": "Off" } } ``` ## get active air quality data of selected home ``` GET /facilities/activeair/quality/:home_id/:dataType?location= ``` ### Parameters - `Parameter` | Name | Type | Description | |----------|------------|---------------------------------------| | home_id | `String` | | | dataType | `String` | [state, fan_level, current, history] | | location | `Query String` ## update active air quality data of selected location ``` PUT /facilities/activeair/quality/:home_id/:dataType?location= ``` ### Parameters - `Parameter` | Name | Type | Description | |----------|------------|---------------------------------------| | home_id | `String` | | | dataType | `String` | [state, fan_level] | | location | `Query String` ### Request Body | Name | Type | Description | |----------|------------|---------------------------------------| | state | `String` | [On, Off] | | fan_level | `Number` | | ```json { "state": "On" } ``` ## update active airquality state of selected home (all device) ``` PUT /facilities/activeair/quality/:home_id ``` ### Parameters - `Parameter` | Name | Type | Description | |----------|------------|---------------------------------------| | home_id | `String` | | ### Request Body | Name | Type | Description | |----------|------------|---------------------------------------| | state | `String` | [On, Off] | ```json { "state": "On" } ``` ## update active airquality mode of selected home (all device) ``` PUT /facilities/activeair/quality/:home_id/mode ``` ### Parameters - `Parameter` | Name | Type | Description | |----------|------------|---------------------------------------| | home_id | `String` | | ### Request Body | Name | Type | Description | |----------|------------|---------------------------------------| | mode | `String` | [Auto, Manual] | ```json { "mode": "Manual" } ```