Skip to content

Commit

Permalink
initial derp
Browse files Browse the repository at this point in the history
  • Loading branch information
turbosnute committed May 14, 2020
0 parents commit 39448eb
Show file tree
Hide file tree
Showing 6 changed files with 768 additions and 0 deletions.
29 changes: 29 additions & 0 deletions Dockerfile
Original file line number Diff line number Diff line change
@@ -0,0 +1,29 @@
# Pull base image
FROM ubuntu:latest

# Labels
LABEL MAINTAINER="Øyvind Nilsen <[email protected]>"

# Setup external package-sources
RUN apt-get update && apt-get install -y \
python \
python-dev \
python-setuptools \
python-pip \
python-virtualenv \
--no-install-recommends && \
rm -rf /var/lib/apt/lists/*

# RUN pip install setuptools
RUN pip install pytz influxdb

# Environment vars
ENV PYTHONIOENCODING=utf-8

# Copy files
ADD lnetatmo.py /
ADD netatmo2influxdb.py /
ADD get.sh /

# Run
CMD ["/bin/bash","/get.sh"]
21 changes: 21 additions & 0 deletions LICENSE
Original file line number Diff line number Diff line change
@@ -0,0 +1,21 @@
MIT License

Copyright (c) 2020 Øyvind Nilsen

Permission is hereby granted, free of charge, to any person obtaining a copy
of this software and associated documentation files (the "Software"), to deal
in the Software without restriction, including without limitation the rights
to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
copies of the Software, and to permit persons to whom the Software is
furnished to do so, subject to the following conditions:

The above copyright notice and this permission notice shall be included in all
copies or substantial portions of the Software.

THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
SOFTWARE.
24 changes: 24 additions & 0 deletions README.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,24 @@
# netatmo-influxdb-rpi
Fetch data from the Netatmo API and place it in your influxdb. Made to run on Raspbian. Based on Manabuishii's [docker-netatmo-influxdb-python](https://github.com/manabuishii/docker-netatmo-influxdb-python) and [netatmo2influxdb.py](https://pypi.org/project/netatmo2influxdb/).

## How to run
```
docker run -d \
-e NETATMO_CLIENT_ID="" \
-e NETATMO_CLIENT_SECRET="" \
-e NETATMO_USERNAME="" \
-e NETATMO_PASSWORD="" \
-e INFLUXDB_HOST="" \
-e INFLUXDB_PORT="" \
-e INFLUXDB_USERNAME="" \
-e INFLUXDB_PASSWORD="" \
-e INFLUXDB_DATABASE="" \
--name "netatmo-influxdb" \
turbosnute/netatmo-influxdb-rpi:latest
```

## Debug
To get more debug data add:
```
-e DEBUG="true"
```
18 changes: 18 additions & 0 deletions get.sh
Original file line number Diff line number Diff line change
@@ -0,0 +1,18 @@
#!/bin/bash

while :
do
date
echo "--- Start Call API"
python netatmo2influxdb.py
RET=$?
if [ ${RET} -ne 0 ];
then
echo "Exit status not 0"
echo "Sleep 120"
sleep 120
fi
date
echo "Sleep 60"
sleep 60
done
Loading

0 comments on commit 39448eb

Please sign in to comment.