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

Use HomeKit Television service type #2

Open
wants to merge 6 commits into
base: master
Choose a base branch
from
Open

Conversation

arkku
Copy link

@arkku arkku commented Feb 8, 2020

This patch changes the service type to Television, which allows controlling the TV from the iPhone Control Center remote widget, including simulating remote control buttons (cursors, ok, back and two configurable buttons) and adjusting volume with the phone's physical volume buttons.

arkku added 6 commits February 8, 2020 17:30
This allows controlling the TV from the Control Center widget, including
simulating remote control key presses.
On my TV the WOL + powerstate does not suffice to wake it up from deep
sleep, but with ChromeCast wake-up enabled in settings, the ChromeCast
action helps. The configuration option is `has_chromecast`.
(For some reason the WoL with JavaScript doesn't work for me, but
running `/usr/sbin/etherwake` does, so it is now optionally supported.)
@MrDrache333
Copy link

MrDrache333 commented Mar 26, 2020

i allready use his configuration with 4 Philips TVs in my House. The only Problem is, that the TV Controls only work for one TV. You can turn the tv off and on and control Ambilight and Input Source via HomeKit, but direkt control via direction Buttons etc. are only visible and functional for one tv🙌

@arkku
Copy link
Author

arkku commented Mar 26, 2020

The only Problem is, that the TV Controls only work for one TV.

Yes, this affects all television type devices in Homekit. For whatever reason, only one TV from one homebridge instance is shown in the television remote widget. There is a workaround by using platform accessories, which makes installation a bit more complicated. I didn't bother to make that change for this plugin since it's not my codebase, I don't like the coding style, and I don't really know JavaScript that well, but I have done another similar plugin that does use platform accessories: https://github.com/arkku/homebridge-rotel-arkku/blob/master/index.js#L17

So, if someone wants to change this plugin accordingly, I can say that it will fix the issue. But perhaps it would be a good starting point for an entirely new Philips TV plugin, this one has been forked so many times that it's hard to even keep track which fork does what anymore.

@MrDrache333
Copy link

MrDrache333 commented Mar 26, 2020

Would it be hard for you to describe how to change it and leave an Example? We could also create another clean Repository and code it again or from a good starting point...many users wish this type of Feature cause Philips officially doesnt work on HomeKit Integration for its TV‘s...but with jointSpace there is clearly a way to do...

@arkku
Copy link
Author

arkku commented Mar 26, 2020

Would it be hard for you to describe how to change it and leave an Example?

Well, the devil is in the details, and I never found any good documentation on the topic so that I could say I fully understand it. However, by trial and error (which seems to be a common JavaScript development method), I think the following:

  1. Instead of homebridge.registerAccessory use homebridge.registerPlatform, with a new class as the platform class[1]
  2. In the platform class, create the instances of the (current) accessory class and publish them[2]
  3. When installing, the accessories will not be automatically added, so you need to view the HomeBridge logs and manually enter the codes into HomeKit

[1] https://github.com/arkku/homebridge-rotel-arkku/blob/master/index.js#L16-L17
[2] https://github.com/arkku/homebridge-rotel-arkku/blob/master/index.js#L38-L48

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants