 My name is Louie, Louie-Opter, I'm a decent software engineer. It doesn't really matter where I am. I don't really know anything about hardware and I think that's an important part of this talk. I'm playing with hardware devices, I'm playing with IoT and I don't really know anything about this. I'm really just a software engineer. So if we're going to slide number three, agenda. So this talk is going to talk about two related projects. One is Monolite, which is an UI for devices like this one, which is basically like a matrix of buttons, like this, to control light bulbs, light bulbs like this guy here, guy, girl, I don't know actually, this bulb. So that's Monolite. It runs interface on this button array. And then LightsD, which is a demand to control the light bulbs. So this demand talks to the light bulbs, exposes a high-level API and I can control the light bulbs this way. So I'm going to first talk about Monolite, so I control the bulbs through this button array. I'm going to give you some details about the project and then I'm going to talk about LightsD, which was actually most of the work, which is a demand to talk to the bulbs. And then we're going to have maybe some time for the discussion. So if you go on slide number four, you have this high-level architecture diagram. So you can see that Monolite talks to both LightsD on the button array, so I control the bulbs. If you go next, you see that part one is going to be of Monolite, part two is going to be of LightsD. Then on slide number five, a title Monolite. So I just talked about what I said. 100 to the 8 buttons. Each button has like 16 levels of brightness. This is how I can make up a new eye by playing with the brightness levels. It's connected over serial. And then next slide. It's controlling this smart bulb, which is made by this brand called Lifix. It's about 1,000 lumens bulb, so it's pretty high brightness. It's like 70 watt light bulb. It has nice colors. You can do like all the colors. It has a nice range of whites from like 2,500 Kelvin to like 9,000 Kelvin. And both light bulbs are connected over Wi-Fi, 2.4 gigahertz. So next slide. Let's have a look at the controlling light. So you have the grid. So you have like this side should be just show like grid. Okay. And then next slide you see that the bulb row is where it's in functions. So the bulb row is dedicated to functions. So for example, you know, you'll see you have like on. I can like off. Other functions I'll show later. So yeah. Next slide that shows you like some of the functions where like they're mapped. Like how it works. You know, I could like add more things to this balance. Like for example, control like, you know, MPD, control other things. And then I have like split the array into like four control pads. Right. So this is like one control pad here. Here. Right. And like there is like four starters and I've like some function, other functions at the top. Right. So if you go to the next side, you see like what each starter is. Okay. Awesome. So can I make, make it like full screen though? Yeah. Let's do for the next talk. Maybe it's very, I don't know how to put it full screen. Okay. Perfect. Okay. So. Okay. Just, just use it here. Yeah. Yeah. Okay. So here. Okay. So like that most cider is like, you know, the hearing and then saturation, brightness, temperature. So that's the HSBK, you know, color model, HSB. And then we add the, the temperature. So like, you know, can increment, decrement. So for example, I can show this here. So I turn this guy off again. I'm going to like, you know, bring up the brightness, which is here. I'm going to change the color, which is here. Can do those two things at the same time. Okay. And so on, so on. Can I make it like less saturated? So, right. So you can all see, I could change color. All right. So like, that was kind of the demo. See. Okay. Other things. Like other things. I think this is like, it's like, ooh, like this. Okay. Small functions. What's interesting to see is that I'm going to make a smoother one. That's white. That's blue. I'm going to. So like, what's interesting is that the board shows like the, the state of the bulb in that with low light intensity. Right. That's sort of like a feature of what I did. It's like, it shows really like what the status of the bulb is. Like, you know, predicted or something intact. The real status of the light bulbs is shown on the board. So for example, if I make it like, you know, transition, we can see that the starters are moving by themselves. Right. And that's our program. It's just like showing the real status of the light bulbs. Right. One more thing I wanted to show is like, like the interface is like defined, which I think is like, pretty interesting. So I'm going to go back and get up. Oh, there is no internet. Okay. If you wait a minute, I can put it on. Yeah. So actually, yeah, I love to do this. If you can like do this, it will be awesome. So like, because, so like the way all this is implemented is in Python. So like the, the program that controls the greatest in Python and the API I made internally are pretty high level. And the way you like set your UI element on the grid is I think pretty interesting. It's pretty high level. And that's about it for like monolight on the implementation details, which you'll find on the slides. So this is Python. I've been using Python 3.5 and 3.6 with top annotations, which are awesome. So you basically like, you know, do type Python. I really encourage you to look into this if you do Python a lot. And then I use async.io. So everything is in synchronous. Awesome. Thank you so much. So I'm going to go on my profile. So there we go. You'll even know like the repository architecture by the end. That's pretty awesome. So it's going to be UI. Layers. So it's going to be like what I'm using. No. No. OK. Yeah. Space. So it's how the UI is defined, right? So I can do, OK, I have like a root layer on line 49. And then I can insert some balance. The balance I define actions in line. So see, for example, like the alerts, you know, which is the effect I did while I was moving slowly. There is the alert, which is the flashing I did. So see, I just like define some balance, say where they are, define the actions. It's very like declarative. That's pretty cool. OK. Coming back to the presentation itself. OK. One or two actual, maybe one more thing that's interesting on the with monolite, something I'd like to do next is that I'm just going to show it on the sides. So imagine we have two functions, like timer and alert. So we could say, like, press the timer button. And then, you know, you have this at shop, which is like a timer picker, right? It's like the much time you want on your timer. And then press the target once you have selected the time. Press an effect like alert, which is the one I played and flashed the bulb with. And then I would like run automatically, right? So one thing I do with my laptops a lot is I use them as a kitchen timer. I have, like, bulbs over the house. Like, the kitchen timer thing is pretty nice. You know, it doesn't, like, blow your, like, hair drums. OK. I'm going to skip this. I talk about it already. I use, oh, I'm just going to talk about, like, art and pop-ups. I'm using his library to talk to the Belongrid. It's GPR with v3. What else do I have to do? OK. I'm going to skip over, like, lightsd. I'm going to skip this demo. But basically, like, this is how I will, like, show you how to do the same thing, but come in line. So I'll show you how to talk to lightsd, the demo that controls the light bulbs, which runs directly on the Wi-Fi access point here. Like, it has very high-level API in Python. Like, you know, I will show you an example in Python again. You can just, like, you know, do a decompression. You get, like, you know, a one-liner. You get the set of the bulbs. Another one-liner you can set, you know, turn them off on, do some effects. Very simple. No discovery delay. Very high level. OK. That's the current project, actually. Like, you know, what I should do so far on the grid is be, like, a small amount of the work. Most of the work was in lightsd, the other project. It's in C. Once everywhere, details here. The original ideas behind lightsd were to remove, like, discovery delays, glitches that comes with what the LFX manufacturer delivered to you with the light bulbs. Basically, like, the bulbs are nice. But the software stack is sort of, like, not so good. It got a lot better in, like, three years. But, like, in the beginning, it was really, really bad, and that's why I started the project. So original ideas, like, you know, reduce, like, issues, improve the user experience. Also, I had, like, security in mind, right? I don't want to have light bulbs on my, like, you know, home network. I want light bulbs to be on a separate, dedicated, closed network. I don't want them to have access to internet. I don't want them to access anything, really. Right? And lightsd by acting as a proxy allows you to do this, right? You can isolate the bulb on the network and use that as a gateway to the bulbs, right? So no cloud, no internet required, no nothing. Like, NGPW3. And, like, something I had in mind with this project is also, like, to make it accessible to people, right? This is a personal project. I'm not doing this for, like, profit. I'm not doing this as part of my company. I'm not doing this entirely personal. And I want it to make it accessible. So, like, have good code, show good practices. You know, I did, like, Python 3.6, like, you know, bleeding edge stuff. So, like, you know, that's an opportunity to do this, right? Good docs. On the implementation details for lightsd, it uses, so, Lightfix has two APIs. One is HTTP. It goes over the cloud. And one is, like, on the local network. It's UDP. It's much faster. It's so much harder to use. So I put all the communications to the bulbs. You know, I use sampling to keep track of the bulbs, right? Everything is, like, the bulbs themselves, you can, like, ask their state, set their state. They're like, you know, the protocol is completely stateless, right? I need to, like, do sampling to, like, know what the state of the bulbs are, right? So I just, like, pull them all the time, right? And that's how I get to have low latency. You can talk to my high-level API over TCP, unique sockets. Basically, like, my API offers you, like, the same kind of functionality you have with your call API, except there is no cloud, right? It's all on your local network. On this project, I have, like, some fun parts and some, like, you know, more, like, headbanging parts. One part I like to talk about, especially, is, like, what I call, like, stack position, right? Right Z is actually, like, sort of in the middle in the stack, right? On the left, it's what I call, like, lower-level stuff, which are, like, the bulb. It's hardware. It's embedded. On the right, you have, like, monolite, which is a user interface. It's in Python. It's high-level. It's a GUI. It's, like, you know, there is not much, you know, system-level programming stuff. The light is in the middle. It's in C. I find it's pretty interesting because it's up and up. It opens up to, like, a wide range of topics, right? By working, and, like, I didn't know it would go this way when I would start working on lights, do you? But, like, it really opened up to a lot of things. I can, like, either go really deep down and start doing reverse engineering, start writing, like, a few more bits and, like, on the light bulbs and, like, do, like, more hardware-related things, or I can go very high-level or, like, writing GUIs in, like, very high-level code, right? And I find this pretty interesting. Some lights on the light-fix bulbs I wanted to share with you. If you, like, if you want to get them, get them on sale. They're pretty expensive. I think that you'll have the best brightness and colors on the market as of today and the bit, like, you know, there are competitors in this. You have to keep in mind their standby power consumption, which is still pretty high. I'm pretty pissed at, like, you know, the bulbs, like, saying, like, here on the box, it's activated A when the thing, like, you know, consumes two watts in standby. I mean, if you have, like, you know, like, 10 light bulbs, you have, like, it's stuck if you had always one fully turned on. They have a cool NAPI, and I think they're the only vendor to do this. And it's pretty cool. Like, I mean, like, I hope they keep it. It's pretty nice. They're not super mega-hopin' about it, but they're not really close about it either, right? One thing, though, is only the first generation of bulbs doesn't crash for me, right? Everything they made after this, and they're in generation three, basically crashes, right? They have, like, I could go into the details of this, but there's some Wi-Fi conditions which always happened to me, which always happened for me, the bulb crashes, unfortunately. So really, what I wanted to say about this is, like, binary blobs suck, really. I love to be able to get access to the firmware source code and, like, be able to, like, have something more up under so I could, like, debug and eventually fix what's going on, like, fix debug, add the opportunity to take action on this, right? Or replace their stuff with my own stuff like this, right? So really, again, like, you know, free software convention, binary blobs suck, still the case. Really? Thank you. I like other things I want to do on this project, you know, do a time-based release, improve my CI automation, do what I call set enforcement. So basically, like, in LightZ, maintain two versions of the light bulbs, one which is the reality and one which is what I want. And because it's, like, all very janky, you know, LightZ will, like, always try to make what's supposed to be the reality, right? So, like, I have two views and I apply one on top of each other. And then, with this, be able to do a real cool, like, effects API, add effects plugin. They're, like, really reliable, right? And stuff like this. Other things I like to do, but, you know, I will never do in enough time. But, however, like, if other people want to, like, you know, firmware, like, something I love to do is, like, be able to, like, debug the firmware. And I have access to the firmware. Just make it easier for me to, like, reverse engineer the API. Stuff like this. That would be awesome. Yeah, that's about it. We have, like, a minute left for discussion. And questions. So, like, please go ahead. Don't be shy. Otherwise, I have, like, a slide. Okay, one question here. Yeah, so have you been in contact with the supplier of the light? Yes, I've been in contact with the supplier. Can you repeat the question? Yes. So have I been in contact with the supplier about my project? Yes. Actually, yes. And they've recognized that, for example, the crashes and they say it only affects a small amount of people. But it certainly affects me. They've been pretty nice. They don't really care about the project because I'm doing something which is, like, completely different from, like, their product, right? Their product is cloud. It works in, like, mobile. I'm doing a demand and see that you have to install somewhere. Right? I'm making it as easy as possible, but at some point you're going to have to run an app get or you're going to have to, like, use appendability and, like, you can put it somewhere in a Raspberry Pi, whatever you want. But you'll have to open a Hutu and type some comments. Right? So they're not something that I've been interested in, right, I believe. And, like, I totally understand this. They're not interested to open the firmware? No, they're not interested. I also ask these questions. They're clearly not interested in opening their firmware. Any other questions? No? Okay. Well, thank you so much.