Git Product home page Git Product logo

wiled's Introduction

WiLED

WiLED is a project that aims to create a simple but highly effective control system for home (and commercial) lighting applications.

The main targets are initially stand-alone lamps, i.e. those that connect to a general purpose power outlet. Future goals also include embedded fixed lighting.

The target hardware is (Arduino-powered) ESP8266 modules for the end devices, and a Feather M0 coupled to a Raspberry Pi Zero W for the coordinator.

This repository provides the code for WiLED. See the WiLED-PCB repository for the circuit schematics.

Installation and usage

The code is written for Arduino-powered devices - at the moment, the ESP8266 and the Feather M0.

TODO

Roadmap

The overall goal for WiLED is to provide a flexible system for lighting control, powered by MQTT.

The current system plan is to use an RFM-69 radio to connect the lighting devices together, and then have a coordinator that interfaces the radio link to an MQTT broker.

Goals

  • Extensible and open system
    • MQTT interface for integration with other systems
    • Open source schematics and software
  • Ability to control multiple light outputs with a single switch or dial, through groups
  • Separation of lighting output device and control input device, to allow for flexible reconfiguration
    • Option to have hardwired controller so lighting is usable even with failure in radio network
  • Tested performance metrics for switching latency tm
  • Bindings for OpenHAB

Contributors and thanks

The Rotary library for Arduino, by Ben Buxton, has been used and the files Rotary.h and Rotary.cpp are included in this project. See here for the original source. It is GPLv3 licensed.

Additionally, the wonderful RadioHead library from Mike McCauley and AirSpayce has been used via an inclusion through PlatformIO. See here for the homepage. It is GPLv2 licensed (not clear if this is GPLv2 only or GPLv2+).

License

This project is released under the terms of the GNU GPL version 3 (or later). Please see LICENSE for details.

wiled's People

Contributors

seanlano avatar

Stargazers

 avatar

Watchers

 avatar  avatar  avatar

wiled's Issues

LEDOutput.cpp: __state_dim_level_goal is not checked for sanity

If the __state_dim_level_goal got itself into an illogical state (__state_dim_level_goal >= NUM_DIM_STEPS), then it could potentially get stuck that way for an extended period of time.

It would make more sense if in both the LEDOutput::setDimStepUp() and LEDOutput::setDimStepDown() functions, the default cases checked for sanity, and set to a logical value if it was found to be unacceptable.

LEDOutput.cpp: Unclear why lockout is only checked on last transition

In both the LEDOutput::setDimStepUp() and LEDOutput::setDimStepDown() functions, a lockout is always set if the __state_dim_level_goal is changing, however it is only checked if it is not active on the last transition. This results in an unintuitive functionality where a user can rapidly cycle to the second last state, but is then gated before making the final transition.

If this is intended functionality, it should be commented to justify why this is the case, as it is unclear from an outside perspective. If this is not the intended functionality, this should be resolved.

Add examples

Currently there are no examples of how to implement a system based on these libraries. It would be good to have a basic sketch showing how to utilise these libraries to combine a rotary encoder with an LED driver.

docs: Create RunMode.md to define functionality

Currently there is very little information in the RunMode.cpp and RunMode.h files to define their functionality, or how they should be used. It would be good if an equivalent to the LEDOutput.md document was created for this class.

LEDOutput.cpp: Checks against negativity on unsigned values

There are multiple sections of code where a value is checked for negativity, when the value is an unsigned type (such as the line if (inTimeMillis < 0){inTimeMillis = abs(inTimeMillis);}).

It would be a very minor performance gain if these checks were simply removed (as they serve no purpose in the current code).

RunMode.cpp: get...() functions to be fleshed out

Currently there exists a RunMode::getModeNormal() function for checking if the output mode is set to normal mode. It would be good to have equivalents of this for the other modes (blink, double-flash). It would also be good to have a generic getMode() function that could return the index for that mode (0 for normal, 1 for blink, 2 for double-flash).

Currently there exists no function for getting the blink mode. It would be good if there was a function for getting the currently assigned blink mode.

Make LEDOutput usage simpler by removing "standby PWM" memory

Currently there is code to have the LEDOutput class remember the previous power level when turning off. It also means the class must both be given a power level separately when turning on. This is unnecessary and confusing.

Instead, the LEDOutput class should:

  • Remove setPowerOn and setPowerOff methods, and require the use of one of the setDim methods
  • Ensure in all cases that the setDim methods also turn on the power (this should already be the case)
  • Remove __state_pwm_standby and other now unnecessary variables

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.