homebridge-vieramatic icon indicating copy to clipboard operation
homebridge-vieramatic copied to clipboard

Add new feature to include a custom command config to turn old TV on

Open CyberMrProper opened this issue 2 years ago • 2 comments

I have an old Panasonic TV that does not have wake on lan functionality. Once the TV is turned on (with the physical remote), the plugin works flawless. Given that I have an IR blaster, it would be great if this plugin could include a fallback mechanism to execute a command line script if "turns on" fails.

[Panasonic TV] (setPowerStatus)/-> ON - unable to power cycle TV - unpowered ?

Then run command line from config.

CyberMrProper avatar Nov 02 '22 19:11 CyberMrProper

var exec = require('child_process').exec;

In here https://github.com/AntonioMeireles/homebridge-vieramatic/blob/b40d36488e5cdd8e2c096f9b0601d351da6785af/src/accessory.ts#L433

it could be something like:

else if (nextState === this.Characteristic.Active.ACTIVE && this.userConfig.customTurnOnCommand){ exec(this.userConfig.customTurnOnCommand); await sleep(1000) await this.updateTVstatus(nextState) }

@AntonioMeireles thoughts?

CyberMrProper avatar Nov 03 '22 14:11 CyberMrProper

i was just thinking the same thing, would be a cool feature.

I can turn on the tv indirectly via a URL. (Enigma2 STB -> turns TV ON)

zobe123 avatar Nov 25 '22 10:11 zobe123