I’m working on developing the milight service. It will probably take some time as I’m not an expert in development, but I’m very motivated . For now, I can retrieve the gateway, include it in Gladys, and create the 4 Milight zones as devices.
Next step, send the command to turn the lights on/off.
Hi @link39,
if you need help with development or reviews, I’m at your disposal .
Don’t hesitate to create a Pull Request on the Gladys repo (as a draft until development is complete) so we can take a look more easily and follow the development.
I will get back to the service within the week and will therefore make a PR as indicated.
I managed to turn the lights on/off. In terms of code, I am stuck on creating parameters at the device level and retrieving them. I will probably ask you about this point.
I still haven’t had time to work on the subject because I don’t have much time to devote to Gladys at the moment.
But yes, I will have to manage the color part, which I am not currently doing. More generally, I think that all services handling bulbs should use the same ‹ color › component. I don’t know if @pierre-gilles has already done something in the Philips Hue module for colors. In which case we could build on that. I know there have been a lot of discussions about this on the forum but I’ve lost track of it now
I didn’t know about Magic Device. It really looks like the mi-light, is it recent? Do you have feedback on the state with it or is it just sending ON / OFF / color commands?
Hello, on the « create PR » button you have a small arrow (dropdown), that’s where you’ll find the draft.
But I haven’t found a way to switch from PR to draft, you’re not allowed to make mistakes.
Otherwise, you put « WIP » in the title of the PR.
Yes, indeed, and then you have SensorDeviceFeature and BinaryDeviceFeature which are currently used. The display is therefore mainly managed by feature, not by device. But also, the device does not know its own type (light, switch…), only the features know it.
We’ve had this debate many times on the forum (probably in the « Let’s talk about Gladys 4 » topic), and I’m completely in favor If a sensor manages temperature, humidity, and brightness at the same time, it makes sense to display the device only once and group the returned information, saving space.
We just need to find a clean way to do it, if anyone has presentation ideas, I’m interested.
I’m not a fan of this kind of solution, I find it cluttered and not necessarily useful to present 16 million colors to the user I prefer a selection of 10-16 colors carefully chosen, like the palette proposed by @renaiku in PR
I’m not a dev so be indulgent… and I’m open to all remarks and advice
I was heavily inspired by the hue module to understand the dev logic and I admit that some elements still escape me, especially for the interactions between UI and server.
What should work:
Detect Mi-light bridges on the network
Add areas as devices
Turn areas on/off
Bugs and remaining tasks:
Fix a display bug when adding an already existing bridge
Remove devices linked to a bridge when deleting it
Make it compatible with bridges other than v6.
Test with multiple bridges on the network
Perform the tests described in the pull-request check-list
For brightness/color management, I’m waiting for the more global reflections on the subject to mature.
Note for testers:
If you want to test and you are on Windows there is a file to modify. Indeed Windows manages broadcast quite strangely.
The file to modify is the following: server/services/mi-light/lib/light/light.getBridges.js
The explanations are in the comments.
Hi,
Great job!! I am very interested in the development of this service on the V4. @link39 Could you give us feedback on the status of the service and how color management and brightness will be handled?
I am available if you need testing or user feedback.
Again, well done for the work
Pierre Gilles and Alexandre have given me feedback on the PR. I need to correct a few elements, then I think it will be good to go for production.
Regarding the color and intensity of the light, I haven’t made any progress. On this point, I will follow the movement. When it’s clearer, Pierre Gilles should integrate this into the Philips hue. At that point, I will make changes to the mi light service to be consistent.
There are several comments from @AlexTrovato and myself on the PR in March 2020, but I think @link39 is no longer available and there have been no changes since.
If anyone has some milight and wants to pick up the torch on the PR