Skip to main content

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'

Metadata

Release files for pyNetatmoHue 0.1.3

For a detailed explanation of source distributions (sdists) and built distributions (wheels), please see the package formats documentation.

Source distribution (sdist)

Source distribution for pyNetatmoHue 0.1.3
File Size Uploaded
pyNetatmoHue-0.1.3.tar.gz 17.1 kB Details

Built distribution (wheel)

Table of built distributions (wheels) for pyNetatmoHue 0.1.3
File Interpreter ABI Platform
pyNetatmoHue-0.1.3-py3-none-any.whl Python 3 none any Details

Total release size: 34.2 kB

Release files / pyNetatmoHue-0.1.3.tar.gz

Download URL pyNetatmoHue-0.1.3.tar.gz
Size 17.1 kB
Tags Source
SHA-256 checksum
How to use checksums
acda322ea5e58a12a5da37a1e3ab8ed738236ae1b5dfd1fae6533dca77969bb3
BLAKE2b-256 checksum
How to use checksums
2782a6011e8ecea7d24ebaa78fd563e1d11f3ca8a64f33afced680a12089da36
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
No
Uploaded via twine/4.0.0 CPython/3.9.12

Release files / pyNetatmoHue-0.1.3-py3-none-any.whl

Download URL pyNetatmoHue-0.1.3-py3-none-any.whl
Size 17.1 kB
Tags Python 3
SHA-256 checksum
How to use checksums
3abe99149473e390dd15ab42696a53ba3767c82c9ab02c881dbe1e3dd35ecef9
BLAKE2b-256 checksum
How to use checksums
adb61dce36141c04b04634ab359859d5792e49559438281741e43856b2a091eb
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
No
Uploaded via twine/4.0.0 CPython/3.9.12

Release history Release notifications | RSS feed

This release

0.1.3 This release

2 release files

0.1.2

2 release files

0.1.1

2 release files

0.1.0

2 release files

0.0.6

2 release files

0.0.5

2 release files

0.0.4

2 release files

0.0.3

2 release files

0.0.2

2 release files

Anthropic, PBC Visionary sponsor Bloomberg Visionary sponsor Hudson River Trading Visionary sponsor Meta Visionary sponsor NVIDIA Visionary sponsor Microsoft Sustainability sponsor Depot Continuous Integration AWS Cloud computing and Security Sponsor Datadog Monitoring Fastly CDN Google Download Analytics Sentry Error logging StatusPage Status page