
Show HN: I connected my house lights to video games - StavrosK
https://www.stavros.io/posts/wifi-enabled-rgb-led-strip-controller/
======
famfamfam
> Ideally, the games themselves would have some sort of API, or some other way
> to either communicate what’s happening in the game so I can map colors to it

A number of games implement Mumble Link
([https://wiki.mumble.info/wiki/Link](https://wiki.mumble.info/wiki/Link))
which provides a memory-mapped file that includes positional data used to
provide directional sound by voice-comms software (so when a teammate speaks
you hear their voice as if you were both in your relevant locations in the
shared virtual space). Some games also expose other data through this
including health/mana/ammo levels which could be used to control lighting
based on game state.

~~~
showerst
At least some games interface with fancy mice and keyboards to change the
colors and pulse. Maybe the author can tap into that data?

[https://www.reddit.com/r/gaming/comments/4iplar/til_overwatc...](https://www.reddit.com/r/gaming/comments/4iplar/til_overwatch_makes_deathadder_chroma_change/)

~~~
StavrosK
That's another great idea. I'm looking for a Razer Chroma API, not much luck
yet, but their site[1] seems to have some info. Of course, they're going to
make it much easier for you to _tell_ their keyboard what the color should be
than to _read_ that color...

[1]:
[http://developer.razerzone.com/chroma/](http://developer.razerzone.com/chroma/)

~~~
anexprogrammer
There's been quite a few people exploring logitech gaming keyboards with LCD
(G19 etc), adding pidgin plugins, games widgits etc. Maybe you can get enough
from github to figure out what you need?

Or there's Roccat's power grid which interfaces games to a phone app. No idea
how open or investigated that is though.

------
mplewis
Next time, you should try some addressable LEDs. Neopixels, aka WS2811/12/12B,
let you set the colors of individual bulbs instead of the entire strand. They
work great with ESP8266!

[https://blog.adafruit.com/2015/06/30/updated-neopixel-
suppor...](https://blog.adafruit.com/2015/06/30/updated-neopixel-support-for-
esp8266-and-arduino-zero/)

~~~
StavrosK
NeoPixels are great, but they're ten times more expensive than this strip,
unfortunately...

~~~
nemik
[https://www.amazon.com/ALITOVE-WS2812B-Individually-
Addressa...](https://www.amazon.com/ALITOVE-WS2812B-Individually-Addressable-
Waterproof/dp/B00ZHB9M6A/) are perfectly cromulent LEDs and less expensive
than Neopixels. Not as cheap as the RGB strips, but if you pick off more
points for colour analysis, you could adjust them along the edges, if you
really wanted to. Nice work on the project!

~~~
StavrosK
Ooh, that's much cheaper, thanks! I'll order one and play around, it should be
much better for an Ambilight-style display as well, thank you.

------
zabaki
I find it amazing how he has hacked all of this. Well done.

As a non-hacker some of the similar results i've found has been philips hue
and lightpack
([https://www.kickstarter.com/projects/woodenshark/lightpack-2...](https://www.kickstarter.com/projects/woodenshark/lightpack-2-ultimate-
light-orchestra-for-your-livi))

~~~
StavrosK
It wasn't actually that hard (or at least the learning curve was smooth), I
only have a few months' experience with hardware. Plus, it was extremely fun!

------
chatmasta
Would it be possible to implement some sort of "HDMI proxy" using something
like the raspberry pi? You would plug the HDMI input (e.g. from xbox) into the
raspberry pi, and then another HDMI cable from the raspberry pi to the TV. The
raspberry pi would then somehow read the input stream, parse the bits to get
the color you want, and forward the input stream unmodified to the output.

I have no idea how HDMI works, so I don't know if this is even possible. Would
you see a degradation in quality even though you are not re-rendering
anything? i.e. Can you do this without a high powered graphics card acting as
the HDMI proxy? Is it even possible to intercept HDMI stream, or is it a
proprietary protocol?

EDIT: Some good info here [0]. tl;dr, seems possible with < $200 hardware.

[0] [http://stackoverflow.com/questions/32290289/rasberry-pi-
hdmi...](http://stackoverflow.com/questions/32290289/rasberry-pi-hdmi-input-
hdmi-output-for-image-processing)

------
patrickk
Very impressive.

In a similar vein, here's a DIY Ambilght clone, which you can customise to fit
different sizes of screen via software and a raspberry pi:

[http://www.instructables.com/id/DIY-Ambilight-with-
Hyperion-...](http://www.instructables.com/id/DIY-Ambilight-with-Hyperion-
Works-with-HDMIAV-Sour/?ALLSTEPS)

------
deegles
I'm building a 100w RGB LED light show that will also be controlled with the
ESP8266. The software will just receive UDP packets and maybe do a bit of
interpolation if necessary.

It's a bit trickier since I need to drive them at ~30v and 1 amp per channel
:)

~~~
StavrosK
Hmm, probably not too much trickier, my controller was designed for 1 amp per
channel as well, although at 12V... I'm guessing your leds will be
individually addressable, though? Or maybe you'll just have more controllers.
Either way, it sounds like a lot of fun!

------
aardshark
For reading directly from a program's memory, have you tried using Cheat
Engine/scanmem to find the location of the variables you're looking for? I
think that'd be easier than using IDA.

~~~
StavrosK
Yes, I tried that too, but it's hard for me to find the location of something
like a color, which changes every frame. I know that people have done it, I'm
just not aware of an efficient way to find something that you don't know the
value of _or_ how it changed.

If you have any tips, please share, because that would be _very_ useful for
this project.

~~~
gridspy
A combination of the python pixel capture and memory scanning (for the
captured value) could work here.

------
iverjo
Cool project! As many games lack APIs, you could potentially analyze the raw
audio and the graphics in real time, and use machine learning for detecting
certain events, such as goals in rocket league

~~~
StavrosK
Hmmm, good idea, I didn't think of analyzing the sound. You can pretty easily
tell when the "boom" goal sound plays, but not who scored. Maybe you can tell
the latter by reading the screen, though. I will have a play when I get back
home, although I still need to find a quick method to take screenshots in
Windows.

~~~
daeken
This one is actually way easier than Super Hexagon! You can use a memory cheat
tool to look for the current scores, then watch for changes in those
addresses. I'd be happy to hunt that down and write up an implementation if
you want; I'd love to have the Hue lights in my theater change for Rocket
League.

~~~
StavrosK
That's actually a great idea! Do you want to email me? My email is in my
profile.

------
alimbada
Reminds me of Microsoft Illumiroom:
[https://www.youtube.com/watch?v=L2w-XqW7bF4](https://www.youtube.com/watch?v=L2w-XqW7bF4)

------
agumonkey
Now play Resident Evil with such setup ;)

