Package that colours your lights as the PPM in your room change.
Project description
pyNetatmoHue
This repository contains the module 'pyNetatmoHue.py' (Python code) that allows you to continuously automatically adjust the colours of your Hue lights according to the measured PPM levels by your Netatmo weather station.
This is usefull when you want to easily monitor the PPM level in your room so you known when you need to ventilate your room (additionally).
You can speficy a Netatmo Station and Module to measure the PPM level, a Hue light that will colour as the PPM level changes and a motion sensor (optional) that check if anybody is present in the room, if not, that light will not change colour.
Target Audience
This repository is intended for (Python) Developers who would like to use this code, or ideally, would like to contribute.
Installation
Install via PIP with:
sudo pip install pyNetatmoHue
Use in Python like this:
import pyNetatmoHue as pNH
NH2 = pNH.NetatmoHue(
_CLIENT_ID = "xx",
_CLIENT_SECRET = "xxx",
_USERNAME = "xx.xx@gmail.com",
_PASSWORD = "xx%xx*",
scope="read_station read_camera access_camera write_camera " \
"read_presence access_presence write_presence read_thermostat write_thermostat",
_BASE_URL = "https://api.netatmo.com/",
_IP = '192.168.2.7',
_SETTINGS = {
"portaal" : {"station": "_ (Keuken)", "module" : "Portaal", "light":[8], "sensor":16 },
"werkkamer" : {"station" : "_ (Pepijn)", "module" : "Werkkamer", "light":[6], "sensor":160 },
"keuken" : {"station" : "_ (Keuken)", "light":[3,4] }
}
)
NH2.start()
API Credentials
Netatmo API credentials can be created via https://dev.netatmo.com/apps/. Register an APP to get a ClientID and Client Secret.
Configuration
When you intitiate a class instance a number of parameter values are required. The following paramters are required to obtain the CO2 levels:
- _CLIENT_ID
- _CLIENT_SECRET
- _USERNAME
- _PASSWORD
- scope
- _BASE_URL
You also need to specify the IP adress of your HUE bridge. This is done using the parameter _IP. You can find you IP adres by using your HUE app and going to 'Settings' -> 'Hue Bridges' -> 'Information Icon'.
Settings
The settings parameter consists of a nested dictionary with the rooms that each have a station or optionally also a module to retrevieve the CO2 level. The light(s) that need to be coloured in that room are specified (in a list). Finally, optionally, you can specify a motion sensor that checks for presence in the room.
To obtain the light and sensor identifiers, I recommend the app 'all 4 hue'. In this app you can select a light or sensor and then choose 'show internal identifier'
Project details
Release history Release notifications | RSS feed
Download files
Download the file for your platform. If you're not sure which to choose, learn more about installing packages.
Source Distribution
Built Distribution
File details
Details for the file pyNetatmoHue-0.1.3.tar.gz
.
File metadata
- Download URL: pyNetatmoHue-0.1.3.tar.gz
- Upload date:
- Size: 17.1 kB
- Tags: Source
- Uploaded using Trusted Publishing? No
- Uploaded via: twine/4.0.0 CPython/3.9.12
File hashes
Algorithm | Hash digest | |
---|---|---|
SHA256 | acda322ea5e58a12a5da37a1e3ab8ed738236ae1b5dfd1fae6533dca77969bb3 |
|
MD5 | c2c012472fb0289d911aba3b265f2f19 |
|
BLAKE2b-256 | 2782a6011e8ecea7d24ebaa78fd563e1d11f3ca8a64f33afced680a12089da36 |
File details
Details for the file pyNetatmoHue-0.1.3-py3-none-any.whl
.
File metadata
- Download URL: pyNetatmoHue-0.1.3-py3-none-any.whl
- Upload date:
- Size: 17.1 kB
- Tags: Python 3
- Uploaded using Trusted Publishing? No
- Uploaded via: twine/4.0.0 CPython/3.9.12
File hashes
Algorithm | Hash digest | |
---|---|---|
SHA256 | 3abe99149473e390dd15ab42696a53ba3767c82c9ab02c881dbe1e3dd35ecef9 |
|
MD5 | 401d6eee2b5e4ae4516a6e361647ce18 |
|
BLAKE2b-256 | adb61dce36141c04b04634ab359859d5792e49559438281741e43856b2a091eb |