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

added consumption alert service documentation

parent 34415e13
Branches
No related tags found
No related merge requests found
...@@ -13,39 +13,94 @@ ...@@ -13,39 +13,94 @@
py -m pip install plantuml-markdown py -m pip install plantuml-markdown
## Setting files hierarchy ## Setting files hierarchy
inside mkdocs.yml use the key nav: to configure the md files hierarchy inside mkdocs.yml, configure the md files hierarchy
nav: nav:
- Home: index.md - Home: index.md
- Pilote: - Easy Cozy:
- Introduction: pilote/index.md - Configuration: easycozy/config.md
- Ecolyo: - Commands: easycozy/commands.md
- Introduction: ecolyo/index.md - Known errors: easycozy/known_errors.md
- Getting started: - Scripts: easycozy/scripts.md
- Tips: easycozy/tips.md
- Ecolyo:
- Introduction: ecolyo/index.md
- Getting started:
- Setup your environment: ecolyo/getting_started/setup_your_environment.md - Setup your environment: ecolyo/getting_started/setup_your_environment.md
- Launch the application on local: ecolyo/getting_started/launch_local_application.md - Launch the application on local: ecolyo/getting_started/launch_local_application.md
- Launch a konnector on local: ecolyo/getting_started/launch_local_konnector.md - Launch a konnector on local: ecolyo/getting_started/launch_local_konnector.md
- Project Architecture: - Project Architecture:
- Architecture: ecolyo/project_architecture/architecture.md - Architecture: ecolyo/project_architecture/architecture.md
- Cozy: ecolyo/project_architecture/cozy.md - Libraries: ecolyo/project_architecture/libraries.md
- Environments: ecolyo/project_architecture/environments.md - Environments: ecolyo/project_architecture/environments.md
- DocTypes: ecolyo/project_architecture/doctypes.md - DocTypes: ecolyo/project_architecture/doctypes.md
- Application: - Remote DocTypes: ecolyo/project_architecture/remote_doctypes.md
- Application:
- Description: ecolyo/application/description.md - Description: ecolyo/application/description.md
- Redux: ecolyo/application/redux.md
- Scaffolding: ecolyo/application/scaffolding.md - Scaffolding: ecolyo/application/scaffolding.md
- Services: ecolyo/application/services.md - Services: ecolyo/application/services.md
- Gitflow: ecolyo/application/gitflow.md - Gitflow: ecolyo/application/gitflow.md
- Deploy: ecolyo/application/deploy.md - Deploy: ecolyo/application/deploy.md
- Konnectors: - Services:
- Introduction: ecolyo/konnectors/index.md - Description: ecolyo/services/index.md
- Enedis: ecolyo/konnectors/enedis.md - Monthly report notification: ecolyo/services/monthly_report_notification.md
- GRDF: ecolyo/konnectors/grdf.md - Aggregator usage events: ecolyo/services/aggregator_usage_events.md
- Eau du Grand Lyon: ecolyo/konnectors/egl.md - Consumption Alert: ecolyo/services/consumption_alert.md
- Proxy: - Functionalities:
- Initialization: ecolyo/functionalities/initialization.md
- Consumption: ecolyo/functionalities/consumption.md
- Ecogesture: ecolyo/functionalities/ecogesture.md
- Challenge: ecolyo/functionalities/challenge.md
- Profile Type: ecolyo/functionalities/profile_type.md
- Analysis: ecolyo/functionalities/analysis.md
- Usage events tracking: ecolyo/functionalities/usage_events_tracking.md
- Pilote:
- Pilote - TS - Back:
- Index: pilote/Pilote - TS - Back/index.md
- Application:
- Deploy: pilote/Pilote - TS - Back/application/deploy.md
- Functionalities:
- Routes: pilote/Pilote - TS - Back/functionalities/routes.md
- Getting Started:
- Launch the application on local: pilote/Pilote - TS - Back/getting_started/launch_local_application.md
- Setup your environment: pilote/Pilote - TS - Back/getting_started/setup_your_environment.md
- Project Architecture: pilote/Pilote - TS - Back/project_architecture/architecture.md
- Pilote - TS - Front:
- Index: pilote/Pilote - TS - Front/index.md
- Application:
- Deploy: pilote/Pilote - TS - Front/application/deploy.md
- Functionalities:
- Routes: pilote/Pilote - TS - Front/functionalities/functions.md
- Getting Started:
- Launch the application on local: pilote/Pilote - TS - Front/getting_started/launch_local_application.md
- Pilote - Usager:
- Application:
- Deploy: pilote/Pilote - Usager/application/deploy.md
- Doctypes: pilote/Pilote - Usager/application/doctypes.md
- Gitflow: pilote/Pilote - Usager/application/gitflow.md
- Scaffolding: pilote/Pilote - Usager/application/scaffolding.md
- Services: pilote/Pilote - Usager/application/services.md
- Store: pilote/Pilote - Usager/application/store.md
- Functionalities:
- Appointments: pilote/Pilote - Usager/functionalities/appointments.md
- Contact: pilote/Pilote - Usager/functionalities/contact.md
- Document: pilote/Pilote - Usager/functionalities/document.md
- Settings: pilote/Pilote - Usager/functionalities/setting.md
- Getting Started:
- Launch local doctypes: pilote/Pilote - Usager/getting_started/launch_local_doctypes.md
- Launch local services: pilote/Pilote - Usager/getting_started/launch_local_services.md
- Konnectors:
- Introduction: konnectors/index.md
- Enedis: konnectors/enedis.md
- GRDF: konnectors/grdf.md
- Eau du Grand Lyon: konnectors/egl.md
- Proxy:
- Description: proxy/description.md - Description: proxy/description.md
- Monitoring: proxy/monitoring.md
- Use cases: - Use cases:
- Enedis: proxy/use_cases/enedis.md - Enedis: proxy/use_cases/enedis.md
- Grdf Adict: proxy/use_cases/grdfadict.md - Grdf Adict: proxy/use_cases/grdfadict.md
## Project layout ## Project layout
......
# Definition of the service
The service will run everyday at 10.00 am, as defined in the manifest:
```
"consumptionAlert": {
"type": "node",
"file": "services/consumptionAlert/ecolyo.js",
"trigger": "@cron 0 3 * * *"
}
```
# Main responsabilities of the service
The service is reponsible of sending a mail to user to warn him about an overload in his fluid consumption (based on a limit the user fixed in the option panel).
For now it only monitors water consumptions.
Main steps are the following:
- Check the "sendConsumptionAlert" and "waterDailyConsumptionLimit" attributes in the com.grandlyon.ecolyo.profile doctype. If "sendConsumptionAlert" is set to true and "waterDailyConsumptionLimit" is not set to 0, service will continue, else it will stop.
- Fetches metadata to customize the mail (Public name, instance url, consumption of the last day fetched by the egl konnector).
- Check that the last consumption is greater than the limit set by the user. If false the service will stop.
- Build the mail.
- Send the mail.
# Sending mail
Doc of cozy for sendmail worker: https://docs.cozy.io/en/cozy-stack/workers/#sendmail-worker
!!! Send mail in local
In local you can use the mail hog tools to see the mail sent by the stack using http://cozy.tools:8025/
\ No newline at end of file
...@@ -10,4 +10,5 @@ All the konnectors are configured to retrieve user's data as far as 3 years back ...@@ -10,4 +10,5 @@ All the konnectors are configured to retrieve user's data as far as 3 years back
Some variation have to be considered : Some variation have to be considered :
- When the user launches the konnector manually, it fetches 1 year of data (in order to reduce running time). - When the user launches the konnector manually, it fetches 1 year of data (in order to reduce running time).
- When a konnector is launched by the cozy stack (at a random time between 10am and 11am), it fetches 3 years of data. - When a konnector is launched by the cozy stack (at a random time between 10am and 11am), it fetches 3 years of data.
\ No newline at end of file - When a konnector retrieves a load at the half-hour timeline (ex: enedis), it fetches back to 4 weeks.
\ No newline at end of file
...@@ -53,6 +53,7 @@ nav: ...@@ -53,6 +53,7 @@ nav:
- Description: ecolyo/services/index.md - Description: ecolyo/services/index.md
- Monthly report notification: ecolyo/services/monthly_report_notification.md - Monthly report notification: ecolyo/services/monthly_report_notification.md
- Aggregator usage events: ecolyo/services/aggregator_usage_events.md - Aggregator usage events: ecolyo/services/aggregator_usage_events.md
- Consumption Alert: ecolyo/services/consumption_alert.md
- Functionalities: - Functionalities:
- Initialization: ecolyo/functionalities/initialization.md - Initialization: ecolyo/functionalities/initialization.md
- Consumption: ecolyo/functionalities/consumption.md - Consumption: ecolyo/functionalities/consumption.md
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Please register or to comment