hyperion.ng icon indicating copy to clipboard operation
hyperion.ng copied to clipboard

Add Home Assistant support

Open popy2k14 opened this issue 1 year ago • 6 comments
trafficstars

Feature request

It would be a nice addition if an native home assistant api could be implemented as an led hardware.

What problem does this feature solve?

This solves the issue of doing workarounds like emulate hue bridge in home assistant or something like this: https://community.home-assistant.io/t/use-home-assistant-lights-with-hyperion/678249/2

What does the proposed API look like?

See here, it's well documentated.: https://developers.home-assistant.io/docs/api/rest/

How should this be implemented in your opinion?

You could choose an entity for a single led on the led hardware setup.

Are you willing to work on this yourself?

No, sadly not.

popy2k14 avatar Feb 18 '24 16:02 popy2k14

What LED types are you addressing via HA?

I do not yet understand why an extra hop via HA is required or seem to be beneficial? Running some LED updates directly and some others via HA will ensure that both updates are not on sync. (Unless you run with very low fps).

Lord-Grey avatar Feb 18 '24 21:02 Lord-Grey

I want address single ambient light bulbs, which are connected this way HA -> Zigbee2MQTT -> Zigbee network -> bulb.

The benefit of implementing HA is that you can address any HA supported "lights" which are a lot. So with the middleware HA, hyperion is compatible with much much more lights. Sure it's not realtime streaming, but on single ambient light bulbs (not strips with dozends of leds), the update intervall must not be so high (in my case also a rgb wled strip (no daisy chain leds)) i have set "smoothing" in hyperion to 2000ms. So on single light bulbs update's could happen every 2000ms. The dimming/transition (in my case) is happaning on the bulbs itself.

popy2k14 avatar Feb 19 '24 11:02 popy2k14

Thank you that clarifies.

Lord-Grey avatar Feb 19 '24 18:02 Lord-Grey

Thanks. Looking forward to this, so the whole HA community can benefit from this.

popy2k14 avatar Feb 19 '24 18:02 popy2k14

Another benefit of going through Home Assistant is that you can use the RGB lights both with hyperion, and with any other automations you might have set up in Home Assistant

kuba-orlik avatar Feb 23 '24 14:02 kuba-orlik

As the author of the bridge I can say that most of the logic has been implemented here - but I assume in order to be part of Hyperion, that would have to be implemented in c++, right?

kuba-orlik avatar Feb 23 '24 14:02 kuba-orlik

Hello, I also find this project very useful and would be delighted if HA were implemented. It will expand the possibilities enormously.

satgit62 avatar Jul 05 '24 15:07 satgit62

@thueringer01 Da bist du hier total falsch. Hyperhdr ist ein anderes Repository.

Paulchen-Panther avatar Jul 09 '24 14:07 Paulchen-Panther

@thueringer01 Da bist du hier total falsch. Hyperhdr ist ein anderes Repository.

I think he uses HyperHDR, but for him, it's important that Hyperion takes the first step. He would use what the ZigBee lights support, just like I would.

satgit62 avatar Jul 09 '24 18:07 satgit62

Sorry that I'm in the wrong place. Yes, I use Hyperhdr and Homeassistant. I would like a bridge from Hyperhdr to Homeassistant. With Homeassistant I can then control all the lights.

thueringer01 avatar Jul 09 '24 18:07 thueringer01

I had a go to provide an initial implementation of a Home Assistant light feed. Steps to configure you find as part of PR #1763 Happy to receive feedback, if it work or where it can improve.

I have not implemented features like a configuration wizard nor saving/restoring light state, as I would like to first check, if you find it usable in general.

Lord-Grey avatar Jul 11 '24 15:07 Lord-Grey

@Lord-Grey thanks a lot for implementing this! I think everyone with homeassistant will appreciate this. Sadly, i just have hyprion.ng running in webos on my LG: https://github.com/webosbrew/hyperion.ng-webos-loader

Maybe @throwaway96 can provide an LG webos build to test this?

popy2k14 avatar Jul 11 '24 17:07 popy2k14

I have not implemented features like a configuration wizard nor saving/restoring light state, as I would like to first check, if you find it usable in general. @Lord-Grey Hello,

I have tried to trigger actions to test Home Assistant Branch. Apparently something is wrong, because the actions are not executed successfully and are aborted with errors. I then made a fork of their repositories and made the commits to be able to test the implementation of Home Assistant.
I also tried to build “hyperion.ng-webos-loader” for LG and took as reference the cloned repository with their commits. It was built including the new LED devices error free, however the daemon won't start on LG. I am grateful for any hint. Here is the log of build_hyperion_ng and build_ipk. build_hyperion_ng.txt build_ipk.txt

satgit62 avatar Jul 18 '24 18:07 satgit62

@satgit62 It might be best you check at the WebOS Discord. The core Hyperion team has no expertise on the WebOS.

Is there any output when Hyperion fails to start in the system logs?

PS: I merged the master into the HA branch, as there were some GitHub build related updates done. Hopes now the standard build does not fail any longer.

Lord-Grey avatar Jul 18 '24 19:07 Lord-Grey

@Lord-Grey Okay, thanks very much, will try with the standard build.

satgit62 avatar Jul 18 '24 19:07 satgit62

@Lord-Grey Hello, Thanks for the “Merge branch ‘Lord-Grey:master’ into master”. Now everything worked. I even built “org.webosbrew.hyperion.ng.loader” for webOS, and it works as expected. The daemon started right away, I can select the registered lamps in Home Assistant, and they are also controlled by Hyperion. Wow! This is a big upgrade for Hyperion. I will run more tests and get back to you. webOS Hyperion NG Homeassistant_info webOSHyperion NG Homeassistant_LED Controller

satgit62 avatar Jul 19 '24 15:07 satgit62

@satgit62 nice that you got it built for webos. Any chance to get it shared for testing?

popy2k14 avatar Jul 19 '24 15:07 popy2k14

Now everything worked @satgit62 That is great news!!!

Lord-Grey avatar Jul 19 '24 16:07 Lord-Grey

Now everything worked @satgit62 That is great news!!!

You could really build it into the master branch of https://github.com/hyperion-project. That will make a lot of home assistant users happy. Like I said, I'll do some testing over the weekend and let you know if everything works as it should.

satgit62 avatar Jul 19 '24 16:07 satgit62

Happy to have it merged, after the weekend and get further feedback. In case some of the default values should change from a practical point of view, happy to have those updated too. Have you tried to configure multiple HA Lights via one instance? Does that work too?

Lord-Grey avatar Jul 19 '24 18:07 Lord-Grey

Happy to have it merged, after the weekend and get further feedback. In case some of the default values should change from a practical point of view, happy to have those updated too. Have you tried to configure multiple HA Lights via one instance? Does that work too?

Yes, I have also tested with two simultaneous Home Assistant ID and also an additional instance to my SK6812 RGBW CW LEDs Stripe and it works. I use, as main Ambilight instance, Adalight on HyperSerialPico with “Adafruit Feather RP2040 SCORPIO” LED controller. I will also run tests with WLED on ESP 32 and HyperSerial on ESP32 S2 Mini wemos and report back.

satgit62 avatar Jul 19 '24 19:07 satgit62

@satgit62 with this Hyperion code version you can also run HyperSerial, as well as ftdi devices. Just give it a try….

Lord-Grey avatar Jul 19 '24 20:07 Lord-Grey

@satgit62 with this Hyperion code version you can also run HyperSerial, as well as ftdi devices. Just give it a try….

Yes, I know, and FTDI LED-Device also works perfectly. I tested the one from nurrik's build by heart back then. But this one is up-to-date. I will test HyperSerial next.

satgit62 avatar Jul 19 '24 21:07 satgit62

@satgit62 thanks for the new build. Sadly i am on vacation and i need some time until i can test it.

popy2k14 avatar Jul 20 '24 16:07 popy2k14

@satgit62 found some time, sadly your last build link is not working. Any chance to get a new one?

popy2k14 avatar Jul 22 '24 09:07 popy2k14

@satgit62 saw you did an dev pre release build here: https://github.com/satgit62/hyperion.ng-webos-loader/releases/ Is that the latest on which should be tested?

Edit: That seems to be th eold one:

Hyperion Server:
- Build:             (HEAD detached at 2.0.16) (Paulchen-Panther-cb85d2d7/a93d79ba-1705568419)
- Build time:        Feb  1 2024 02:44:21

popy2k14 avatar Jul 22 '24 09:07 popy2k14

P.s.: can i just reinstall the new ipk with "webos-dev-manager"? Because that's what i did?

P.S.P.S.: the ipk from here https://github.com/satgit62/hyperion.ng-webos-loader/releases/ does'nt work. hyperion deamon is just not starting. Reverted to the 2.0.16 from homebrew channel.

PLease let me know the test build, so i can test it.

thx

popy2k14 avatar Jul 22 '24 09:07 popy2k14

P.s.: can i just reinstall the new ipk with "webos-dev-manager"? Because that's what i did? P.S.P.S.: the ipk from here https://github.com/satgit62/hyperion.ng-webos-loader/releases/ does'nt work. hyperion deamon is just not starting. Reverted to the 2.0.16 from homebrew channel. PLease let me know the test build, so i can test it. thx

I realized it was the wrong link, but I wrote to them. Try this one: https://github.com/satgit62/hyperion.ng-webos-loader/releases/download/untagged-2e2cbbc119a19994cf4b/org.webosbrew.hyperion.ng.loader_0.1.11_all.zip

This link does'nt work for me, the message Not Found appears. Maybe the build just works for your github account when you logged in? Can you try the link in an private tab or other browser, when you not logged in?

thx

popy2k14 avatar Jul 22 '24 10:07 popy2k14

P.s.: can i just reinstall the new ipk with "webos-dev-manager"? Because that's what i did? P.S.P.S.: the ipk from here https://github.com/satgit62/hyperion.ng-webos-loader/releases/ does'nt work. hyperion deamon is just not starting. Reverted to the 2.0.16 from homebrew channel. PLease let me know the test build, so i can test it. thx

I realized it was the wrong link, but I wrote to them. Try this one: https://github.com/satgit62/hyperion.ng-webos-loader/releases/download/untagged-2e2cbbc119a19994cf4b/org.webosbrew.hyperion.ng.loader_0.1.11_all.zip

This link does'nt work for me, the message Not Found appears. Maybe the build just works for your github account when you logged in? Can you try the link in an private tab or other browser, when you not logged in?

thx

Have you logged in to GitHub?

satgit62 avatar Jul 22 '24 10:07 satgit62

Sure :-) I meant, maybe it's an permission issue, so your private untagged build can't be access from other users?

popy2k14 avatar Jul 22 '24 10:07 popy2k14