openhab / openhab-addons

Add-ons for openHAB
https://www.openhab.org/
Eclipse Public License 2.0
1.86k stars 3.58k forks source link

[hue] Add Hue Sync Box #10218

Open WhiteSockedDancer opened 3 years ago

WhiteSockedDancer commented 3 years ago

Hey, is there any way to integrate a Hue Sync Box into this Binding? It would be great if we could control Input-Sources, Sync, Mode and so on over OH :)

https://www.philips-hue.com/de-de/p/hue-play-hdmi-sync-box/8718699704803#features

Greetings

openhab-bot commented 3 years ago

This issue has been mentioned on openHAB Community. There might be relevant details there:

https://community.openhab.org/t/philips-hdmi-sync-api/111679/2

openhab-bot commented 7 months ago

This issue has been mentioned on openHAB Community. There might be relevant details there:

https://community.openhab.org/t/philips-hdmi-sync-api/111679/30

pgfeller commented 7 months ago

I'll have a look into the work done by Homey-GER in https://github.com/Homey-GER/openhab-addons to see if I can create an official binding based on his code. According to the Philips Developer Documentation the HDMI Bridge is discoverable by mDNS Hue HDMI Sync Box API - which would nicely fit with the new binding proposal mechanism of openHAB 4. Also the API seems well documented.

However - assuming I'm able to create a working binding, I'll not have the resources to be an official maintainer of a binding ...

I'll use this issue to post progress (if there's any 🙂) and to get feedback etc. If this is the wrong place to do this (e.g. the discussion feature, or the forum shall be used for this), please let me know.

pgfeller commented 6 months ago
lolodomo commented 6 months ago

Isn't it possible to simply enhance the existing hue binding ?

pgfeller commented 6 months ago

@lolodomo

I was surprised, that the hue binding did not recognize the device - so searched the forum and found the stand alone binding. According to Andrew (@andrewfg) - one of the maintainers of the hue binding an integration does not make sense: https://community.openhab.org/t/philips-hdmi-sync-api/111679/31?u=patrik_gfeller

@cweitkamp: Do you agree with Andrew's assessment?

I had a look at the hue binding: It already supports different API versions and devices - and to add another API would make it more difficult to understand the code and maintenance. The HDMI device has its own API:

The Philips Hue HDMI Sync Box lets you sync your Hue lights with your HDMI based TV content, by placing it in between your TV and a maximum of 4 HDMI sources. It can be controlled through a HTTP JSON API much like the Hue Bridge. [Hue HDMI Sync Box API]

The code I'm writing is mainly based on https://github.com/Homey-GER/openhab-addons implementation - but I do kind of a re-implementation based on that code and the things I see in the hue binding. The main motivation for the implementation is to have it for my own use - I'll do bug fixing as long as I use the device myself; but will not add myself as a maintainer (from my experience with the iCloud binding I know that I do not have enough time to do this properly). I also expect discussions during the review of the PR regarding the missing unit tests 😉 ... but we're not there - I take it easy and with all the other projects and real life things it will take time until I'm that far.

➡️ Yes - it is technically possible to integrate it to the hue binding - but I share the opinion of Andrew that it does not make sense. Let's see if Christoph has a different opinion.

andrewfg commented 6 months ago

The Hue Sync box is a completely different piece of hardware than the Hue Bridge. It intercepts an HDMI stream, and sends entertainment based commands to a Hue Bridge to control the lighting. There are two different boxes on the LAN each with their own IP addresses and own APIs. The Hue Sync box has a W-LAN interface on one IP address that supports one API for setting the entertainment functions. The Hue Bridge has its own LAN interface on another IP address that supports two APIs for direct lighting control. The Hue Bridge does have a couple of API endpoints for 'entertainment' however these are NOT for commanding the Hue Sync Box functionality but rather (potentially) for setting up how the Hue Bridge responds to commands received from the Hue Sync Box. -- EDIT: the 'entertainment' end-points are probably special dedicated endpoints that the Hue Sync Box uses to talk with the Hue Bridge.

TLDR these are two completely different: physical hardware / IP addresses / software interfaces => there is NO point in trying to incorporate the Hue Sync Box functionality in the Hue Bridge binding. It requires a complete new binding!

https://youtu.be/txCWk0AIgN8?si=Yk36aAJ0OxPg0nMV

pgfeller commented 6 months ago