Coder Social home page Coder Social logo

redshift-hue-scene's Introduction

redshift-hue-scene

Script to dim and adjust color temperature of Phillips Hue scenes based on sun elevation.

Based on deuxpi's redshift-hue and utilizing a fork of studioimaginaire's phue, the script reads a current hue configuration from a hub, and applies a color shifted and or dimmed scene configuration based on the altitude of the sun.

Status

  • This software is in active development.
  • USE AT YOUR OWN RISK!
  • Have used this script continuously in a 15 light 8 scene setup, no issues.
  • It has been tested on 2nd and 3rd gen white ambiance and color bulbs.
  • It has been NOT been tested on non-dimmible or white only bulbs, or a first gen hub.

Known Issues

  • Scenes activated by a motion sensor may flicker one time when activated. I presume this is caused by lights getting their initial state from memory instead of receiving it from the hub. Attempting to resolve with delays or ddx in 1.13.

Requirements & Dependancies

A Hue Bridge running version 1.11+ is required

Targeted for python 3.4, not tested in 2.7

Depends on pysolar==0.7 and custom phue (included)

Configuration

Location and hub address, as well as color temperatures and dimness is configured by global variables.

TEMP_DAY           = 3500
TEMP_NIGHT         = 2300
BRIGHTNESS         = 1.0
BRIGHTNESS_DAY     = 1.0
BRIGHTNESS_EVENING = 0.8
BRIGHTNESS_NIGHT   = 0.15
TRANSITION_TIME    = 100  # deciseconds
SLEEP_TIME         = 120  # seconds
LAT                =  40.7128  # North of the Equaitor is positive 
LON                = -74.0059  # East of Greenwich is positive 
BRIDGE_ADDRESS     = '192.168.1.102'

SHIFT_ALL_LIGHTS   = True
TWEAK_MOTION_DIM   = True

Scene Configuration

Configuration of scenes and bulb temperature is done with naming conventions using the scene or bulb names in the hub. This is most easily done with the app or your preferred method of configuration.

  • Scenes with "nightshift" or "dayshift" in the name (case-insensitive) will be updated by the script
  • "nightshift" applies BRIGHTNESS_NIGHT settings, "dayshift" applies the BRIGHTNESS_EVENING. They are intended as replacements for 'Nightlight' and 'Dimmed' scenes respectively, but with temperature shifting.
  • Scenes are actually room specific, so if you have 4 sensors in 4 rooms, you'll need 8 scenes.

This approach allows you to configure your lights in the way you do now, instead of logging into a raspberry pi and using vi on a config file when you want to add a light or adjust times.

Unimplemented features

  • Bulbs named "ct<+/-number>" i.e. ct+50 will be shifted on the mired scale (+/-) by given number
  • Add condition comparing previous iteration to reduce chattyness
  • default transistiontime delay.
  • debian service files

redshift-hue-scene's People

Contributors

ab10460ef3 avatar

Stargazers

 avatar  avatar  avatar  avatar  avatar  avatar

Watchers

 avatar

redshift-hue-scene's Issues

script not updating light colors after lights have been turned off/on.

It seems that once i turn off a room and then turn back on and reselect a "shift" scene using the app or switch, the script doesn't update the color anymore. simply running the script again will correct the issue. is this intended behavior?

on side note, when it is working its amazing. thanks so much for the work you've done so far.

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.