kiwi-cam/homebridge-broadlink-rm

For TV remote: add power on/off and mute functionality

Opened this issue · 3 comments

From the documentation, the only functionalities supported for the TV "remote" (accessible via the iphone/ipad remote app) are:

rewind, fastForward, nextTrack, previousTrack, arrowUp, arrowDown, arrowLeft, arrowRight, select, back, exit, playPause and info

However the GUI seems to support a power button and a mute button on that screen. Simply adding those fields to the "remote" portion of the JSON doesn't do the trick. Is the fix as simple as adding a few more lines to accessories\tv.js, specifically lines 246 onwards?

        let hexData = null;
        switch (newValue) {
          case Characteristic.RemoteKey.REWIND:
            hexData = data.remote.rewind; // not found yet
            break;
          case Characteristic.RemoteKey.FAST_FORWARD:
            hexData = data.remote.fastForward; // not found yet
            break;
          case Characteristic.RemoteKey.NEXT_TRACK:
            hexData = data.remote.nextTrack; // not found yet
            break;
          case Characteristic.RemoteKey.PREVIOUS_TRACK:
            hexData = data.remote.previousTrack; // not found yet
            break;
          case Characteristic.RemoteKey.ARROW_UP:
            hexData = data.remote.arrowUp;
            break;
          case Characteristic.RemoteKey.ARROW_DOWN:
            hexData = data.remote.arrowDown;
            break;
          case Characteristic.RemoteKey.ARROW_LEFT:
            hexData = data.remote.arrowLeft;
            break;
          case Characteristic.RemoteKey.ARROW_RIGHT:
            hexData = data.remote.arrowRight;
            break;
          case Characteristic.RemoteKey.SELECT:
            hexData = data.remote.select;
            break;
          case Characteristic.RemoteKey.BACK:
            hexData = data.remote.back;
            break;
          case Characteristic.RemoteKey.EXIT:
            hexData = data.remote.exit;
            break;
          case Characteristic.RemoteKey.PLAY_PAUSE:
            hexData = data.remote.playPause;
            break;
          case Characteristic.RemoteKey.INFORMATION:
            hexData = data.remote.info;
            break;
        }

Something like case Characteristic.RemoteKey.MUTE: hexData = data.remote.mute; break; or some such? (And equivalent for power?)

Also: the code above seems to indicate (correctly) that the remote program doesn't do anything with FF/RW/Next/Prev. I also don't see it doing anything with Exit at the moment.

See greyed out buttons in below image (circled in green). Can we get these working? A home-run would be some version that is state aware. But honestly who cares: a pure "mute toggle" would be fine, as would a "power toggle" (rather that "activate mute/deactivate mute" and "power on/power off".

IMG_3706FA33EEEA-1

I've been searching for how to implement this as well and would appreciate the added functionality. I believe the buttons are new additions with iOS 17 and should be easily implemented in the same fashion as the others like you described...

jat80 commented

Any update on this? Simple to implement.