170 lines
3.5 KiB
Markdown
170 lines
3.5 KiB
Markdown
# Test de l'environnement de travail
|
|
|
|
```shell
|
|
python -m scripts.test_influx_connection
|
|
```
|
|
|
|
```output
|
|
Configuration InfluxDB chargée :
|
|
URL : http://10.0.3.2:8086
|
|
Org : Dern
|
|
Bucket : weather
|
|
|
|
→ Ping du serveur InfluxDB…
|
|
✔ Ping OK
|
|
→ Requête de test sur le bucket…
|
|
✔ Requête de test réussie : 18 table(s), 58 enregistrement(s) trouvés.
|
|
Exemple de point :
|
|
time : 2025-11-16 22:30:50.263360+00:00
|
|
measurement : %
|
|
field : device_class_str
|
|
value : humidity
|
|
```
|
|
|
|
Ensuite, on peut demander à InfluxDB de nous détailler ce qu'il stocke :
|
|
|
|
```shell
|
|
python -m scripts.test_influx_schema
|
|
```
|
|
|
|
```output
|
|
Bucket InfluxDB : weather
|
|
|
|
Measurements disponibles :
|
|
- %
|
|
- hPa
|
|
- km/h
|
|
- lx
|
|
- mm/h
|
|
- °
|
|
- °C
|
|
|
|
Champs pour measurement « % » :
|
|
- device_class_str (type: unknown)
|
|
- friendly_name_str (type: unknown)
|
|
- state_class_str (type: unknown)
|
|
- value (type: unknown)
|
|
|
|
Champs pour measurement « hPa » :
|
|
- device_class_str (type: unknown)
|
|
- friendly_name_str (type: unknown)
|
|
- state_class_str (type: unknown)
|
|
- value (type: unknown)
|
|
|
|
Champs pour measurement « km/h » :
|
|
- device_class_str (type: unknown)
|
|
- friendly_name_str (type: unknown)
|
|
- state_class_str (type: unknown)
|
|
- value (type: unknown)
|
|
|
|
Champs pour measurement « lx » :
|
|
- device_class_str (type: unknown)
|
|
- friendly_name_str (type: unknown)
|
|
- value (type: unknown)
|
|
|
|
Champs pour measurement « mm/h » :
|
|
- device_class_str (type: unknown)
|
|
- friendly_name_str (type: unknown)
|
|
- state_class_str (type: unknown)
|
|
- value (type: unknown)
|
|
|
|
Champs pour measurement « ° » :
|
|
- friendly_name_str (type: unknown)
|
|
- value (type: unknown)
|
|
|
|
Champs pour measurement « °C » :
|
|
- device_class_str (type: unknown)
|
|
- friendly_name_str (type: unknown)
|
|
- state_class_str (type: unknown)
|
|
- value (type: unknown)
|
|
```
|
|
|
|
Mais pour obtenir les données dont on a besoin, il faut aussi connaitre les entités manipulées par Influx :
|
|
|
|
```shell
|
|
python -m scripts.test_influx_entities
|
|
```
|
|
|
|
```output
|
|
Bucket InfluxDB : weather
|
|
|
|
Measurement « % »
|
|
Tag keys :
|
|
- _field
|
|
- _measurement
|
|
- _start
|
|
- _stop
|
|
- domain
|
|
- entity_id
|
|
entity_id possibles :
|
|
- station_meteo_bresser_exterieur_humidite_relative
|
|
|
|
Measurement « hPa »
|
|
Tag keys :
|
|
- _field
|
|
- _measurement
|
|
- _start
|
|
- _stop
|
|
- domain
|
|
- entity_id
|
|
entity_id possibles :
|
|
- station_meteo_bresser_exterieur_pression_atmospherique
|
|
|
|
Measurement « km/h »
|
|
Tag keys :
|
|
- _field
|
|
- _measurement
|
|
- _start
|
|
- _stop
|
|
- domain
|
|
- entity_id
|
|
entity_id possibles :
|
|
- station_meteo_bresser_exterieur_vitesse_du_vent
|
|
|
|
Measurement « lx »
|
|
Tag keys :
|
|
- _field
|
|
- _measurement
|
|
- _start
|
|
- _stop
|
|
- domain
|
|
- entity_id
|
|
entity_id possibles :
|
|
- station_meteo_bresser_exterieur_luminance
|
|
|
|
Measurement « mm/h »
|
|
Tag keys :
|
|
- _field
|
|
- _measurement
|
|
- _start
|
|
- _stop
|
|
- domain
|
|
- entity_id
|
|
entity_id possibles :
|
|
- station_meteo_bresser_exterieur_precipitations
|
|
|
|
Measurement « ° »
|
|
Tag keys :
|
|
- _field
|
|
- _measurement
|
|
- _start
|
|
- _stop
|
|
- domain
|
|
- entity_id
|
|
entity_id possibles :
|
|
- station_meteo_bresser_exterieur_direction_du_vent
|
|
|
|
Measurement « °C »
|
|
Tag keys :
|
|
- _field
|
|
- _measurement
|
|
- _start
|
|
- _stop
|
|
- domain
|
|
- entity_id
|
|
entity_id possibles :
|
|
- station_meteo_bresser_exterieur_temperature
|
|
```
|
|
|
|
Ces informations combinées se retrouvent dans le fichier `meteo/station_config.py`.
|