Git Product home page Git Product logo

pylight-fuse's Introduction

pylight-fuse

Fuse filesystem to control wireless lighting systems

This is a python 2 module used to provide access to wireless lighting systems through the linux filesystem using FUSE (File system in User Space). Each bulb/zone will be exposed as a file within the linux file system. Commands written to the files will be parsed and sent to the light.

Reads of the file will report:

  • The commands available
  • The last state (current) state of the bulb (milight bulbs do not store state).

The system is being developed using the Milight wifi bridge, but should be extendable to any lighting system.... Initial commands will be simply transmitted to the bulb, later we can add composite commands

Static vs Dynamic configuration? Parsed commands or control endpoints.

E.g.

|
|
|--Light 1 -> ON/Off/Bright commands
|
|--Light 2 -|
            |
            - control
            |
            |- Bright
            |
            |- Colour
            |
            |- Mode

Parsed commands:-

  • Single point of contact per bulb.
  • Interface becomes a message build/parse mechanism
  • Enforces single command at a time (assuming file access is limited)
  • Potential to build flows of commands with implicit ordering

Control Endpoints:

  • Controls supported by a light are explicitly exported no need to handle errors (although parameters do need parsing)
  • Still needs some form of parsing to at a minimum handle boolean params and variables

Proposed Controls

Write Usage
State Controls the on off state of the light.
Brightness Value 0 to 100 Controls the brightness of the bulb
Colour-RGB Colour of the bulb as RGB
Colour-HUE Colour of the bulb using a HUE value.
Colour-SAT Saturation of the bulb (if supported)
Mode Mode of the light (discomodes)
White White Mode of the light
Temperature Colour temperature of the light
Read Usage
State Last written or current on/off sate
Brightness Current brightness...

Configuration

For the MiLight case we have bridges and each bridge may have n zones where zone 0 is a special zone which Refers to all zones on that bridge for that light type.

Configuration can be done as

List of bridges

Bridge = Bridge Config (IP address etc) + list of bulb nodes

Bulb node = Zone name, Zone number, Zone types (for milight = RGB, RGBWW, White, Bridge)


Thoughts

Bridge should allow multiple names for the same zone. Zone status should be pushed back to all nodes that connect to that zone. Should be able to produce Graphviz representation of the attached lights.

                            |----- Zone 1, RGBW+-----> Hall Light
     Bridge_milight001------|                  |-----> Landing Light
                            |
                            |
                            |--------->Zone 2, RGBW ----> Bedroom Light
                            |
                            |---------->Zone 1, White----->Spare Room




Is actually more like



        Bridge -----------> RGBW 
                        |
                        |
                        |--> White ------> Zone 0--------------------|
                                    |                                |
                                    |                                |
                                    |----------------> Zone 1<-------|
                                    |                                |
                                    |                                |
                                    |----------------> Zone 2<-------+

![Alt text](https://g.gravizo.com/g? digraph G { aize ="4,4"; bridge1 -> rgbw1; rgbw1 -> zoner1; rgbw1 -> zoner2; bridge1 -> white; white -> zonew1; zonew1 -> spareroom; zoner1 -> bedroom; zoner2 -> hallway; zoner2 -> landing; } )

pylight-fuse's People

Contributors

buxtonpaul 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.