psieg / Lightpack

Lightpack and Prismatik open repository
GNU General Public License v3.0
1.55k stars 185 forks source link

Add new devices (MiLight/LimitlessLED)? #25

Closed Sefiroth1981 closed 7 years ago

Sefiroth1981 commented 8 years ago

Hello,

is it possible to add new devices? I want to use the prismatik software with MiLight wifi lamps (like Philips HUE, but much cheaper) to ambilight the whole room. The lamp colors can be easily set about short ethernet messages in UDP format to the lamp gateway.

The prismatik code is realy huge - can you give me a hint where I can try to implement a function to send UDP messages on color change? It should send the average screen color to the lamps.

Greets, André

psieg commented 8 years ago

HI André,

adding new devices should be rather simple, AbstractLedDevice should get you started. Just inherit that and register your device with the SupportedDevices::DeviceType enum. The main method is setColors which gets a QList<QRgb> to set to the individual LEDs

Let me know if you need any help, I'll do what I can.

Best Patrick

Sefiroth1981 commented 8 years ago

Hello Patrick,

thank you for the hint!

Unfortunately I don't even get your original fork compiled. I've downloaded all of the programs and SDKs, but I allways get errors. Do I need to download special versions? I've Windows SDK 10 and QT version 5.5.

If I run the update_locales.bat, it has an error in "wizard/SettingsAwareTrait.hpp". Something about brace excess on line 34. But the file seems to be fine...

I also tried to compile it with the QT Creator, but it seems not to find the Windows SDK. It doesn't find the dxgi1_2.h in the "DDuplGrabber.cpp".

Sorry for the newbie questions. I have a lot of programming experience, but not for windows applications. I usualy write software for microcontrollers ;-) Do you now a tutorial or something else so I can compile the fork?

Best, André

psieg commented 8 years ago

Phew, there isn't much more documentation than the README. I updated it.

Keep me posted

psieg commented 8 years ago

By the way, I stumbled across this video from one of the original developers. They didn't implement HUE support because it couldn't take that rapid changes.

Just a heads-up so you don't end up disappointed: Make sure the lamp can take that much traffic / fast change rates.

Sefiroth1981 commented 8 years ago

I can control the MiLight LED with an Android App and it changes the colors pretty fast. Indeed, they don't have to be fast for me. I want to create a room-ambilight, which color follows slow and smooth the average screen color.

But unfortunately I still don't get the code compiled... I tried it thousend times, but I get always errors and no runnable software. Unless someone has the time to post an step for step manual (including installing and configuring the IDEs & SDKs) I'll give it up :-(

psieg commented 8 years ago

Hi,

You need to download and install (links in the README)

For all of these, the default options are prefectly fine, just keep clicking next.

If I remember correctly, you next need to set up an environment variable QTDIR, which points to something like C:\Qt\Qt5.5.1\5.5\msvc2013_64. You can do this by searching 'environment' in the start menu

Now check out the code and

  1. go to <repo>/Software
  2. copy and edit build-vars.prf accoring to your machine. If you used the default paths you might not have to do anything
  3. run scripts/win32/generate_sln.sh (easiest way: open git bash here from the context menu, then run this command)
  4. build Lightpack.sln with MSBuild / VisualStudio

What error are you seeing?

psieg commented 8 years ago

@Sefiroth1981 are you still working on this?

jespertheend commented 4 years ago

@psieg Hi, I'd like to implement this. Though instead of building MiLight support into Lightpack, it might be better to have some sort of api. That way it would be easier to implement new protocols. I'm not very fluent in c and c++ and also it seems like getting this project to build is quite a process. If there was some sort of api, either using sockets or perhaps using pipes, anyone could add their own protocol in the language they're comfortable with.

Either way, I'll try to get Prismatik to build and see if I can add anything useful.

jespertheend commented 4 years ago

Ok I just built Prismatik and it was really easy so I take that back hahah. I'll see how things go from here and if it turns out it's a lot easier to just implement it into Prismatik than it is to create an api I'll take the easy route.

jespertheend commented 4 years ago

Oh hmm it seems Lightpack already has an api using sockets, not sure how I missed that.