Add skills, docs, and tool references
- OpenOCPP skill for EV charger firmware - Energy markets documentation (EPEX SPOT, EEX GO, PPA) - R&D tools: HAMLET, OPLEM, OpenSTEF, OpenDSM - EV tools: CitrineOS, OpenOCPP, EVerest - Standards: Flex Ready, S2, OpenADR - Architecture and deployment docs
This commit is contained in:
67
TODO.md
67
TODO.md
@@ -17,46 +17,51 @@ FlexMeasures = élément central. Volet R&D LEM (Local Energy Market).
|
||||
| cariflex-geo | Géolocalisation assets | Tous sur la Martinique (lieux réels) |
|
||||
| cariflex-s2-docs | Docs S2/OpenADR | `docs/s2_architecture.md` |
|
||||
| cariflex-flex-ready | Standard Flex Ready® | `docs/flex_ready_standard.md` |
|
||||
| cariflex-lem-rd | Outils LEM R&D | OPLEM, HAMLET, lemlab documentés |
|
||||
| cariflex-map | Carte FlexMeasures | Patch OSM (Mapbox → OpenStreetMap) |
|
||||
| cariflex-lem-rd | Outils LEM R&D | OPLEM ✅, HAMLET ✅, lemlab documentés |
|
||||
| cariflex-map | Carte FlexMeasures | Patch OSM (Mapbox → OpenStreetMap) ✅ |
|
||||
| cariflex-api | API FlexMeasures | Connexion OK (token JWT) |
|
||||
| cariflex-concepts | Documentation concepts | VPP, Aggregator, Flex Trading, EPEX SPOT |
|
||||
| cariflex-epex | Intégration EPEX SPOT | Day-ahead, Intraday, Balancing |
|
||||
| cariflex-docs | Documentation complète | architecture, deployment, concepts, PPA, GO, marchés |
|
||||
| cariflex-tools | Outils installés | OPLEM ✅, OpenLEADR ✅, HAMLET ✅, FM Client ✅ |
|
||||
| cariflex-ppa | Documentation PPA | `docs/ppa.md` |
|
||||
| cariflex-go | Garanties d'Origine | `docs/go_certificates.md` |
|
||||
| cariflex-stack | Stack technique | `docs/stack.md` |
|
||||
|
||||
## 📝 En cours
|
||||
## 📝 En attente
|
||||
|
||||
| ID | Tâche | Détail |
|
||||
|----|-------|--------|
|
||||
| cariflex-hamlet | Installer HAMLET | Conda env `hamlet-rd`, deps en cours |
|
||||
|
||||
## 📝 À faire
|
||||
|
||||
| ID | Tâche | Détail |
|
||||
|----|-------|--------|
|
||||
| cariflex-flex-config | Config flexibilité assets | flex_context + flex_model par type |
|
||||
| ID | Tâche | Détail | Blocage |
|
||||
|----|-------|--------|---------|
|
||||
| cariflex-gitea | Push repo Gitea | Token ou SSH requis | Credentials Gitea |
|
||||
| cariflex-flex-config | Config flexibilité | flex_context + flex_model par type | — |
|
||||
| cariflex-citrineos | Déployer CitrineOS | CSMS open-source OCPP 2.0.1 pour bornes VE |
|
||||
| cariflex-openocpp | Déployer OpenOCPP | Firmware OCPP 1.6J/2.0.1 pour bornes EV |
|
||||
| cariflex-opendsm | Déployer OpenDSM | Calcul consommation normalisée |
|
||||
| cariflex-openstef | Déployer OpenSTEF | Prévision énergétique open-source |
|
||||
| cariflex-shapeshifter | Déployer ShapeShifter | Flexibility market platform |
|
||||
| cariflex-everest | Déployer EVerest | EV charging middleware |
|
||||
| cariflex-s2-cem | Déployer S2 CEM | flexmeasures-client[s2] |
|
||||
| cariflex-openleadr | OpenLEADR | Passerelle OpenADR 2.0b pour DSO |
|
||||
| cariflex-oplem | Installer OPLEM | `pip install oplem` |
|
||||
| cariflex-dashboard | Dashboard Cariflex | Flexibilité + signaux DSO |
|
||||
| cariflex-rd-sim | Simulation LEM | Scénarios HAMLET/OPLEM |
|
||||
| cariflex-dso-test | Test intégration DSO | Aggregator API Flex Ready® |
|
||||
| cariflex-logo | Logo Cariflex | Remplacer logo FM |
|
||||
| cariflex-hal | Article HAL | Extraire texte PDF |
|
||||
| cariflex-flex-config | Config flexibilité | flex_context + flex_model par type |
|
||||
## Actifs FlexMeasures (40)
|
||||
|
||||
## Actifs FlexMeasures
|
||||
| Type | Nb | Capacité | Localisation |
|
||||
|------|-----|----------|--------------|
|
||||
| Panneau PV | 10 | 5 kWc | Fort-de-France, Lamentin, Schoelcher |
|
||||
| Batterie | 10 | 100 kWh | Saint-Joseph, Marin, Vauclin, Sainte-Marie |
|
||||
| Borne VE | 10 | 22 kW | Diamant, Trois-Ilets, Salée, François, Robert |
|
||||
| Véhicule EV | 10 | 75 kWh (V2G) | Lorrain, Robert, Basse-Pointe, etc. |
|
||||
|
||||
| Type | ID | Nb | Capacité | Localisation |
|
||||
|------|-----|-----|----------|--------------|
|
||||
| Panneau PV | 1 | 10 | 5 kWc | Fort-de-France, Lamentin, Schoelcher |
|
||||
| Batterie | 2 | 10 | 100 kWh | Saint-Joseph, Marin, Vauclin, Sainte-Marie |
|
||||
| Borne VE | 3 | 10 | 22 kW | Diamant, Trois-Ilets, Salée, François, Robert |
|
||||
| Véhicule EV | 4 | 10 | 75 kWh (V2G) | Lorrain, Robert, Basse-Pointe, etc. |
|
||||
## Outils R&D installés
|
||||
|
||||
## Environnements
|
||||
|
||||
| Environnement | Usage | Packages clés |
|
||||
|--------------|-------|---------------|
|
||||
| `default` (venv) | Hermes, FlexMeasures Client | flexmeasures-client, requests |
|
||||
| `hamlet-rd` | HAMLET simulation LEM | pandapower, linopy, highspy |
|
||||
| `base` (conda) | OPLEM | numpy, pandas, scipy, mosek |
|
||||
| Outil | Environnement | Usage |
|
||||
|-------|--------------|-------|
|
||||
| HAMLET | conda `hamlet-rd` | Simulation agent-based LEM |
|
||||
| OPLEM | pip (venv) | Optimisation multi-période LEM |
|
||||
| OpenLEADR | pip (venv) | Passerelle OpenADR 2.0b |
|
||||
| FM Client | pip (venv) | API FlexMeasures |
|
||||
|
||||
## Standards
|
||||
|
||||
@@ -66,6 +71,8 @@ FlexMeasures = élément central. Volet R&D LEM (Local Energy Market).
|
||||
| IEC 62746-4 | Interfaces ressources côté demande |
|
||||
| S2 | CEM/RM pour flexibilité |
|
||||
| OpenADR 2.0b | Réponse à la demande automatisée |
|
||||
| EPEX SPOT | Marché électricité (Day-ahead, Intraday, Balancing) |
|
||||
| EEX GO | Garanties d'Origine (enchères, futures) |
|
||||
|
||||
## URLs
|
||||
|
||||
|
||||
46
config/telegraf-cariflex.conf
Normal file
46
config/telegraf-cariflex.conf
Normal file
@@ -0,0 +1,46 @@
|
||||
# Cariflex - Instance Telegraf dédiée
|
||||
# Flux: MQTT → FlexMeasures API (post des mesures de capteurs)
|
||||
|
||||
[global_tags]
|
||||
project = "cariflex"
|
||||
source = "telegraf-cariflex"
|
||||
|
||||
[agent]
|
||||
interval = "10s"
|
||||
round_interval = true
|
||||
metric_batch_size = 100
|
||||
metric_buffer_limit = 1000
|
||||
collection_jitter = "0s"
|
||||
flush_interval = "10s"
|
||||
flush_jitter = "0s"
|
||||
|
||||
# Input: MQTT Consumer - simulateur Cariflex
|
||||
[[inputs.mqtt_consumer]]
|
||||
servers = ["tcp://smart-city-mosquitto-1:1883"]
|
||||
topics = [
|
||||
"cariflex/#",
|
||||
"city/sensors/#"
|
||||
]
|
||||
data_format = "json"
|
||||
qos = 0
|
||||
data_type = "float"
|
||||
json_name_key = "sensor_id"
|
||||
json_time_key = "timestamp"
|
||||
json_time_format = "unix"
|
||||
|
||||
# Output: FlexMeasures API (HTTP)
|
||||
[[outputs.http]]
|
||||
url = "https://flexmeasures.digitribe.fr/api/v3_0/sensors/data"
|
||||
method = "POST"
|
||||
timeout = "5s"
|
||||
content_type = "application/json"
|
||||
headers = {"Authorization": "Bearer YOUR_FM_TOKEN"}
|
||||
data_format = "json"
|
||||
json_timestamp_units = "1s"
|
||||
|
||||
# Output: InfluxDB v2 (backup)
|
||||
[[outputs.influxdb_v2]]
|
||||
urls = ["http://smart-city-influxdb:8086"]
|
||||
token = "my-super-token"
|
||||
organization = "digitribe"
|
||||
bucket = "cariflex"
|
||||
80
docs/energy_markets.md
Normal file
80
docs/energy_markets.md
Normal file
@@ -0,0 +1,80 @@
|
||||
# Cariflex — Marchés de l'Énergie et Certificats
|
||||
|
||||
> Référence des marchés et certificats pour le projet Cariflex
|
||||
|
||||
## 1. EPEX SPOT — Marché de l'électricité
|
||||
|
||||
### Produits
|
||||
| Marché | Horizon | Produit | Rôle Cariflex |
|
||||
|--------|---------|---------|---------------|
|
||||
| **Day-ahead** | J-1 | Énergie par heure (MWh) | Optimisation schedule |
|
||||
| **Intraday** | H-1 à H-24 | Énergie 15min (MWh) | Ajustement temps réel |
|
||||
| **Balancing** | Temps réel | Capacité (MW) | Réponse à la demande |
|
||||
|
||||
Source : https://www.epexspot.com/en/marketdataservices
|
||||
|
||||
## 2. EEX — Garanties d'Origine (GO)
|
||||
|
||||
### Définition
|
||||
Les **Garanties d'Origine (GO)** sont des certificats électroniques attestant que 1 MWh d'électricité a été produit à partir de sources renouvelables.
|
||||
|
||||
### Marché EEX
|
||||
- **French Power GOs** : enchères françaises de Garanties d'Origine
|
||||
- **GO Futures** : contrats à terme sur Garanties d'Origine
|
||||
- **Registry Services** : registre européen des GO
|
||||
|
||||
Source : https://www.eex.com/en/markets/energy-certificates/french-power-gos
|
||||
|
||||
### Application Cariflex
|
||||
- Chaque MWh produit par les actifs PV Cariflex génère 1 GO
|
||||
- Les GO peuvent être vendus séparément de l'électricité
|
||||
- Revenus supplémentaires pour les producteurs ENR
|
||||
|
||||
## 3. PPA (Power Purchase Agreement)
|
||||
|
||||
### Types
|
||||
| Type | Description |
|
||||
|------|-------------|
|
||||
| **On-site** | Production sur site du consommateur |
|
||||
| **Off-site** | Production agrégée, injection réseau |
|
||||
| **Sleeved** | Intermédiaire qui "glisse" l'électricité |
|
||||
| **Virtual/Synthétique** | Couverture financière du risque prix |
|
||||
| **Corporate** | Contrat direct grand consommateur |
|
||||
|
||||
### Avantages
|
||||
- **Producteur** : revenus stables, financement facilité
|
||||
- **Consommateur** : prix fixe, traçabilité, image RSE
|
||||
|
||||
## 4. Marché de capacité
|
||||
|
||||
### Services système (DSO)
|
||||
| Service | Description | Rémunération |
|
||||
|---------|-------------|--------------|
|
||||
| **FCR** | Réserve primaire (fréquence) | €/MW/h |
|
||||
| **aFRR** | Réserve secondaire (auto-réparation) | €/MW/h |
|
||||
| **mFRR** | Réserve tertiaire (manuelle) | €/MW/h |
|
||||
| **Demand Response** | Effacement de consommation | €/MWh |
|
||||
|
||||
### Application Cariflex
|
||||
Cariflex agrège la flexibilité de ses 40 actifs pour :
|
||||
- Répondre aux demandes de flexibilité du DSO (ENEDIS/RTE)
|
||||
- Vendre des services système sur les marchés de capacité
|
||||
- Optimiser les revenus via FlexMeasures
|
||||
|
||||
## 5. Références
|
||||
|
||||
### Marchés
|
||||
- EPEX SPOT : https://www.epexspot.com/en/marketdataservices
|
||||
- EEX Energy Certificates : https://www.eex.com/en/markets/energy-certificates/french-power-gos
|
||||
|
||||
### Standards
|
||||
- Flex Ready® : https://gimelec.fr/en/flex-ready-enabling-interoperability-for-building-energy-flexibility/
|
||||
- S2 : https://s2standard.org
|
||||
- OpenADR : https://www.openadr.org
|
||||
|
||||
### Articles
|
||||
- HAL : https://hal.science/hal-05506759
|
||||
- TotalEnergies PPA : https://totalenergies.com/fr/actualites/quest-ce-quun-power-purchase-agreement-ppa
|
||||
- Next Kraftwerke PPA : https://www.next-kraftwerke.be/fr/plateforme-de-connaissances/power-purchase-agreement
|
||||
- ENGIE Green PPA : https://www.engie-green.fr/enr/power-purchase-agreement/
|
||||
- CMS Law Financial PPA : https://cms.law/fr/fra/news-information/le-financial-power-purchase-agreement
|
||||
BIN
docs/ev4eu_ppc.pdf
Normal file
BIN
docs/ev4eu_ppc.pdf
Normal file
Binary file not shown.
101
docs/go_certificates.md
Normal file
101
docs/go_certificates.md
Normal file
@@ -0,0 +1,101 @@
|
||||
# Cariflex — Garanties d'Origine (GO) et Certificats Énergétiques
|
||||
|
||||
> Référence des marchés de certificats pour le projet Cariflex
|
||||
|
||||
## 1. Garanties d'Origine (GO) — Définition
|
||||
|
||||
Les **Garanties d'Origine (GO)** sont des certificats électroniques attestant qu'1 MWh d'électricité a été produit à partir de sources renouvelables. Elles sont :
|
||||
- **Négociables** : achetées/vendues séparément de l'électricité physique
|
||||
- **Traçables** : chaque GO a un identifiant unique
|
||||
- **Annulables** : invalidées une fois utilisées (pas de double comptage)
|
||||
|
||||
## 2. Marchés EEX
|
||||
|
||||
### French Auctions Power (ENCHÈRES FRANÇAISES)
|
||||
- **Produit** : Garanties d'Origine françaises
|
||||
- **Fréquence** : enchères régulières
|
||||
- **Plateforme** : EEX (European Energy Exchange)
|
||||
- **URL** : https://www.eex.com/en/markets/energy-certificates/french-auctions-power
|
||||
|
||||
### GO Futures (CONTERMES FUTURES)
|
||||
- **Produit** : Contrats à terme sur Garanties d'Origine
|
||||
- **Usage** : couverture du risque de prix des GO
|
||||
- **URL** : https://www.eex.com/en/markets/energy-certificates/go-futures
|
||||
|
||||
### G-REX Platform
|
||||
- **Plateforme** : European GO Exchange
|
||||
- **Fonction** : registre européen des Garanties d'Origine
|
||||
- **URL** : https://www.eex.com/en/markets/energy-certificates/g-rex-platform
|
||||
|
||||
### Registry Services
|
||||
- **European Registry** : registre paneuropéen
|
||||
- **French Registry** : registre national français
|
||||
- **Fonction** : émission, transfert, annulation des GO
|
||||
|
||||
## 3. Marché EPEX SPOT — GO
|
||||
|
||||
### GO Spot Market
|
||||
- **Produit** : Garanties d'Origine au comptant
|
||||
- **Marché** : EPEX SPOT (European Power Exchange)
|
||||
- **URL** : https://www.epexspot.com/en/tradingproducts#guarantees-of-origin-spot-market
|
||||
- **URL GOs dédiée** : https://www.epexspot.com/en/guarantees-of-origin-gos
|
||||
|
||||
### EPEX GO Auction
|
||||
- **Fréquence** : enchères régulières
|
||||
- **Produit** : GO françaises et européennes
|
||||
|
||||
## 4. Autres Certificats Énergétiques
|
||||
|
||||
### RECS certificates
|
||||
- **RECS** : Renewable Energy Certificate System
|
||||
- **Usage** : certificat volontaire d'énergie renouvelable
|
||||
|
||||
### EU ETS (Système d'Échange de Quotas d'Émission)
|
||||
- **EU ETS** : marché du carbone européen
|
||||
- **EU ETS2** : extension aux bâtiments et transport
|
||||
- **Produits** : quotas CO2, futures, options
|
||||
|
||||
### nEHS (German Nationales Treibhausgas-minderungsziel)
|
||||
- **Marché** : quotas d'émission allemands
|
||||
|
||||
## 5. Application Cariflex
|
||||
|
||||
### Revenus GO
|
||||
Chaque MWh produit par les actifs PV Cariflex génère 1 GO :
|
||||
- **10 PV × 5 kWc × ~1 500 h/an = ~75 MWh/an = ~75 GO/an**
|
||||
- **Prix GO** : ~2-5 €/GO (variable selon marché)
|
||||
- **Revenus potentiels** : ~150-375 €/an
|
||||
|
||||
### Trading GO
|
||||
1. **Emission** : les GO sont émises lors de la production
|
||||
2. **Vente** : sur EEX (enchères) ou EPEX SPOT (spot)
|
||||
3. **Revenus** : versés aux producteurs participants
|
||||
|
||||
### Schéma
|
||||
```
|
||||
Production PV (75 MWh/an)
|
||||
│
|
||||
├── Électricité vendue (PPA ou marché spot)
|
||||
│
|
||||
└── Garanties d'Origine (75 GO/an)
|
||||
│
|
||||
├── EEX French Auctions (enchères)
|
||||
├── EPEX GO Spot (comptant)
|
||||
└── GO Futures (couverture risque)
|
||||
```
|
||||
|
||||
## 6. Références
|
||||
|
||||
### Marchés
|
||||
- EEX French Auctions : https://www.eex.com/en/markets/energy-certificates/french-auctions-power
|
||||
- EEX GO Futures : https://www.eex.com/en/markets/energy-certificates/go-futures
|
||||
- EEX G-REX : https://www.eex.com/en/markets/energy-certificates/g-rex-platform
|
||||
- EPEX GO Spot : https://www.epexspot.com/en/guarantees-of-origin-gos
|
||||
- EPEX Trading Products : https://www.epexspot.com/en/tradingproducts#guarantees-of-origin-spot-market
|
||||
- EEX Technical : https://www.eex.com/en/trading-resources/technical-information/frontends
|
||||
- EEX Certificates Overview : https://www.eex.com/en/markets/energy-certificates
|
||||
|
||||
### Réglementation
|
||||
- **Directive RED II** : renewable energy directive européenne
|
||||
- **Code de l'énergie** : articles L314-1 et suivants (France)
|
||||
- **CRE** : Commission de Régulation de l'Énergie
|
||||
BIN
docs/hal_article.pdf
Normal file
BIN
docs/hal_article.pdf
Normal file
Binary file not shown.
87
docs/ppa.md
Normal file
87
docs/ppa.md
Normal file
@@ -0,0 +1,87 @@
|
||||
# Cariflex — Power Purchase Agreement (PPA)
|
||||
|
||||
> Volet commercial du projet Cariflex — Modèles de contrats d'achat d'électricité verte
|
||||
|
||||
## 1. Définition
|
||||
|
||||
Un **Power Purchase Agreement (PPA)** ou **contrat d'achat d'électricité** est un accord bilatéral de gré à gré entre :
|
||||
- Un **producteur** d'électricité (verte/ENR)
|
||||
- Un **acheteur** de cette électricité (consommateur, industriel, négociant)
|
||||
|
||||
Le PPA définit : quantité, prix, durée, risques, comptabilité, pénalités.
|
||||
|
||||
## 2. Types de PPA
|
||||
|
||||
### PPA Physique
|
||||
| Type | Description |
|
||||
|------|-------------|
|
||||
| **On-site** | Électricité fournie directement sur le site du consommateur |
|
||||
| **Off-site** | Électricité injectée dans le réseau, consommateur achète ailleurs |
|
||||
| **Sleeved** | Intermédiaire (supplier) qui "glisse" l'électricité du producteur au consommateur |
|
||||
|
||||
### PPA Virtuel / Synthétique (VPPA / Synthetic PPA)
|
||||
- Pas de livraison physique d'électricité
|
||||
- Différence entre prix du marché et prix contractuel est réglée financièrement
|
||||
- Permet de couvrir le risque de prix sans contrainte géographique
|
||||
- Aussi appelé **Financial PPA**
|
||||
|
||||
### Corporate PPA
|
||||
- Signé directement entre un producteur ENR et un grand consommateur (Google, Apple, etc.)
|
||||
- Durée typique : 10-15 ans
|
||||
- Exemple : Google ↔ Engie pour l'éolien offshore en Belgique
|
||||
|
||||
## 3. Avantages
|
||||
|
||||
### Pour le Producteur ENR
|
||||
- **Revenus stables** : prix fixe sur le long terme (10-15 ans)
|
||||
- **Financement facilité** : les banques financent plus facilement des projets avec PPA
|
||||
- **Indépendance** : permet de continuer l'exploitation après la fin des subventions
|
||||
|
||||
### Pour le Consommateur
|
||||
- **Prix fixe** : protection contre les fluctuations du marché
|
||||
- **Traçabilité** : Garanties d'Origine certifiant la source renouvelable
|
||||
- **Image RSE** : réduction de l'empreinte carbone, engagement climatique
|
||||
- **Budget énergétique maîtrisé** : visibilité à long terme
|
||||
|
||||
## 4. Application Cariflex
|
||||
|
||||
### Modèle Cariflex
|
||||
Cariflex peut agir comme **intermédiaire PPA** :
|
||||
1. Agrège la production de plusieurs petits producteurs ENR (PV, éolien)
|
||||
2. Négocie des PPA avec des consommateurs (industriels, tertiaire, collectivités)
|
||||
3. Garantit la traçabilité via les Garanties d'Origine
|
||||
4. Optimise le dispatch via FlexMeasures
|
||||
|
||||
### Schéma
|
||||
```
|
||||
Producteurs ENR (PV, éolien)
|
||||
│
|
||||
│ PPA (achat de la production)
|
||||
▼
|
||||
Cariflex (Agrégateur)
|
||||
│
|
||||
│ PPA (vente aux consommateurs)
|
||||
▼
|
||||
Consommateurs (industriels, collectivités, tertiaire)
|
||||
```
|
||||
|
||||
### Produits PPA Cariflex
|
||||
| Produit | Description | Durée |
|
||||
|---------|-------------|-------|
|
||||
| **PPA On-site** | Production PV sur site du consommateur | 10-15 ans |
|
||||
| **PPA Off-site** | Production agrégée, injection réseau | 10-15 ans |
|
||||
| **PPA Virtuel** | Couverture financière du risque prix | 5-10 ans |
|
||||
| **PPA Corporate** | Contrat direct grand consommateur | 10-20 ans |
|
||||
|
||||
## 5. Références
|
||||
|
||||
### Sources
|
||||
- **TotalEnergies** : "Qu'est-ce qu'un PPA ?" — https://totalenergies.com/fr/actualites/quest-ce-quun-power-purchase-agreement-ppa
|
||||
- **Next Kraftwerke** : "Power Purchase Agreement" — https://www.next-kraftwerke.be/fr/plateforme-de-connaissances/power-purchase-agreement
|
||||
- **ENGIE Green** : "Qu'est-ce que le Power Purchase Agreement ?" — https://www.engie-green.fr/enr/power-purchase-agreement/
|
||||
- **CMS Law** : "Le Financial Power Purchase Agreement" — https://cms.law/fr/fra/news-information/le-financial-power-purchase-agreement
|
||||
|
||||
### Standards liés
|
||||
- **Garanties d'Origine** : certificat attestant la source renouvelable de l'électricité
|
||||
- **EEX** : plateforme d'échange des Garanties d'Origine en Europe
|
||||
- **RE100** : engagement des entreprises à 100% d'électricité renouvelable
|
||||
132
docs/stack.md
Normal file
132
docs/stack.md
Normal file
@@ -0,0 +1,132 @@
|
||||
# Cariflex - Stack Technique
|
||||
|
||||
## Architecture des données
|
||||
|
||||
```
|
||||
Simulateur IoT → MQTT → FlexMeasures API → PostgreSQL
|
||||
↓
|
||||
Scheduling/Forecasting
|
||||
↓
|
||||
Grafana (visualisation)
|
||||
```
|
||||
|
||||
## Services
|
||||
|
||||
| Service | Rôle | URL |
|
||||
|---------|-----|-----|
|
||||
| FlexMeasures | Core RM (scheduling, forecasting, reporting) | https://flexmeasures.digitribe.fr |
|
||||
| PostgreSQL | Base de données (assets, sensors, schedules) | Interne |
|
||||
| Redis | File d'attente (jobs RQ) | Interne |
|
||||
| Grafana | Visualisation | https://grafana.digitribr.fr |
|
||||
|
||||
## Flux de données
|
||||
|
||||
1. **Simulateur** publie des données MQTT sur des topics cariflex/#
|
||||
2. **FlexMeasures** expose une API REST pour recevoir les données des capteurs
|
||||
3. **FlexMeasures** stocke les données dans PostgreSQL
|
||||
4. **FlexMeasures** génère des forecasts et schedules
|
||||
5. **Grafana** visualise les données via l'API FlexMeasures
|
||||
|
||||
## API FlexMeasures
|
||||
|
||||
### Authentification
|
||||
```bash
|
||||
POST /api/v3_0/requestAuthToken
|
||||
{
|
||||
"email": "admin@digitribe.fr",
|
||||
"password": "Digitribe972"
|
||||
}
|
||||
```
|
||||
|
||||
### Poster des données de capteur
|
||||
```bash
|
||||
POST /api/v3_0/sensors/data
|
||||
Authorization: Bearer <token>
|
||||
{
|
||||
"sensor": <sensor_id>,
|
||||
"values": [<value1>, <value2>, ...],
|
||||
"unit": "kW",
|
||||
"horizon": "PT0H"
|
||||
}
|
||||
```
|
||||
|
||||
### Créer un capteur
|
||||
```bash
|
||||
POST /api/v3_0/sensors
|
||||
Authorization: Bearer <token>
|
||||
{
|
||||
"name": "pv_01_power",
|
||||
"unit": "kW",
|
||||
"generic_asset_id": 1,
|
||||
"timezone": "America/Martinique",
|
||||
"event_resolution": "PT5M"
|
||||
}
|
||||
```
|
||||
|
||||
### Déclencher un schedule
|
||||
```bash
|
||||
POST /api/v3_0/assets/<asset_id>/schedules/trigger
|
||||
Authorization: Bearer <token>
|
||||
{
|
||||
"start": "2024-01-01T00:00:00+04:00",
|
||||
"duration": "P1D",
|
||||
"flex_model": {...},
|
||||
"flex_context": {...}
|
||||
}
|
||||
```
|
||||
|
||||
## Configuration FlexMeasures Cariflex
|
||||
|
||||
### Variables d'environnement
|
||||
```
|
||||
FLEXMEASURES_REDIS_URL=redis://:Digitribe972@flexmeasures-redis:6379/0
|
||||
FLEXMEASURES_DB_URL=postgresql://flexmeasures:Digitribe972@flexmeasures-db:5432/flexmeasures
|
||||
FLEXMEASURES_TIMEZONE=America/Martinique
|
||||
MAPBOX_ACCESS_TOKEN=
|
||||
```
|
||||
|
||||
### Types d'actifs et flex_context
|
||||
|
||||
#### PV (production)
|
||||
```json
|
||||
{
|
||||
"consumption-capacity": "0kW",
|
||||
"production-capacity": "5kW",
|
||||
"soc-min": "0kWh",
|
||||
"soc-max": "0kWh"
|
||||
}
|
||||
```
|
||||
|
||||
#### Batterie (stockage)
|
||||
```json
|
||||
{
|
||||
"consumption-capacity": "50kW",
|
||||
"production-capacity": "50kW",
|
||||
"soc-min": "10kWh",
|
||||
"soc-max": "100kWh",
|
||||
"charging-efficiency": "95%",
|
||||
"discharging-efficiency": "95%"
|
||||
}
|
||||
```
|
||||
|
||||
#### EV Borne (consommation flexible)
|
||||
```json
|
||||
{
|
||||
"consumption-capacity": "22kW",
|
||||
"production-capacity": "0kW",
|
||||
"soc-min": "0kWh",
|
||||
"soc-max": "0kWh"
|
||||
}
|
||||
```
|
||||
|
||||
#### EV (V2G)
|
||||
```json
|
||||
{
|
||||
"consumption-capacity": "11kW",
|
||||
"production-capacity": "11kW",
|
||||
"soc-min": "15kWh",
|
||||
"soc-max": "75kWh",
|
||||
"charging-efficiency": "95%",
|
||||
"discharging-efficiency": "95%"
|
||||
}
|
||||
```
|
||||
77
scripts/influxdb_to_fm.py
Normal file
77
scripts/influxdb_to_fm.py
Normal file
@@ -0,0 +1,77 @@
|
||||
#!/usr/bin/env python3
|
||||
"""
|
||||
Cariflex - Post InfluxDB sensor data to FlexMeasures API.
|
||||
Reads from InfluxDB and posts to FlexMeasures via REST API.
|
||||
"""
|
||||
import requests
|
||||
import json
|
||||
from datetime import datetime, timedelta
|
||||
|
||||
# Config
|
||||
FM_HOST = "https://flexmeasures.digitribe.fr"
|
||||
FM_EMAIL = "admin@digitribe.fr"
|
||||
FM_PASSWORD = "Digitribe972"
|
||||
|
||||
INFLUXDB_HOST = "http://localhost:8086"
|
||||
INFLUXDB_TOKEN = "my-super-token"
|
||||
INFLUXDB_ORG = "digitribe"
|
||||
INFLUXDB_BUCKET = "smartcity"
|
||||
|
||||
def get_fm_token():
|
||||
"""Get FlexMeasures auth token."""
|
||||
r = requests.post(f"{FM_HOST}/api/v3_0/requestAuthToken",
|
||||
json={"email": FM_EMAIL, "password": FM_PASSWORD}, verify=False)
|
||||
if r.status_code == 200:
|
||||
return r.json().get("token")
|
||||
# Try alternative auth
|
||||
r = requests.post(f"{FM_HOST}/api/v3_0/login",
|
||||
json={"email": FM_EMAIL, "password": FM_PASSWORD}, verify=False)
|
||||
if r.status_code == 200:
|
||||
return r.json().get("token")
|
||||
print(f"Auth failed: {r.status_code} - {r.text[:200]}")
|
||||
return None
|
||||
|
||||
def get_influxdb_data(sensor_name, hours=1):
|
||||
"""Read sensor data from InfluxDB."""
|
||||
query = f'''
|
||||
from(bucket: "{INFLUXDB_BUCKET}")
|
||||
|> range(start: -{hours}h)
|
||||
|> filter(fn: (r) => r["_measurement"] == "mqtt_consumer")
|
||||
|> filter(fn: (r) => r["topic"] =~ /{sensor_name}/)
|
||||
|> limit(n: 10)
|
||||
'''
|
||||
r = requests.post(f"{INFLUXDB_HOST}/api/v2/query?org={INFLUXDB_ORG}",
|
||||
headers={"Authorization": f"Token {INFLUXDB_TOKEN}", "Content-Type": "application/vnd.flux"},
|
||||
data=query, verify=False)
|
||||
return r.text
|
||||
|
||||
def post_sensor_data(token, sensor_id, values, unit="kW"):
|
||||
"""Post sensor data to FlexMeasures."""
|
||||
headers = {"Authorization": f"Bearer {token}", "Content-Type": "application/json"}
|
||||
|
||||
# Format data for FlexMeasures
|
||||
data = {
|
||||
"sensor": sensor_id,
|
||||
"values": values,
|
||||
"unit": unit,
|
||||
"horizon": "PT0H"
|
||||
}
|
||||
|
||||
r = requests.post(f"{FM_HOST}/api/v3_0/sensors/data",
|
||||
headers=headers, json=data, verify=False)
|
||||
return r.status_code, r.text
|
||||
|
||||
if __name__ == "__main__":
|
||||
print("Cariflex - InfluxDB → FlexMeasures bridge")
|
||||
print("=" * 50)
|
||||
|
||||
# Test auth
|
||||
token = get_fm_token()
|
||||
if token:
|
||||
print(f"✅ Auth OK: {token[:20]}...")
|
||||
else:
|
||||
print("❌ Auth failed")
|
||||
|
||||
# Test InfluxDB read
|
||||
data = get_influxdb_data("pv_41")
|
||||
print(f"\n📊 InfluxDB data sample:\n{data[:500]}")
|
||||
100
skills/openocpp/SKILL.md
Normal file
100
skills/openocpp/SKILL.md
Normal file
@@ -0,0 +1,100 @@
|
||||
# Skill OpenOCPP - Cariflex
|
||||
|
||||
## Description
|
||||
Installation et configuration d'OpenOCPP (firmware OCPP 1.6J/2.0.1) pour les bornes de recharge EV de Cariflex.
|
||||
|
||||
## Prérequis
|
||||
- Bornes de recharge EV compatibles OCPP
|
||||
- CitrineOS (CSMS) déployé
|
||||
- FlexMeasures (RM) configuré
|
||||
|
||||
## Installation
|
||||
|
||||
### 1. Cloner OpenOCPP
|
||||
```bash
|
||||
git clone https://github.com/ChargeLab/OpenOCPP.git /home/eric/cariflex/tools/openocpp
|
||||
cd /home/eric/cariflex/tools/openocpp
|
||||
```
|
||||
|
||||
### 2. Compiler le firmware
|
||||
```bash
|
||||
# Prérequis: CMake, C++ compiler
|
||||
mkdir build && cd build
|
||||
cmake ..
|
||||
make -j4
|
||||
```
|
||||
|
||||
### 3. Déployer sur les bornes
|
||||
```bash
|
||||
# Configurer le point d'accès CSMS (CitrineOS)
|
||||
# Dans la configuration de la borne:
|
||||
# - CSMS URL: wss://flexmeasures.digitswarm.fr
|
||||
# - OCPP version: 2.0.1
|
||||
# - Security: TLS + certificat client
|
||||
```
|
||||
|
||||
## Configuration OCPP
|
||||
|
||||
### Paramètres OCPP 2.0.1
|
||||
```json
|
||||
{
|
||||
"core_profile": true,
|
||||
"smart_charging_profile": true,
|
||||
"remote_trigger_profile": true,
|
||||
"security_profile": 2,
|
||||
"heartbeat_interval": 60,
|
||||
"connection_timeout": 30,
|
||||
"max_message_size": 65536
|
||||
}
|
||||
```
|
||||
|
||||
### Messages OCPP supportés
|
||||
| Message | Direction | Usage |
|
||||
|---------|-----------|-------|
|
||||
| BootNotification | CSMS → Borne | Démarrage |
|
||||
| Heartbeat | Bidirectionnel | Keep-alive |
|
||||
| MeterValues | CSMS → Borne | Mesures |
|
||||
| TransactionEvent | CSMS → Borne | Début/fin transaction |
|
||||
| RemoteStartTransaction | Borne → CSMS | Démarrage à distance |
|
||||
| RemoteStopTransaction | Borne → CSMS | Arrêt à distance |
|
||||
| SetChargingProfile | Borne → CSMS | Programme de charge |
|
||||
| TriggerMessage | Bidirectionnel | Déclenchement |
|
||||
| ChangeConfiguration | Borne → CSMS | Configuration |
|
||||
| GetConfiguration | Borne → CSMS | Lecture config |
|
||||
| Reset | Borne → CSMS | Redémarrage |
|
||||
| ClearChargingProfile | Borne → CSMS | Effacer profil |
|
||||
| GetCompositeSchedule | Borne → CSMS | Lire schedule |
|
||||
| NotifyReport | CSMS → Borne | Rapport |
|
||||
| NotifyEvent | CSMS → Borne | Événement |
|
||||
| LogStatusNotification | CSMS → Borne | Statut log |
|
||||
| SignedFirmwareStatusNotification | CSMS → Borne | Statut firmware |
|
||||
|
||||
### Smart Charging (ISO 15118)
|
||||
- Charging profiles : TxProfile, TxDefaultProfile
|
||||
- Schedule periods : puissance max, durée
|
||||
- Tarification : coût par kWh, coût fixe
|
||||
- Recharge intelligente : V2G, PV couverture
|
||||
|
||||
## Intégration FlexMeasures
|
||||
|
||||
### Flux de données
|
||||
```
|
||||
Borne EV → OCPP → CitrineOS → FlexMeasures API → PostgreSQL
|
||||
↓
|
||||
Scheduling/Optimisation
|
||||
↓
|
||||
Grafana (viz)
|
||||
```
|
||||
|
||||
### Configuration FlexMeasures pour bornes
|
||||
1. Créer un device/asset par Borne VE
|
||||
2. Créer un sensor de puissance (kW) par asset
|
||||
3. Configurer le flex_context pour la flexibilité
|
||||
4. Configurer les charging profiles OCPP
|
||||
|
||||
## Liens utiles
|
||||
- GitHub: https://github.com/ChargeLab/OpenOCPP
|
||||
- Documentation OCPP: https://www.openchargealliance.org/
|
||||
- OCA Certification: https://www.openchargealliance.org/
|
||||
- Guide OCPP complet: https://www.ampeco.com/guides/complete-ocpp-guide/
|
||||
- Open Charge Point Protocol: https://openocpp.com/
|
||||
Reference in New Issue
Block a user