Open herver opened 6 years ago
I wrote a little tutorial on how to create all the containers that are needed using Docker Compose and the new Netatmo authentication:
Create a folder on your system for the Docker containers:
sudo mkdir /docker
sudo mkdir /docker/grafana
sudo mkdir /docker/prometheus
sudo mkdir /docker/netatmo-exporter
Create the file prometheus.yml so that Prometheus can retrieve your data:
sudo nano /docker/prometheus/prometheus.yml
Add the following content to the prometheus.yml file:
global:
scrape_interval: 5s
external_labels:
monitor: 'codelab-monitor'
scrape_configs:
Create the docker-compose.yml file:
sudo nano /docker/netatmo-exporter/docker-compose.yml
Add the following content to the docker-compose.yml file and don't forget to add your Netatmo client ID, client secret and server IP:
version: '3'
services: prometheus: image: prom/prometheus:latest volumes:
"9090:9090" networks: netatmo-network: ipv4_address: 172.20.20.3
grafana: image: grafana/grafana:latest volumes:
"3000:3000" networks: netatmo-network: ipv4_address: 172.20.20.4 bridge:
netatmo-exporter: image: ghcr.io/xperimental/netatmo-exporter:latest restart: unless-stopped environment:
"9210:9210" networks: netatmo-network: ipv4_address: 172.20.20.2 bridge:
watchtower: image: containrrr/watchtower volumes:
volumes: grafana_data: driver: local
networks: netatmo-network: driver: bridge ipam: config:
Open the Netatmo-exporter folder and execute the following command to start all containers:
sudo cd /docker/netatmo-exporter
sudo docker compose up -d
Open http://yourserverip:9210 and click on authorizing here and accept that your data may be retrieved:
docker restart netatmo-exporter-netatmo-exporter1
Now you have Netatmo Exporter, Prometheus and Grafana installed to display your Netatmo weather data. Also, with Watchtower all containers are automatically updated when there is a new version.
Grafana can be reached at http://yourserverip:3000.
To add the data to a Grafana dashboard you first need to add Prometheus as a data source. The ip for this is: 172.20.20.3
Could be useful for some people deploying this exporter with docker-compose (maybe in conjunction with prometheus and grafana)