Skip to content
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

Add Home Assistant Lights support #1763

Merged
merged 14 commits into from
Aug 25, 2024

Conversation

Lord-Grey
Copy link
Collaborator

@Lord-Grey Lord-Grey commented Jul 10, 2024

Summary

  • Add Home Assistant Lights support

A list of HA Lights can be mapped to one layout area currently.
For another capture areas an additional instance would be required.

It is recommended to set the latchtime to ensure that a certain time passes between two updates.
The solution cannot run with high fps and should only used for solitary lights, i.e. not the main ones.

Configure the device

  1. In preparation, create a Long-lived access token in Home Assistant
  2. Select Controller Type: homeassistant
  3. Hyperion tries to find your Home Assistant server. If not provide a custom hostname or IP-address
    4.Put the long lived token generated before in "Authorization Token"
  4. Select your HA light(s) from the list
  5. You might do "identify" to check, if the provided light light up
  6. Set the LED position in the layout using the wizard
  7. Save

See the screenshot below for reference

What kind of change does this PR introduce? (check at least one)

  • Bugfix
  • Feature
  • Code style update
  • Refactor
  • Docs
  • Build-related changes
  • Other, please describe:

If changing the UI of web configuration, please provide the before/after screenshot:

Screen in default settings mode
image

Screen in Expert settings mode
image

Does this PR introduce a breaking change? (check one)

  • Yes
  • No

If yes, please describe the impact and migration path for existing setups:

The PR fulfills these requirements:

  • When resolving a specific issue, it's referenced in the PR's body (e.g. Fixes: #xxx[,#xxx], where "xxx" is the issue number)

If adding a new feature, the PR's description includes:

  • A convincing reason for adding this feature
  • Related documents have been updated (docs/docs/en)
  • Related tests have been updated

PLEASE DON'T FORGET TO ADD YOUR CHANGES TO CHANGELOG.MD

  • Yes, CHANGELOG.md is also updated

To avoid wasting your time, it's best to open a feature request issue first and wait for approval before working on it.

Other information:

Fixes #1703

@satgit62
Copy link

satgit62 commented Jul 21, 2024

@Lord-Grey

Hello,

Took the time to test the new “HomeAssistant” build.
I took the build branch from @Lord-Grey as a reference and built it for LG webOS. It worked right away and after the daemon start I got busy with the “HomeAssistant” LED controller in HyperHDR.

My short conclusion:

I can select all the lamps I have set up in Home Assistant and set them up in an instance. I have added another instance to an existing Ambilight instance of HyperHDR on “adalight” LED controllers with HyperSerial and set up two Home Assistant IDs. You can specify in the LED layout which position the lamps should have.
I also configured two additional instances for left and right. This also worked wonderfully.

I only have a simple Hue Bridge for the ZigBee lamps and via this, I have also integrated the Hue and other ZigBee compatible lamps into my Home Assistant.
This could cause a delay. With a short update interval and low FPS, the delay is kept within limits, and you won't be bothered by it. I don't know how this behaves with a real USB ZigBee Bridge. You also have to see whether you can address the lamps in Home Assistant via the entertainment area of the HUE so that the latency is reduced.

In any case, it is a super addition to the already extensive LED control of the Hyperion.NG. I hope @popy2k14 and other supporters will also test this project and share their experiences.
I'm also looking forward to completing the implementation and hope for further development. Many thanks again to @Lord-Grey for the quick implementation.

About Hyperion
Hyperion NG Controller 1_adalight
Hyperion NG Controller Homeassistant
About Hyperion

@Lord-Grey
Copy link
Collaborator Author

@satgit62 Just note, that currently the HA Light IDs will map only to the first LED in the layout.
Your screenshot indicates that you assume that ID1 will map to layout LED 0 and ID2 maps to layout LED 1.

@satgit62
Copy link

@satgit62 Just note, that currently the HA Light IDs will map only to the first LED in the layout. Your screenshot indicates that you assume that ID1 will map to layout LED 0 and ID2 maps to layout LED 1.

Yes, I know that, I found out.
I just wanted to see if two lamps can register at once under one instance.
But I also made separate instances and that works with the mapping, only I didn't take a screenshot of it.

@Lord-Grey
Copy link
Collaborator Author

Yes, the current way gives most flexibility.
You can have multiple lights for one instance and you can have many instances.

@eporsche
Copy link

@Lord-Grey

I would like to test your PR - however when I issue the command:
wget -qO- https://raw.githubusercontent.com/hyperion-project/hyperion.ng/master/bin/scripts/install_pr.sh | bash -s -- -t github_token -c ~/.hyperion 1763

I get this:
---> Download package for identified runtime architecture: arm64 and Qt6
---> The specified PR #1763 has no longer any artifacts.
---> It may be older than 14 days. Ask the PR creator to recreate the artifacts at the following URL:
---> #1763

Would you mind recreating the artifacts? Thank you very much! 😄

@Paulchen-Panther
Copy link
Member

Would you mind recreating the artifacts? Thank you very much! 😄

https://github.com/hyperion-project/hyperion.ng/actions/runs/9997312040?pr=1763

Once the workflow is complete, the artifacts should be available again.

@eporsche
Copy link

Installation worked - thank you!

@kylewhirl
Copy link

How do I install this on Hyperbian?

@eporsche
Copy link

@kylewhirl I followed this: https://docs.hyperion-project.org/user/advanced/Testing.html
However the first time I tried it - it overpowered my zigbee2mqtt / mosquitto server with requests - I need to play with the settings.

assets/webconfig/js/content_leds.js Fixed Show fixed Hide fixed
assets/webconfig/js/content_leds.js Fixed Show fixed Hide fixed
assets/webconfig/js/content_leds.js Fixed Show fixed Hide fixed
assets/webconfig/js/wizard.js Fixed Show fixed Hide fixed
@Lord-Grey Lord-Grey merged commit 4f1b95e into hyperion-project:master Aug 25, 2024
18 checks passed
@popy2k14
Copy link

popy2k14 commented Sep 1, 2024

Guys, thanks for your efforts and sorry that i found not more time to test this.

@Lord-Grey
Copy link
Collaborator Author

@popy2k14 You can still do testing and provide feedback, even the PR was merged. 😃

@popy2k14
Copy link

@Lord-Grey i will, but dont know when i find time

@Lord-Grey Lord-Grey deleted the HomeAssistant branch September 30, 2024 20:06
@Kesp92
Copy link

Kesp92 commented Nov 14, 2024

Hi there @Lord-Grey
i just installed, Hyperion Ng in docker with the following file https://hub.docker.com/r/foorschtbar/hyperion .
But i got the Problem that the controlType homeassistant isn't shown any ideas?

@Lord-Grey
Copy link
Collaborator Author

You need to install the nightly build

@Pichuhoehle
Copy link

@Lord-Grey Is there any docker image, which has the nightly/dev builds?

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
Status: Done
Development

Successfully merging this pull request may close these issues.

Add Home Assistant support
8 participants