Skip to content
Snippets Groups Projects
Commit 20a9956e authored by Hugo NOUTS's avatar Hugo NOUTS
Browse files

Merge remote-tracking branch 'origin/master'

parents c9a87194 5d771042
No related branches found
No related tags found
No related merge requests found
Pipeline #18145 passed
......@@ -647,3 +647,46 @@ This doctype is used to store the different version of the terms of the applicat
| acceptedAt | DateTime | The date when the Cozy user accepted these terms |
| termsId | string | The id of the terms |
| version | string | The version number |
## MaxPower
### Description
This doctype is used to store the enedis maxpower values retrieved by the konnector on a daily basis. The value is in kVA.
### Doctype
**`com.grandlyon.enedis.maxpower`**
### Structure
| Field | Type | Description |
| ------ | ------ | ---------------------------------------------------------------- |
| load | number | maxPower in kVA |
| minute | number | minute of the date |
| hour | number | hour of the date |
| day | number | day of the date |
| month | number | month of the date |
| year | number | year of the date |
## Enedis Monthly Analysis Data
### Description
This doctype is used to store the enedis monthly analysis, it includes the month average half-hour consumption for weekdays and weekends, the minimum half-hour load, and the max power consumption of the month.
### Doctype
**`com.grandlyon.enedis.monthly.analysis.data`**
### Structure
| Field | Type | Description |
| ------- | -------------- | ------------------------------------------------------------------------------------------ |
| weekDaysHalfHourAverageValues | number[] | Half-hour average value for week days (monday to friday) |
| weekEndDaysHalfHourAverageValues | number[] | Half-hour average value for weekend days (saturday and sunday) |
| month | number | Month of the analysis |
| year | number | Year of the analysis |
| minLoad | number or null | Minimum half hour load of the month |
| maxPower | number or null | Max power value of the month |
......@@ -49,19 +49,16 @@ weekEndValuesArray : [
```
- Once the array is filled with all available values, we just have to calculate the average for each half-hour step
****Insert minimum cons value part once it's done****
- The **minimum value** is calculated by the *getMonthMinLoad* function, it takes the complete week and weekend values arrays as parameters and return the minimum value, excluding -1 (empty values), and 0 (null values).
- The **maxPower** value is fetched from the doctype *com.grandlyon.enedis.maxpower*, the value is stored on a daily basis, so take the maximum value for the given month.
- The result is stored in *com.grandlyon.enedis.monthly.analysis.data* according to the following model :
```
EnedisMonthlyAnalysisData {
weekDays: {
halfHourAverageValues: number[]
}
weekEndDays: {
halfHourAverageValues: number[]
}
weekDaysHalfHourAverageValues: number[]
weekEndDaysHalfHourAverageValues: number[]
minLoad: number
maxPower: number
month: number
year: number
}
......
......@@ -36,6 +36,9 @@ Route : **/v4/metering_data/consumption_load_curve**
Method : **GET**
Route : **/v4/metering_data/daily_consumption**
Method : **GET**
Route : **/v4/metering_data/daily_consumption_max_power**
```json
"params":
......@@ -72,6 +75,7 @@ For more information about Datahub-Enedis API, checkout the [Datahub documentati
| formateData | Format data for DB storage and remove bad data |
| buildAgregatedData | Retrieve and remove old data for a specific doctype and return an array of agregated data |
| buildDataFromKey | Format an entry for DB storage using key and value. For year doctype: key = "YYYY". For month doctype: key = "YYYY-MM" |
| getMaxPower | Retrieve data from the maxPower API. Format: `{ value: "kVA", "date": "YYYY-MM-DD" }` |
| isHistoryLoaded | Function checking if the history is loaded |
| resetInProgressAggregatedData | Function handling special case.The temporary aggregated data need to be remove in order for the most recent one te be saved. Ex for com.grandlyon.enedis.year : `{ load: 76.712, year: 2020, ... }` need to be replace by `{ load: 82.212, year: 2020, ... }` after enedis data reprocess |
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment