-
Notifications
You must be signed in to change notification settings - Fork 9
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
No way to distinct bulbs, plugs and switches #6
Comments
Is there any progress on this issue? |
So I'm looking at it right now, (I promise nothing what so ever), but I wonder, @tfriedel, why is there, python-lightify/lightify/__init__.py Lines 63 to 75 in 2ed46ea
Why do we translate the device type numbers in the first place. What is wrong with https://github.com/noctarius/lightify-binary-protocol#device-types? We cold just pass on the numerical device types or? I mean 10 is as good or bad as 1. Why are these already parts of the Luminary class? I don't know for sure, but judging from the protocol, there should be lights that have fixed temperature and fixed rgb, so there is no point in having a set function for them. python-lightify/lightify/__init__.py Lines 104 to 128 in 2ed46ea
|
I started to think, if a rewrite would be the right way here. The thing with the python-lightify right now is, that it works quite different from the underlying protocol. Probably we are better off with a library that closely sticks to the protocol itself. The advantage would be:
|
well the devicetype is not used for anything yet I think. the library only really supports Lights and Groups currently. if you were to add support for the other device types or for debugging purposes, it's nice to have an enum or something more humanly understandable. regarding temperature/rgb in Luminary, your observation seems reasonable. I would tend to agree, it doesn't make much sense. Note that I'm not the original author of this stuff but basically only fixed/rewrote some parts that needed to be changed. So I can't help with you everything. Also with the homeassistant side of things (osramlightify.py ) I can't help you at all. A rewrite would maybe make some things easier. However as far as I know at lot of features are not accessible at all, like getting notified about the press of a switch. Of course it's possible that the HOW has not yet been reverse engineered. I suspect that these features are just only available inside the gateway unfortunately. So for me this platform is not worth putting much effort in it. It would probably more useful to make all the hardware (lights, switches, sensors) work with a better gateway. |
Okay, that is fine, would come later anyways.
Oh I didn't know this, but how sure are you? |
Thinking about a class structure, I'm not quite sure what is the best way. I could either create a class per DeviceType, or try to combine the 4 Bulbs (id 1-4) into one class and also the switches into one class. Right now I think it would be clearer if there is one class per device type. This would allow for a clean structure, no matter what Osram does with the DeviceTypes. |
Well I did spend probably a day looking into it. I think what would really be needed from the gateway would be a push notification system. But since it was designed to only trigger the lights they just made an app that allows you to configure the connection between lights and switches and all the magic is happening inside the gateway. So I'm 90% sure that it's not possible. To make the switches usable, you would have to program your own gateway or deal with them on the zigbee level. A custom firmware for the osram gateway would be something :) |
uff, not too good news here. A custom firmware is clearly out of my scope for now. Also the zigbee protocol level itself is nothing I have experience with. |
There's also this project: https://github.com/Koenkk/zigbee2mqtt |
Year, I know there are other ways, but in particular for HomeAssistant it is useful if it just works with whatever people have at home. |
Well, after a closer code inspection it turned out that the library actually exposes device type (LIGHT, PLUG, MOTIONSENSOR or SWITCH), it was just not used by Home Assistant. Closing this particular bug, please open new bugs as needed. Thanks! |
Awesome news, thanks for your work! |
At the moment the library reports all devices as bulbs. According to https://github.com/noctarius/lightify-binary-protocol#device-types it should be possible to distinct them.
See also home-assistant/core#12206 .
Thanks!
The text was updated successfully, but these errors were encountered: