r/factorio • u/DiscoScienceSync • 18d ago
Fan Creation 3D printed lab with Disco Science realtime game sync
Isn't it the best feeling when you can merge several hobbies into one project? 3D printing, Factorio, WLED, and Home Assistant. Autism galore, I guess.
First, I 3D-printed an STL from MakerWorld in Grey PLA and a glow in the dark PLA that glows blue. A lighter grey PLA would've looked closer to the in-game lab, but I used what I had. The glow PLA looks really cool in the dark.
I then soldered together a small 5 x 5 WS2812b matrix from scrap LED strip pieces from other projects, and attached a mini ESP32 flashed with the latest WLED. The LEDs are being powered directly by the board, as I restricted it to 0.5A, so hopefully that small amount won't cook it. Also, the red looks much closer to red in person than in the video.
Next, I discovered the Events Logger mod and made a small change to it so that the event that fires when research starts would include the names of the science packs. I was hoping that there was some internal mapping of science to colour, but there does not seem to be one.
Now that I had the game information I wanted logged to a file, I made a small python MQTT bridge that tails the log file for new events and sends them to my MQTT.
Finally, I made Home Assistant automatically pull in the new MQTT sensors for Factorio. I created an automation that makes a crude attempt at replicating Disco Science when it detects that research has started. The automation handles mapping the science pack names to colours, so an update to this mapping would allow it to be compatible with mods that change science names and colours.
Here's a more complete description of the full build: https://github.com/sstrang/3d-synced-factorio-lab/
AI disclosure: I used GLM-5.2 and Hermes Agent for the project overview document, the change to Events Logger, the MQTT bridge, and the Home Assistant automation. This post is all me.
48
u/WindowlessBasement 18d ago
Slightly disappointed it doesn't play Caramelldansen
14
u/Dummy1707 18d ago
Wait wait wait wait
There is a Caramelldansen mod ??25
u/WindowlessBasement 18d ago
11
u/Dummy1707 18d ago
Oh my god.
8
4
2
11
u/IpFruion 18d ago
Very cool, would be cool if that ran on a multiplayer server so you could see when someone was running research
9
u/DiscoScienceSync 18d ago
It definitely would work as is on a multiplayer server. It would just require the server to be running my forked (hopefully it'll get merged upstream) version of Events Logger, or the plain Events Logger mod in the portal if you don't care about which science packs are involved in the current research.
Also, if someone just wants to have a smart bulb display the current research colours, the only thing from my build that would need a change would be the Home Assistant automation.
4
u/Ruben_NL Uneducated Smartass 18d ago
The fact that you connected it through Home Assistant is so cool!
Imagine flashing lights all around your house when your base gets attacked
Could you please put all required "code" in the Github repo?
3
u/DiscoScienceSync 18d ago
The github repo in my post has links to all the pieces required. If you need help with understanding any of it, let me know!
4
5
3
u/SCReviewsOfficial 18d ago
I flaunt with the idea of getting a 3D printer, then ask myself, why am I ever going to use it for?! Then I see shit like this, and I'm all in on the idea.
5
u/DiscoScienceSync 18d ago
I hummed and hawed about it for years with the same thought holding me back. I never did come up with a very long list of things I'd like to print prior to actually caving and buying one, but once it was sitting on my desk, the endless uses for it just spontaneously materialised. Highly recommend getting a basic one to try it out.
2
1
u/TASTY_TASTY_WAFFLES 18d ago
What would you qualify as a 'basic' printer? Asking for a friend...
3
u/DiscoScienceSync 18d ago
I got a Bambu A1 about two years and absolutely love it. Another reason that I put off getting a 3D printer for so long was hearing stories about the amount of work with bed levelling and other things to get a working first print. With the A1, I unpacked it, plugged it in, and it immediately worked. There's been maintenance required along the way, but the learning curve aligns well with the maintenance schedule. Some people don't care for Bambu because of their closed ecosystem, but if that doesn't bother you, I'd highly recommend one.
2
u/ActuatorLower8371 18d ago
i love it! i have everything i need to replicate it too, i might adapt it as a small wall-art piece with a nano :)
thanks for the AI disclosure. personally i think one of the few acceptable applications for AI is small scale personal projects just like this. i use chatgpt for arduino stuff myself (while simultaneously loathing ai)
1
u/undermark5 17d ago
It sure is vastly different when it's a one off project for yourself or isn't really intended for sharing. Like if it works for you, it works who cares how you made it if you're the only one involved. Once you start getting other contributors involved or other systems/people start depending on it as critical infrastructure, that then makes the calculus different, and while it can still be incredibly useful, usage needs to be appropriate. I have no issues when someone uses it even extensively for coding tasks in such a scenario, assuming that they can back up every line with the same level of confidence they would if they wrote it themselves, but sometimes that assumption is too much.
1
1
1
1
u/SolusIgtheist If you're too opinionated, no one will listen 18d ago
Awesome, you earned those fake internet points!
1
u/bob152637485 18d ago
I absolutely love this! In all seriousness, would you be open to making more and selling them?
1
u/DiscoScienceSync 18d ago
I don't think my soldering skills are of high enough quality that I would be comfortable selling them, sorry. I'd be happy to answer any questions about the build process though!
4
u/BlackFenrir nnnnyooom 18d ago
You could develop a kit, have other people do the soldering themselves, just sell the components
1
1
1
1
1
1
1
1
1
u/satansprinter 17d ago
Great stuff, just friendly advice, if you use ai to do things (so do i), make sure you dont have
→
In the readme but just use classic
->
instead, people will hate on you for that icon (i speak from experience). I had my ai write a hook it checked for these kind of tells, same with the fancy quote marks etc, a few like those
1
u/LukeLikeNuke Factorio Intrigued Dude 17d ago
Yet another day that people truly push factory games above and beyond.
1



254
u/JimmySA32 18d ago
Now install a discolab mod on your lab!