https://github.com/nathanielxd/magic-home
A .NET library that imports functionality from the Magic Home app, allowing control of smart lights.
https://github.com/nathanielxd/magic-home
bulb discover-bulbs lan light light-controller magic-home smart-bulb smart-home smart-lights
Last synced: 25 days ago
JSON representation
A .NET library that imports functionality from the Magic Home app, allowing control of smart lights.
- Host: GitHub
- URL: https://github.com/nathanielxd/magic-home
- Owner: nathanielxd
- License: gpl-3.0
- Created: 2019-01-21T16:11:49.000Z (about 7 years ago)
- Default Branch: master
- Last Pushed: 2024-07-30T13:10:17.000Z (over 1 year ago)
- Last Synced: 2025-08-27T17:57:31.934Z (6 months ago)
- Topics: bulb, discover-bulbs, lan, light, light-controller, magic-home, smart-bulb, smart-home, smart-lights
- Language: C#
- Homepage:
- Size: 48.8 KB
- Stars: 28
- Watchers: 4
- Forks: 7
- Open Issues: 3
-
Metadata Files:
- Readme: README.md
- License: LICENSE
Awesome Lists containing this project
README
# Magic Home [](https://www.nuget.org/packages/MagicHomeAPI/1.4.0)
.NET Library that allows you to control Magic Home enabled lights connected to the same LAN.
With this, you can control your bulbs and led strips that work with the [Magic Home App](https://play.google.com/store/apps/details?id=com.zengge.wifi).
This library is also available in [Dart.](https://github.com/nathanielxd/magic-home-dart)
## Requirements
- A bulb or led strip that works with the Magic Home app;
- Your device connected to the same network as the light.
## Quick Example
```c#
var discoveredLights = await Light.DiscoverAsync();
if (discoveredLights?.Count > 0)
{
var light = discoveredLights[0];
// Connect.
await light.ConnectAsync();
// Check if it is ON.
if (light.Power == false)
await light.TurnOnAsync();
// Change color to green.
await light.SetColorAsync(0, 255, 0);
// Print to console light's status.
Console.WriteLine(light.ToString());
}
```
## [Documentation](https://github.com/nathanielxd/magic-home/blob/master/DOCS.md)
Available in the DOCS.md file.
## Installation
[NuGet](https://www.nuget.org/packages/MagicHomeAPI/1.4.0)
.NET CLI `dotnet add package MagicHomeAPI --version 1.4.0`
### Features
- Discover lights on LAN;
- Turn on/off;
- Use color and warm white;
- Turn preset and custom patterns;
- Use time.
### Missing features:
- Music and microphone;
- Use built-timers;
- Other fancy stuff;
- Administration to set WiFi SSiD key.
### Contribute and support
If you need any help or request, open an issue or leave an email. I will answer immediately. If you randomly get errors, it might be because of the light so I can't help it.
I'm also open to collaboration.