jangxx / node-magichome

An incomplete implementation of the functionality of the "Magic Home" app. Partially a port of https://github.com/Danielhiversen/flux_led to Node.js
ISC License
124 stars 26 forks source link

Support for new devices #39

Closed martijnpoppen closed 2 years ago

martijnpoppen commented 2 years ago

Hey, Thanks a lot for your library.

I was wondering if you have plans to support newer devices. Devices like 'AK001-ZJ2146', 'AK001-ZJ2147', 'AK001-ZJ2148', 'HF-LPB100' are not working right now. (only on/off)

Flux_led got a lot of updates recently and supports these devices.

I already tried to make a few adaptions to this library(which adds support for above devices) but I don't have the knowledge of all the different buffers. (edited control.js)

Flux led models DB: https://github.com/Danielhiversen/flux_led/blob/master/flux_led/models_db.py

Looking forward to your answer :)

jangxx commented 2 years ago

Interesting, I really haven't been following flux_led since I bought my last magic home device a few years ago. I would love to support these new devices though. Thanks for the tip, I'll look into it in the new year after my christmas holidays.

mandray commented 2 years ago

@jangxx sorry for the ping, but has there ever been any progress on this. I'm definitely willing to pay for a bounty for these newer lights. I'm experiencing the same thing with only being able to turn on/off

jangxx commented 2 years ago

Unfortunately not. I looked into the changes in the flux_led library after christmas as planned, but what I found was a bunch of magic buffers and no information about what any of the fields do. The first version of this library also contained a bunch of magic, but after all the uncertainties of the old protocol are finally cleared up, I'm now not really willing to reintroduce a bunch of undocumented magic buffers into the codebase again. I would therefore prefer to wait until some more progress on reversing the protocol is made so that we can have a fully featured and robust implementation from the get-go.

The other problem is that I'm not really using this library myself anymore. When I originally started this project, I had just gotten a new LED controller that I wanted to automate and integrate into my own smart home solution. Over the years I've gotten more and more controllers, but at some point I started flashing them with Tasmota instead, which is not only more stable but also has more features than the original firmware. Right now I only have a single controller left which still uses the original firmware and therefore requires this library. I also haven't bought any of the controllers with the new firmware, so if I were to port the flux_led changes, I'd have no way to test them and would be totally dependent on other people to tell me if the library actually worked. Considering I have a bunch of other projects I'm working on as well, all of these factors have not really motivated me to put in any more work into this library.

I'm still open on merging PRs however and if someone wants to step up and implement support for these new controllers, I also wouldn't be opposed to jumping into a Discord call or whatever (or communicate some other way), to talk about specifics before actually starting on the implementation (if desired). Personally, I can't rule out that I'll never work on new features of this library, but for the near future I don't have any concrete plans, sorry.

martijnpoppen commented 2 years ago

Hey @jangxx Thanks for your reply.

I completely understand.

I don't have the knowledge about these devices to help out. I tried some things myself with ADB debugging to get the AK001-ZJ2148 (addressable) to work. Which I shared in my top post.

But apart from that I'm not sure how it works. And according to the flux_led library there are a lot of differences with the new firmware.

If you want to continue on this one day I can try to help out :)

For now thanks for looking in to this!

martijnpoppen commented 2 years ago

@mandray Not sure if it will help you.

But this lib is actively supported https://github.com/SynTexDZN/homebridge-syntex-magichome and uses flux_led via JS.

Unfortunately not suitable for my use-case

mandray commented 2 years ago

Aww, that's unfortunate @jangxx, but completely understandable. I have to try out Tasmoto at some point.

Thank you @martijnpoppen I tried using your custom code, but it still wouldn't work for my AK001-ZJ2148. Home assistant has it working flawlessly though because they use flux_led.

Also thanks for sharing https://github.com/SynTexDZN/homebridge-syntex-magichome but looks like this is still the python flux_led :(

Sad, i'll keep trying to figure things out with my super basic knowledge, but hopefully someone comes to the rescue at some point

martijnpoppen commented 2 years ago

@mandray If you use my edited version try to use it like this:

new Control('0.0.0.0', { ack: Control.ackMask(0), connect_timeout: 8000, addressable: true, custom_SPI: true });
mandray commented 2 years ago

@mandray If you use my edited version try to use it like this:

new Control('0.0.0.0', { ack: Control.ackMask(0), connect_timeout: 8000, addressable: true, custom_SPI: true });

Sorry spoke too soon, yeah this still isn't working for my AK001-ZJ2148 controller sadly

bobbyjenkins34 commented 2 years ago

@jangxx is there any way we can support the development of these new devices monetarily? It's sad that no one has taken up the helm and it seems like every magic home device is now using this new schema even giderwels

jangxx commented 2 years ago

Thanks to some financial support I'm now working on this again and have made some good progress already. You can follow the progress in the addressable_support branch. I'm gonna close this issue once I'm done and have published a new release to npm.

martijnpoppen commented 2 years ago

Thanks a lot @jangxx , I'll also send some financial support to you :)

jangxx commented 2 years ago

Sure if you want to, I have some donation links at the bottom of my website. I was contracted to work on this however, so no need to feel pressured into donating.

jangxx commented 2 years ago

So the implementation is pretty much done including documentation. If you want you can try it out in the addressable_support branch and if there are no further issues I'm gonna merge and publish it next week.

jangxx commented 2 years ago

Version 2.8.0 has been published to npm, so I'm going to close this for now. If there are issues with the new version, please open a new issue for them.