Code Monkey home page Code Monkey logo

huebg's Introduction

THIS PROJECT IS NO LONGER SUPPORTED

SEE HERE FOR MORE INFORMATION

HueBG: Visualize Glucose Readings with Philips Light Bulbs

A python program to control Philips Hue lightbulbs based on Continous Glucose Monitor (CGM) readings fetched from sugarmate.io

This is a fun project I created in order to more passively keep track of my blood glucose readings without having to pick up my phone or checking my insulin pump. It also looks pretty cool and has an optional rainbow mode for when your reading is perfectly on your set target.

Libraries Used:

Requests

phue

Supplies:

  • CGM linked to sugarmate
  • Philips Hue bridge and bulbs
  • A computer with python 3.7+

Usage:

First thing to do is to git clone https://github.com/ericmargadonna/HueBG in a repository of your choosing on a computer with python 3.7 or higher installed. You will also need to python3 -m pip install phue and python3 -m pip install requests if you haven't used either of these libraries before.

After this you must set your bridge's IP address and your sugarmate API code in config.py.

To find your bridge IP, use either your router's administration portal or by using the Philips Hue app.

NOTE: When running hueBG on a client for the first time, you will have to press the access button on your Philips Hue bridge

For sugarmate, set up an account if you don't have one already. Log into your account and on the settings page scroll to the bottom and enable the switch for "External JSON". The API key is in the link given as follows:

https://sugarmate.io/api/v1/ --- THIS IS YOUR API KEY --- /latest.json

Once you have set the API key and IP address in config.py you can mess around with the colors, timings and bulb settings to your heart's content. Then, run HueBG.py or hueBGdaemon.py (see below) and enjoy!

Daemon:

This can be run to have HueBG.py in the background, not attached to a terminal window. This is intended for raspberry pi's so that you can have, in my case, a headless Pi Zero W running this as a service. This allows you to close your ssh sesion without killing the app. This seems to work on all platforms but I've had some weird issues with the daemon library on MacOS. My raspberry pi runs the daemon perfectly on Raspberry Pi OS, and that was good enough for me.

huebg's People

Contributors

ericmargadonna avatar

Watchers

 avatar

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.