Skip to content

πŸ’‘πŸŒˆ .NET library which fakes a MagicHome/ZENGGE/FLUX LED-Controller

License

Notifications You must be signed in to change notification settings

iUltimateLP/MagicHomeController

Folders and files

NameName
Last commit message
Last commit date

Latest commit

Β 

History

13 Commits
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 

Repository files navigation

MagicHomeController

This is a .NET library which fakes a MagicHome/ZENGGE/FLUX LED-Controller, using TCP and UDP sockets.

How does it work?

I reverse engineered the MagicHome protocol which is in use between the smartphone app MagicHome and a real LED controller. Figuring out how it works allows us to implement a fake controller in the network. You can read more about the reverse engineering process here.

Example

The project contains two projects, MagicHomeController and MagicHomeController.Example. The first project is a library which you can implement in your own projects, and the second project is a simple example which logs out the commands to console.

Here's how you can implement it:

// This is the interface which handles all the logic
ControllerInterface controllerInterface = new ControllerInterface();

// Create a new controller object which will contain the variables and can call events from the MagicHome app
Controller controller = new Controller();
controller.OnPowerStateChange += (bool power, Controller c) => {
    Console.WriteLine("Power changed: " + power);
};
controller.OnColorChange += (Color color, Controller c) => {
    Console.WriteLine("Color changed: " + color);
};

// Adds the controller to the interface and starts the spoofing process
controllerInterface.AddController(controller);
controllerInterface.Start();

// Keep this window open
Console.ReadLine();

And now?

My original reason I wanted to do this is because I wanted to connect my Logitech RGB keyboard with this, so it is synchronized with the LED strips in my room. What you do with this is up to you.

The events OnPowerStateChange and OnColorChange should be all you need.

About

πŸ’‘πŸŒˆ .NET library which fakes a MagicHome/ZENGGE/FLUX LED-Controller

Resources

License

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published

Languages