Giter Site home page Giter Site logo

lightwavecontrol's Introduction

lightwavecontrol

Arduino C++ code to control lightwaverf via MQTT

I'm fed up with the lightwave wifi controller, it sucks, so i've decided to replace it with an Arduino and a pair of cheap (£1) 433MHz rx/tx modules. I could have controlled it via the serial port, but I'm not sure what coverage will be like, so i've opted to use the ethernet shield and use MQTT instead, so I can run these standalone around the house as needed.

The beauty of MQTT is that I can have several of these subscribed to the same command queue, so it'll scale if I need to add more of them to cover all areas of the house without having to modify the code or the proxy which posts the commands to MQTT.

I use a simple nodejs proxy to take HTTP GET requests from either domoticz, ha-bridge, my phone and put the room, subunit, command and dimlevel to the MQTT message queue. Since I started off with a wifi controller I use the same constructs, so my requests look like:

http://:/?device=R1D1&command=(on|off|dimlevel 0-31)

See https://github.com/jagsta/lightwaveproxy/blob/master/lightwaveproxy-mqtt.js

The arduino receives an 11 byte string:

room (hex 1-f) subunit (hex 1-f) command (0/1) dimlevel (hex 1-f) requestId (48 bits as 6 hex nibbles)

Then forms a lightwave command using the command id configured in the include file config.cpp, and sends that using the 433 tx module

As a side benefit the arduino also receives any lightwave commands sent by itself or other devices, this allows me to keep tabs on slave light switches, remote controllers etc and update domoticz with state (of course this is inferred, since lightwave is 1-way communication).

lightwavecontrol's People

Contributors

jagsta avatar

Watchers

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