Uses the Pimoroni EnviroHAT to log specific values via Microsoft Graph API to an Online Excel Sheet document.
- Raspberry Pi Z (works also with 2 and 3)
- Pimoroni EnviroHAT
- Raspbian Linux
- Python 3.5 (installed on Rasbian)
- Office 365 Business or School account (May change)
- Attach the HAT to the Raspberry Pi
- (Optional) check with the HAT's examples if everything works
- Register new App in Azure Active Directory App Registration (MS Docs)
- Grant
Files.ReadWrite
permissions to the registered app - Upload attached
measurements.xslx
template to/Apps/<your_app_name>/measurements
of your OneDrive - Update the
config.py
with yourCLIENT_ID
andAPP_NAME
.
- Use a vnc or ssh connection to log into your Pi
cd <source folder>
pip3 install -r requirements.txt
python3 main.py
- You will be prompted to open a link and enter a code. This must not happen on the slow Pi, you can use your default computer
You need to use pip3
and python3
if the system's Python is bind to a 2.x
. Check this via the python --version
terminal command. It is recommended to run the script in a detachable shell session with screen
or something similar.
The sync timer will tick every 10 minutes.
Excel online with custom created diagrams.
Script run in a terminal.
Hit Ctrl+C
in the terminal that runs the staeted Python process.
Due to the placement of the sensors near the CPU of the Pi, the measurements are not accurate by far. But it could represent some trends.
- Personal Blog: [Raspberry Pi] Mit dem Enviro HAT das Raumklima in Excel visualisieren
- Dr. Windows: Wochenendprojekt: Mit dem Raspberry Pi das Raumklima in Excel visualisieren
Feel free to improve the quality of the code. It would be great to learn more from experienced Python, Microsoft Graph and IoT developers.
Just me, Tobi.
This project is licensed under the MIT License - see the LICENSE file for details. Dependencies or assets maybe licensed differently.