Code Monkey home page Code Monkey logo

magichomeapi-arduino's Introduction

MagicHomeApi Arduino

MagicHome Wifi protocol for Arduino like boards.

This library was designed for use with devices compatible with the MagicHome Wifi app.

It currently supports

  • RGB Controllers
  • RGB+WW Controllers
  • ARGB Controllers

Commands

  • Turning devices on and off
  • Setting colors (rgb, rgbw, ARGB) + brightness
  • Sending preset functions

Usage/Examples

Create new object (You may find ip of controller in your router admin panel)

MagicHomeApi Led("IP Address", 5577);

Turn device on

Led.TurnOn();

Turn device off

Led.TurnOff();

Set led color (r, g, b, w must be in range from 0 to 255, if not there is filter function), (brightness must be in range from 0 to 100)

Led.SetColor(r, g, b, w, brightness);
Led.SetColorARGB(r, g, b, brightness);

Set preset function (speed must be in range from 0 to 100)

preset_number:

  • 37 = Seven color cross fade
  • 38 = Red gradual change
  • 39 = Green gradual change
  • 40 = Blue gradual change
  • 41 = Yellow gradual change
  • 42 = Cyan gradual change
  • 43 = Purple gradual change
  • 44 = White gradual change
  • 45 = Red green cross fade
  • 46 = Red blue cross fade
  • 47 = Green blue cross fade
  • 48 = Seven color strobe flash
  • 49 = Red strobe flash
  • 50 = Green strobe flash
  • 51 = Blue stobe flash
  • 52 = Yellow strobe flash
  • 53 = Cyan strobe flash
  • 54 = Purple strobe flash
  • 55 = White strobe flash
  • 56 = Seven color jumping
Led.SetPresetFunction(preset_number, speed);
Led.SetPresetFunctionARGB(preset_number, speed, brightness);

Feedback

If you have any feedback, all contact information is in my github profile

Author

Contributors

Copyright 2022 Anton Panurin (Tommy4chan). Licensed under MIT.

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.