rahimkhoja / Atomik_Controller

GNU General Public License v2.0
0 stars 1 forks source link
c mysql nodejs php sql

Atomik Controller README

By: Rahim Khoja (rahim@khoja.ca)

Version 0.8 Alpha

By Rahim Khoja

The Atomik Controller manages automated and smart lights. Initially The Atomik Controller will manage Mi-Light brand lights and Remotes, but it will expand to other Atomik and third party smart devices. The goal is to create a drop in replacement for the Mi-Light wifi bridge, that expands the zone and device limitations, while providing a more robust home lighting controller. The Atomik controller currently includes a Web GUI for system management, a Nrf24l01+ 2.4 GHz transceiver for listening and transmitting, Mi-Light RF RGB remote compatibility, a Mi-Light Smartphone server emulator that allows use of the Mi-Light Smartphone app as a remote, an API for 3rd party integration, and a task scheduling system to control light zones.

Hopefully in the future the Atomik Controller will add blue tooth connectivity, additional devices from a variety of manufacturers, Zigbee compatibility, Z-Wave compatibility, OpenHAB compatibility, a simple light io scripting interface, a fully documented API for 3rd party compatibility, and other types of devices and sensors.

Features:

Compatible Bulbs & Remotes (LimitlessLED - MiLight - EasyBulb)

Screenshots of Web GUI

Atomik API Details

The Atomik API accepts JSON Commands on Port 4200 of the Atomik Controller to control the Atomik lighting Zones. Atomik API Remotes are setup, and applied to Zones from within the Atomik Controller web administration GUI. Atomik Api Remotes only have two types of commands, List and Issue. List will accept JSON that contains a valid username and password and return a JSON list of all the available zones and their current settings to the user. Issue will accept JSON that contains a valid username and password along with zone light settings, then it will update the light settings and return a JSON list of all the available zones along with the updates zone information from the Issued command. If command is not accepted or invalid credentials are passed to the Atomik API, an error JSON is returned.

All Commands are posted to 'http://192.168.1.100:4200/atomik' ( or the IP Address of the controller )

Here are some example commands:

List Command - JSON Request Example:

{"Command":"List","User":"rahimk","Password":"password"}

List Command - JSON Response:

{
 { "ZoneName":"Bedroom", "Configuration":{ "Channel":"0", "Status":"1", "ColorMode":"0", "Brightness":"100", "Color":"198", "WhiteTemp":"2700" }}
 { "ZoneName":"Living Room", "Configuration":{ "Channel":"1", "Status":"1", "ColorMode":"1", "Brightness":"100", "Color":"0", "WhiteTemp":"2700" }}
 { "ZoneName":"Hallway", "Configuration":{ "Channel":"2", "Status":"0", "ColorMode":"1", "Brightness":"100", "Color":"0", "WhiteTemp":"6500" }}
}

Issue Command - JSON Request Example:

{"Command":"Issue","User":"rahimk","Password":"password","Configuration":{"Channel":"1","Status":"1","Brightness":"65","ColorMode":"1","Color":"215","WhiteTemp":"6500"}}

Issue Command - JSON Response:

{
 {"ZoneName":"Bedroom", "Configuration":{"Channel":"0", "Status":"1", "ColorMode":"0", "Brightness":"96", "Color":"221", "WhiteTemp":"6500"}}
 {"ZoneName":"Living Room", "Configuration":{"Channel":"1", "Status":"1", "ColorMode":"1", "Brightness":"68", "Color":"215", "WhiteTemp":"6500"}}
 {"ZoneName":"Hallway", "Configuration":{"Channel":"2", "Status":"1", "ColorMode":"1", "Brightness":"18", "Color":"215", "WhiteTemp":"6500"}}
}

Invalid Request - JSON Error Response Example:

{"Error": "Invalid Username or Password"}

Notes on Atomik JSON Requests and Response:

How do I get set up?

Required Hardware:

raspberry_pi_nrf24l01_small.jpg

Quick Install Instructions:

  1. Download the IMG of the Atomik Controller 7z Direct Download
  2. Download an IMG burning tool such as win32diskimager
  3. Write the IMG to an SD Card (Must fit in your Raspberry Pi)
  4. Put the SD Card into the Raspberry Pi that has been modified
  5. Set your systems Ethernet adapter's IP to 192.168.1.1
  6. Plug the Atomik Controller into your lan and power it up
  7. After 2 Minutes go to http://192.168.1.100 in your web browser
  8. Login to the Atomik Controller with (Username: admin, Password: admin)
  9. Restart the Emulator, Transceiver, and API from the settings page after first boot

    Full System Install Instructions:

    Coming Soon! (or when I get around to it)

    Most Important CPP files have compile instruction on line 1

    SSH Credentials (pi/raspberry)

    MariaDB Credentials (root/raspberry)

Atomik Controller Technical Details

Operating System:

References & Thanks

Notes

Who do I talk to?

Disclaimer

THIS SOFTWARE IS PROVIDED BY ATOMIK (Rahim Khoja) AND CONTRIBUTORS "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANT ABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL ATOMIK OR ITS CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.

Support

Since I am extremely lazy I am not going to offer any support. Well maybe every once-n-a while. It really depends on my mood.

That being said, time was spent documenting each command in the scripts. This should allow the scripts to be easily understood and modified if needed.

Donations

Many Bothans died getting this Mi-Light Bulb Controller to you, honor them by sending me some Crypto. ;)

ETH Mainnet: 0x1F4EABD7495E4B3D1D4F6dac07f953eCb28fD798
BNB Chain: 0x1F4EABD7495E4B3D1D4F6dac07f953eCb28fD798

License

Released under the GNU General Public License v2

http://www.gnu.org/licenses/gpl-2.0.html