Giter VIP home page Giter VIP logo

ai-thinker_rgbw_bulb's Introduction

Alternative firmware for AI-Thinker RGBW bulbs

This is an alternative firmware for AI-Thinker RGBW LED bulbs which uses MQTT instead of the default Chinese mobile application. The bulb is a cheap (~12-18$) product available on sites like Aliexpress and eBay which can be easily reprogrammed as it is based on the popular ESP8266 Wi-Fi chip.

Design

Features

  • Remote control over the MQTT protocol via JSON
    • Supports brightness, RGB and white colors, color temperature and effects
  • TLS support (uncomment #define TLS in config.h and change the fingerprint if not using CloudMQTT)
  • Debug printing over Telnet or Serial (uncomment #define DEBUG_TELNET or #define DEBUG_SERIAL in config.h)
  • ArduinoOTA support for over-the-air firmware updates (enabled, #define OTA in config.h)
  • Native support for Home Assistant, including MQTT discovery (enabled, #define MQTT_HOME_ASSISTANT_SUPPORT in config.h)

Last Will and Testament

The firmware will publish a MQTT Last Will and Testament at <chipID>/rgbw/status. When the device successfully connects it will publish alive to that topic and when it disconnects dead will automatically be published.

Discovery

This firmware supports Home Assistant's MQTT discovery functionality, added in 0.40. This allows for instant setup and use of your device without requiring any manual configuration in Home Assistant. To get this working, discovery: true must be defined in your mqtt configuration in Home Assistant

configuration.yaml

mqtt:
  broker: 'm21.cloudmqtt.com'
  username: '[REDACTED]'
  password: '[REDACTED]'
  port: '[REDACTED]'
  discovery: true

How to

  1. Install the Arduino IDE and the ESP8266 core for Arduino
  2. Rename config.example.hto config.h
  3. Define your WiFi SSID and password (#define WIFI_SSID "<SSID>"and #define WIFI_PASSWORD "<password>"in config.h)
  4. Define your MQTT settings (#define MQTT_USERNAME "<username>", #define MQTT_PASSWORD "<password>", #define MQTT_SERVER "<server>" and #define MQTT_SERVER_PORT <port>)
  5. Install the external libraries (PubSubClient, ArduinoJson and my9291)
  6. Define MQTT_MAX_PACKET_SIZE to 512instead of 128in Arduino/libraries/pubsubclient/src/PubSubClient.h
  7. Solder wires from (bulb) 3V3 to 3V3 (FTDI), GND to GND, RX to TX, TX to RX and รŒO0 to GND
  8. Flash the firmware (board Generic ESP8266 module, Upload Speed 115200 and Flash Size 1M (128K SPIFFS))

Design

ToDo

Licence

THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.

If you like the content of this repo, please add a star! Thank you!

ai-thinker_rgbw_bulb's People

Contributors

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