louis49 / homebridge-plugin-androidtv

MIT License
23 stars 12 forks source link

TCL TV Keeps Waking and Going to Sleep #60

Open JaceMayer opened 5 months ago

JaceMayer commented 5 months ago

I seem to be encountering a couple of issues with this plugin,

  1. When my TV goes into sleep with this running, it enters a loop of going into sleep, and briefly waking up when the connection with the plugin timeout.
  2. When it reconnects, the plugin tries to add a new TV to homebridge with the same UUID, causing it to crash

[5/12/2024, 2:25:54 AM] [homebridge-androidtv] Finding online device : Bedroom TV 192.168.2.12 6466 Start Remote Connect 192.168.2.12 Remote secureConnect 192.168.2.12 Receive : {"remoteConfigure":{"code1":639,"deviceInfo":{"model":"Smart TV","vendor":"TCL","unknown1":1,"unknown2":"11","packageName":"com.google.android.tv.remote.service","appVersion":"5.2.473254133"}}} Create Remote {"remoteConfigure":{"code1":622,"deviceInfo":{"model":"Mac","vendor":"Apple Inc.","unknown1":1,"unknown2":"1","packageName":"androitv-remote","appVersion":"1.0.0"}}} Sending {"remoteConfigure":{"code1":622,"deviceInfo":{"model":"Mac","vendor":"Apple Inc.","unknown1":1,"unknown2":"1","packageName":"androitv-remote","appVersion":"1.0.0"}}} [5/12/2024, 2:25:55 AM] [homebridge-androidtv] Discover : { host: '192.168.2.12', name: 'Bedroom TV', paired: true, pairing: false, powered: false, online: true, started: true, volume_max: 0, volume_current: 0, volume_muted: false, app_package_current: '', type: 31 } [5/12/2024, 2:25:55 AM] [homebridge-androidtv] Bedroom TV Registering device 2993950a-6fdf-43c0-ad57-9a417b27289a [5/12/2024, 2:25:55 AM] [homebridge-androidtv] Bedroom TV Adding key Power 97d4d76f-24d9-4f89-8fb4-a4f0069961ee [5/12/2024, 2:25:55 AM] [homebridge-androidtv] Bedroom TV Adding key HDMI 1 9ac01923-ec1f-4bf4-a9df-098f1169af34 [5/12/2024, 2:25:55 AM] [homebridge-androidtv] Bedroom TV Adding key Sleep d2ca8fb0-bd48-4581-93a2-520794db5333 [5/12/2024, 2:25:55 AM] [homebridge-androidtv] Bedroom TV Adding key Wake 5003731e-467b-4917-b194-8a41e6673dd1 192.168.2.12 Receive : {"remoteSetActive":{}} Create Remote {"remoteSetActive":{"active":622}} Sending {"remoteSetActive":{"active":622}} [5/12/2024, 2:25:55 AM] Bedroom TV 8AEE is running on port 63631. [5/12/2024, 2:25:55 AM] Please add [Bedroom TV 8AEE] manually in Home app. Setup Code: 911-65-106 192.168.2.12 Receive : {"remoteSetVolumeLevel":{"unknown1":18,"unknown2":4,"playerModel":"Smart TV","unknown4":2,"unknown5":0,"volumeMax":100,"volumeLevel":58,"volumeMuted":true}} [5/12/2024, 2:25:55 AM] [homebridge-androidtv] Bedroom TV Device set Volume 58 [5/12/2024, 2:25:55 AM] [homebridge-androidtv] Bedroom TV Device set mute true 192.168.2.12 Receive : {"remoteStart":{"started":false}} [5/12/2024, 2:25:55 AM] [homebridge-androidtv] Bedroom TV powered false 192.168.2.12 Receive : {"remoteImeKeyInject":{"appInfo":{"appPackage":"com.spocky.projengmenu"}}} 192.168.2.12 Receive : {"remoteImeKeyInject":{"appInfo":{"appPackage":"com.spocky.projengmenu"}}} [5/12/2024, 2:25:57 AM] [homebridge-androidtv] Bedroom TV get Active false [5/12/2024, 2:25:57 AM] [homebridge-androidtv] Bedroom TV get VolumeMutedSelector [5/12/2024, 2:25:57 AM] [homebridge-androidtv] Bedroom TV get VolumeSelector 58 [5/12/2024, 2:26:01 AM] [homebridge-androidtv] Bedroom TV get Active false [5/12/2024, 2:26:02 AM] [homebridge-androidtv] Bedroom TV set Active => setNewValue: 1 Create Remote {"remoteKeyInject":{"keyCode":26,"direction":3}} Sending {"remoteKeyInject":{"keyCode":"KEYCODE_POWER","direction":"SHORT"}} [5/12/2024, 2:26:03 AM] [homebridge-androidtv] Bedroom TV get Active false 192.168.2.12 Receive : {"remoteSetVolumeLevel":{"unknown1":18,"unknown2":4,"playerModel":"Smart TV","unknown4":2,"unknown5":0,"volumeMax":100,"volumeLevel":58,"volumeMuted":false}} [5/12/2024, 2:26:04 AM] [homebridge-androidtv] Bedroom TV Device set mute false 192.168.2.12 Receive : {"remoteStart":{"started":true}} [5/12/2024, 2:26:05 AM] [homebridge-androidtv] Bedroom TV powered true Create Remote {"remoteKeyInject":{"keyCode":26,"direction":3}} Sending {"remoteKeyInject":{"keyCode":"KEYCODE_POWER","direction":"SHORT"}} 192.168.2.12 Receive : {"remoteStart":{"started":false}} [5/12/2024, 2:26:55 AM] [homebridge-androidtv] Bedroom TV powered false 192.168.2.12 Receive : {"remoteSetVolumeLevel":{"unknown1":18,"unknown2":4,"playerModel":"Smart TV","unknown4":2,"unknown5":0,"volumeMax":100,"volumeLevel":58,"volumeMuted":true}} [5/12/2024, 2:26:55 AM] [homebridge-androidtv] Bedroom TV Device set mute true timeout 192.168.2.12 Remote Connection closed false Start Remote Connect 192.168.2.12 Remote secureConnect 192.168.2.12 Receive : {"remoteConfigure":{"code1":639,"deviceInfo":{"model":"Smart TV","vendor":"TCL","unknown1":1,"unknown2":"11","packageName":"com.google.android.tv.remote.service","appVersion":"5.2.473254133"}}} Create Remote {"remoteConfigure":{"code1":622,"deviceInfo":{"model":"Mac","vendor":"Apple Inc.","unknown1":1,"unknown2":"1","packageName":"androitv-remote","appVersion":"1.0.0"}}} Sending {"remoteConfigure":{"code1":622,"deviceInfo":{"model":"Mac","vendor":"Apple Inc.","unknown1":1,"unknown2":"1","packageName":"androitv-remote","appVersion":"1.0.0"}}} [5/12/2024, 2:27:21 AM] [homebridge-androidtv] Discover : { host: '192.168.2.12', name: 'Bedroom TV', paired: true, pairing: false, powered: false, online: true, started: true, volume_max: 100, volume_current: 58, volume_muted: true, app_package_current: '', type: 31 } [5/12/2024, 2:27:21 AM] [homebridge-androidtv] Bedroom TV Registering device 2993950a-6fdf-43c0-ad57-9a417b27289a [5/12/2024, 2:27:21 AM] [homebridge-androidtv] Bedroom TV Adding key Power 97d4d76f-24d9-4f89-8fb4-a4f0069961ee [5/12/2024, 2:27:21 AM] [homebridge-androidtv] Bedroom TV Adding key HDMI 1 9ac01923-ec1f-4bf4-a9df-098f1169af34 [5/12/2024, 2:27:21 AM] [homebridge-androidtv] Bedroom TV Adding key Sleep d2ca8fb0-bd48-4581-93a2-520794db5333 [5/12/2024, 2:27:21 AM] [homebridge-androidtv] Bedroom TV Adding key Wake 5003731e-467b-4917-b194-8a41e6673dd1 192.168.2.12 Receive : {"remoteSetActive":{}} Create Remote {"remoteSetActive":{"active":622}} Sending {"remoteSetActive":{"active":622}} Error: Accessory Bedroom TV experienced an address collision. at BridgeService.handlePublishExternalAccessories (/usr/local/lib/node_modules/homebridge/src/bridgeService.ts:419:15) at processTicksAndRejections (node:internal/process/task_queues:95:5)

aayushbhatia06 commented 2 months ago

Ever figure it out ?