g30r93g / homebridge-panasonic

A Homebridge plugin for Panasonic Viera TV's. Written to support the new Homekit TV accessory.
MIT License
21 stars 3 forks source link

TV Remote #12

Closed g30r93g closed 5 years ago

g30r93g commented 5 years ago

Turns off the TV before performing commands.

James712346 commented 5 years ago

found that m4recek/panasonic-viera-remote-control library uses different command to you

VieraTVRemote.COMMANDS = [
'NRC_POWER-ONOFF',      // power off only (on tested TV)

'NRC_MUTE-ONOFF',
'NRC_AD_CHANGE-ONOFF',  // dvbt input change
'NRC_CHG_INPUT-ONOFF',  // hdmi input change

'NRC_VOLDOWN-ONOFF',    // separate ON and OFF commands exists, can be used instead repeating ONOFF
'NRC_VOLDOWN-ON',
'NRC_VOLDOWN-OFF',
'NRC_VOLUP-ONOFF',      // separate ON and OFF commands exists, can be used instead repeating ONOFF
'NRC_VOLUP-ON',
'NRC_VOLUP-OFF',

'NRC_CH_DOWN-ONOFF',
'NRC_CH_UP-ONOFF',

'NRC_APPS-ONOFF',
'NRC_HOME-ONOFF',
'NRC_CANCEL-ONOFF',     // exit button

'NRC_RIGHT-ONOFF',      // separate ON and OFF commands exists, can be used instead repeating ONOFF
'NRC_RIGHT-ON',
'NRC_RIGHT-OFF',

'NRC_LEFT-ONOFF',       // separate ON and OFF commands exists, can be used instead repeating ONOFF
'NRC_LEFT-ON',
'NRC_LEFT-OFF',

'NRC_DOWN-ONOFF',       // separate ON and OFF commands exists, can be used instead repeating ONOFF
'NRC_DOWN-ON',
'NRC_DOWN-OFF',

'NRC_UP-ONOFF',         // separate ON and OFF commands exists, can be used instead repeating ONOFF
'NRC_UP-ON',
'NRC_UP-OFF',

'NRC_ENTER-ONOFF',      // ok button
'NRC_RETURN-ONOFF',
'NRC_SUBMENU-ONOFF',    // options button

'NRC_3D-ONOFF',
'NRC_DISP_MODE-ONOFF',  // aspect button
'NRC_MENU-ONOFF',
'NRC_EPG-ONOFF',        // guide button
'NRC_TEXT-ONOFF',
'NRC_STTL-ONOFF',
'NRC_INFO-ONOFF',
'NRC_GUIDE-ONOFF',      // e-help button

'NRC_D1-ONOFF',
'NRC_D2-ONOFF',
'NRC_D3-ONOFF',
'NRC_D4-ONOFF',
'NRC_D5-ONOFF',
'NRC_D6-ONOFF',
'NRC_D7-ONOFF',
'NRC_D8-ONOFF',
'NRC_D9-ONOFF',
'NRC_D0-ONOFF',
'NRC_R_TUNE-ONOFF',     // last view button

'NRC_BLUE-ONOFF',       // quick commands and teletext controls (based on context)
'NRC_YELLOW-ONOFF',
'NRC_GREEN-ONOFF',
'NRC_RED-ONOFF',

'NRC_REW-ONOFF',
'NRC_PLAY-ONOFF',
'NRC_FF-ONOFF',
'NRC_SKIP_PREV-ONOFF',
'NRC_PAUSE-ONOFF',
'NRC_SKIP_NEXT-ONOFF',
'NRC_STOP-ONOFF',
'NRC_REC-ONOFF'
'];

could this be the problem?

James712346 commented 5 years ago

I also tried these command on postman and they all work with my TV image image

muenzpraeger commented 5 years ago

@James712346 The viera.js package that's used here uses the same codes as you referenced above. The implementation is simplified though.

g30r93g commented 5 years ago

Hi there. I’ve seen many other commands that have the same behaviour. If the existing command doesn’t work for you but the commands via Postman do, then please respond here so I can look into how to solving this. Many thanks!

muenzpraeger commented 5 years ago

The issue is that after the remoteKey call immediately setOn is called. As it's not in your code I'm wondering if that's intentionally (by HomeKit), and you'd need some other logic or state management.

muenzpraeger commented 5 years ago

@g30r93g The behavior also exists with iOS 13, just FYI.

muenzpraeger commented 5 years ago

@g30r93g The last iOS 13 beta fixed everything. Works fine!

g30r93g commented 5 years ago

Great to hear! Do open this up if it stops again.