jsiegenthaler / homebridge-samsungtvht

Homebridge plugin for Samsung TV (D5000 series) and Home Theater (D5500 series) from ca 2011.
MIT License
13 stars 1 forks source link

UE40H6400 - characteristic was supplied illegal value: null #2

Closed ChrisTav424 closed 2 years ago

ChrisTav424 commented 2 years ago

Describe Your Problem: I'm getting the error below on my Samsung UE40H6400 and I don't get a pin displayed on the TV. Is there anything I can do?

Logs:

18/09/2021, 00:14:52Samsungtvht BridgeERROR[Samsung TV FC09@Samsung TV@Active] characteristic was supplied illegal value: null! Home App will reject null for Apple defined characteristics
18/09/2021, 00:14:52Samsungtvht BridgeERROR[Samsung TV FC09@Samsung TV@Active] characteristic was supplied illegal value: null! Home App will reject null for Apple defined characteristics
18/09/2021, 00:14:57Samsungtvht Bridge starting
18/09/2021, 00:14:59Samsungtvht BridgeLoaded plugin 'homebridge-samsungtvht'
18/09/2021, 00:14:59Samsungtvht BridgeLoading 1 platforms...
18/09/2021, 00:14:59Samsungtvht BridgeSamsung TV HTWARNINGAPI event: didFinishLaunching
18/09/2021, 00:14:59Samsungtvht BridgeSamsung TV HTWARNINGconfig { doublePressTime: 250, pingResponseOn: 'received, 0% packet', devices: [ { infoButton: 'KEY_MENU', arrowDownButtonTripleTap: 'KEY_DOWN', arrowLeftButton: 'KEY_LEFT', selectButtonDoubleTap: 'KEY_SOURCE', arrowDownButton: 'KEY_DOWN', playPauseButtonDoubleTap: 'KEY_PAUSE', arrowUpButtonTripleTap: 'KEY_UP', muteButton: 'KEY_MUTE', ipAddress: '192.168.1.64', powerOffButton: 'KEY_POWEROFF', arrowUpButtonDoubleTap: 'KEY_CHUP', voldownButton: 'KEY_VOLDOWN', backButton: 'KEY_RETURN', manufacturer: 'Samsung', arrowRightButton: 'KEY_RIGHT', selectButtonTripleTap: 'KEY_HDMI', volupButton: 'KEY_VOL_UP', viewTvSettingsCommand: 'KEY_MENU', powerOnStartupTime: 4, infoButtonDoubleTap: 'KEY_INFO', arrowRightButtonTripleTap: 'KEY_RIGHT', arrowLeftButtonTripleTap: 'KEY_LEFT', type: 'television', playPauseButtonTripleTap: 'KEY_STOP', firmwareRevision: '2.0.24', backButtonDoubleTap: 'KEY_EXIT', infoButtonTripleTap: 'KEY_TOOLS', arrowRightButtonDoubleTap: 'KEY_FF', powerOnCommand: "echo 'on 0' | cec-client -s -d 1", arrowDownButtonDoubleTap: 'KEY_CHDOWN', playPauseButton: 'KEY_PLAY', arrowUpButton: 'KEY_UP', modelName: 'UE40H6400', arrowLeftButtonDoubleTap: 'KEY_REWIND', name: 'Samsung TV', selectButton: 'KEY_ENTER', serialNumber: '05f5e101', voldownButtonTriplePress: 'KEY_MUTE', backButtonTripleTap: 'KEY_RETURN' } ], pingResponseOff: 'received, 100% packet', name: 'Samsung TV HT', platform: 'samsungtvht', doublePressDelayTime: 300, debugLevel: 3, pingCommand: 'ping -c 1 -w 10', triplePressTime: 450 }
18/09/2021, 00:14:59Samsungtvht BridgeSamsung TV HTChecking devices found in config for homebridge-samsungtvht
18/09/2021, 00:14:59Samsungtvht BridgeSamsung TV HTLoading device 1: Samsung TV 192.168.1.64
18/09/2021, 00:14:59Samsungtvht BridgeSamsung TV HTWARNINGprepareAccessory
18/09/2021, 00:14:59Samsungtvht BridgeSamsung TV HTWARNINGprepareAccessoryInformationService
18/09/2021, 00:14:59Samsungtvht BridgeSamsung TV HTWARNINGprepareTelevisionService
18/09/2021, 00:14:59Samsungtvht BridgeSamsung TV HTWARNINGprepareTelevisionSpeakerService
18/09/2021, 00:14:59Samsungtvht BridgeSamsung TV HTWARNINGprepareInputSourceServices
18/09/2021, 00:14:59Samsungtvht BridgeSamsung TV HTWARNINGprepareInputSourceServices inputs undefined
18/09/2021, 00:14:59Samsungtvht BridgeSamsung TV FC09 is running on port 46525.
18/09/2021, 00:14:59Samsungtvht BridgeBridge is running on port 51826.
18/09/2021, 00:15:05Samsungtvht BridgeSamsung TV HTWARNINGSamsung TV: updateDeviceState: currentPowerState null, currentMediaState 2 [STOP], currentInputId 999 [undefined], currentSourceType undefined
18/09/2021, 00:15:05Samsungtvht BridgeSamsung TV HTSamsung TV: Power changed from 0 OFF to null undefined
18/09/2021, 00:15:05Samsungtvht BridgeERROR[Samsung TV FC09@Samsung TV@Active] characteristic was supplied illegal value: null! Home App will reject null for Apple defined characteristics

Plugin Config:

{
  "accessories" : [

  ],
  "platforms" : [
    {
      "debugLevel" : 3,
      "devices" : [
        {
          "arrowDownButton" : "KEY_DOWN",
          "arrowDownButtonDoubleTap" : "KEY_CHDOWN",
          "arrowDownButtonTripleTap" : "KEY_DOWN",
          "arrowLeftButton" : "KEY_LEFT",
          "arrowLeftButtonDoubleTap" : "KEY_REWIND",
          "arrowLeftButtonTripleTap" : "KEY_LEFT",
          "arrowRightButton" : "KEY_RIGHT",
          "arrowRightButtonDoubleTap" : "KEY_FF",
          "arrowRightButtonTripleTap" : "KEY_RIGHT",
          "arrowUpButton" : "KEY_UP",
          "arrowUpButtonDoubleTap" : "KEY_CHUP",
          "arrowUpButtonTripleTap" : "KEY_UP",
          "backButton" : "KEY_RETURN",
          "backButtonDoubleTap" : "KEY_EXIT",
          "backButtonTripleTap" : "KEY_RETURN",
          "firmwareRevision" : "2.0.24",
          "infoButton" : "KEY_MENU",
          "infoButtonDoubleTap" : "KEY_INFO",
          "infoButtonTripleTap" : "KEY_TOOLS",
          "ipAddress" : "192.168.1.64",
          "manufacturer" : "Samsung",
          "modelName" : "UE40H6400",
          "muteButton" : "KEY_MUTE",
          "name" : "Samsung TV",
          "playPauseButton" : "KEY_PLAY",
          "playPauseButtonDoubleTap" : "KEY_PAUSE",
          "playPauseButtonTripleTap" : "KEY_STOP",
          "powerOffButton" : "KEY_POWEROFF",
          "powerOnCommand" : "echo 'on 0' | cec-client -s -d 1",
          "powerOnStartupTime" : 4,
          "selectButton" : "KEY_ENTER",
          "selectButtonDoubleTap" : "KEY_SOURCE",
          "selectButtonTripleTap" : "KEY_HDMI",
          "serialNumber" : "05f5e101",
          "type" : "television",
          "viewTvSettingsCommand" : "KEY_MENU",
          "voldownButton" : "KEY_VOLDOWN",
          "voldownButtonTriplePress" : "KEY_MUTE",
          "volupButton" : "KEY_VOL_UP"
        }
      ],
      "doublePressDelayTime" : 300,
      "doublePressTime" : 250,
      "name" : "Samsung TV HT",
      "pingCommand" : "ping -c 1 -w 10",
      "pingResponseOff" : "received, 100% packet",
      "pingResponseOn" : "received, 0% packet",
      "platform" : "samsungtvht",
      "plugin_map" : {
        "plugin_name" : "homebridge-samsungtvht"
      },
      "triplePressTime" : 450
    }
  ]
}

Environment:

jsiegenthaler commented 2 years ago

Hi, thanks, I'll look at this. It's definitely bug on my side. Look out for a fix tomorrow.

ChrisTav424 commented 2 years ago

Thanks for the quick response! Really grateful, let me know if you need anything from me :)

jsiegenthaler commented 2 years ago

Hi, can you enable Homebridge in debug mode and send me the log? It will show more info as to what is happening during the startup sequence when the error is being thrown.

ChrisTav424 commented 2 years ago

I enabled debug in HOOBS and this is what it gave me, hope it helps :) Thanks again for helping with this

18/09/2021, 17:08:35Shutting down
18/09/2021, 17:08:35Samsungtv Control Bridge stopping
18/09/2021, 17:08:35Samsungtvht Bridge stopping
18/09/2021, 17:08:35Samsungtv 2014 Bridge stopping
18/09/2021, 17:08:35Broadlink Rm Pro Bridge stopping
18/09/2021, 17:08:35Samsungtvht BridgeSamsung TV HTWARNINGSamsung TV: updateDeviceState: currentPowerState 0, currentMediaState 2 [STOP], currentInputId 999 [undefined], currentSourceType undefined
18/09/2021, 17:08:40Stopped
18/09/2021, 17:09:00hub is running on port 80
18/09/2021, 17:09:01Samsungtvht Bridge starting
18/09/2021, 17:09:01Samsungtv Control Bridge starting
18/09/2021, 17:09:02Samsungtv 2014 Bridge starting
18/09/2021, 17:09:02Broadlink Rm Pro Bridge starting
18/09/2021, 17:09:03Samsungtvht BridgeInitializing HAP-NodeJS v0.9.4...
18/09/2021, 17:09:04Samsungtvht BridgeLoaded plugin 'homebridge-samsungtvht'
18/09/2021, 17:09:04Samsungtvht BridgeRegistering platform 'homebridge-samsungtvht.samsungtvht'
18/09/2021, 17:09:04Samsungtvht BridgeLoading 1 platforms...
18/09/2021, 17:09:04Samsungtvht BridgeSamsung TV HTWARNINGAPI event: didFinishLaunching
18/09/2021, 17:09:04Samsungtvht BridgeSamsung TV HTWARNINGconfig { doublePressTime: 250, pingResponseOn: 'received, 0% packet', devices: [ { infoButton: 'KEY_MENU', arrowDownButtonTripleTap: 'KEY_DOWN', arrowLeftButton: 'KEY_LEFT', selectButtonDoubleTap: 'KEY_SOURCE', arrowDownButton: 'KEY_DOWN', playPauseButtonDoubleTap: 'KEY_PAUSE', arrowUpButtonTripleTap: 'KEY_UP', muteButton: 'KEY_MUTE', ipAddress: '192.168.1.64', powerOffButton: 'KEY_POWEROFF', arrowUpButtonDoubleTap: 'KEY_CHUP', voldownButton: 'KEY_VOLDOWN', backButton: 'KEY_RETURN', manufacturer: 'Samsung', arrowRightButton: 'KEY_RIGHT', selectButtonTripleTap: 'KEY_HDMI', volupButton: 'KEY_VOL_UP', viewTvSettingsCommand: 'KEY_MENU', powerOnStartupTime: 4, infoButtonDoubleTap: 'KEY_INFO', arrowRightButtonTripleTap: 'KEY_RIGHT', arrowLeftButtonTripleTap: 'KEY_LEFT', type: 'television', playPauseButtonTripleTap: 'KEY_STOP', firmwareRevision: '2.0.24', backButtonDoubleTap: 'KEY_EXIT', infoButtonTripleTap: 'KEY_TOOLS', arrowRightButtonDoubleTap: 'KEY_FF', powerOnCommand: "echo 'on 0' | cec-client -s -d 1", arrowDownButtonDoubleTap: 'KEY_CHDOWN', playPauseButton: 'KEY_PLAY', arrowUpButton: 'KEY_UP', modelName: 'UE40H6400', arrowLeftButtonDoubleTap: 'KEY_REWIND', name: 'Samsung TV', selectButton: 'KEY_ENTER', serialNumber: '05f5e101', voldownButtonTriplePress: 'KEY_MUTE', backButtonTripleTap: 'KEY_RETURN' } ], pingResponseOff: 'received, 100% packet', name: 'Samsung TV HT', platform: 'samsungtvht', doublePressDelayTime: 300, debugLevel: 3, pingCommand: 'ping -c 1 -w 10', triplePressTime: 450 }
18/09/2021, 17:09:04Samsungtvht BridgeSamsung TV HTChecking devices found in config for homebridge-samsungtvht
18/09/2021, 17:09:04Samsungtvht BridgeSamsung TV HTLoading device 1: Samsung TV 192.168.1.64
18/09/2021, 17:09:04Samsungtvht BridgeSamsung TV HTWARNINGprepareAccessory
18/09/2021, 17:09:04Samsungtvht BridgeSamsung TV HTWARNINGprepareAccessoryInformationService
18/09/2021, 17:09:04Samsungtvht BridgeSamsung TV HTWARNINGprepareTelevisionService
18/09/2021, 17:09:04Samsungtvht BridgeSamsung TV HTWARNINGprepareTelevisionSpeakerService
18/09/2021, 17:09:04Samsungtvht BridgeSamsung TV HTWARNINGprepareInputSourceServices
18/09/2021, 17:09:04Samsungtvht BridgeSamsung TV HTWARNINGprepareInputSourceServices inputs undefined
18/09/2021, 17:09:05Samsungtvht BridgePreparing Advertiser for 'Samsung TV FC09' using bonjour-hap backend!
18/09/2021, 17:09:05Samsungtvht BridgePreparing Advertiser for 'Samsungtvht Bridge C12F' using bonjour-hap backend!
18/09/2021, 17:09:05Samsungtvht BridgeStarting to advertise 'Samsung TV FC09' using bonjour-hap backend!
18/09/2021, 17:09:05Samsungtvht BridgeSamsung TV FC09 is running on port 43443.
18/09/2021, 17:09:05Samsungtvht BridgeStarting to advertise 'Samsungtvht Bridge C12F' using bonjour-hap backend!
18/09/2021, 17:09:05Samsungtvht BridgeBridge is running on port 51826.
18/09/2021, 17:09:08Samsungtvht BridgeSamsung TV HTWARNINGSamsung TV: updateDeviceState: currentPowerState null, currentMediaState 2 [STOP], currentInputId 999 [undefined], currentSourceType undefined
18/09/2021, 17:09:08Samsungtvht BridgeSamsung TV HTSamsung TV: Power changed from 0 OFF to null undefined
18/09/2021, 17:09:08Samsungtvht BridgeERROR[Samsung TV FC09@Samsung TV@Active] characteristic was supplied illegal value: null! Home App will reject null for Apple defined characteristics
18/09/2021, 17:09:08Samsungtvht BridgeSamsung TV HTSamsung TV: Media state changed from 0 PLAY to 2 STOP
18/09/2021, 17:09:09Samsungtvht BridgeSamsung TV HTWARNINGSamsung TV: updateDeviceState: currentPowerState 1, currentMediaState 2 [STOP], currentInputId 999 [undefined], currentSourceType undefined
18/09/2021, 17:09:09Samsungtvht BridgeSamsung TV HTSamsung TV: Power changed from 0 OFF to 1 ON
18/09/2021, 17:09:11Samsungtvht BridgeSamsung TV HTWARNINGSamsung TV: updateDeviceState: currentPowerState 1, currentMediaState 2 [STOP], currentInputId 999 [undefined], currentSourceType undefined
18/09/2021, 17:09:13Samsungtvht BridgeSamsung TV HTWARNINGSamsung TV: updateDeviceState: currentPowerState 1, currentMediaState 2 [STOP], currentInputId 999 [undefined], currentSourceType undefined
18/09/2021, 17:09:15Samsungtvht BridgeSamsung TV HTWARNINGSamsung TV: updateDeviceState: currentPowerState 1, currentMediaState 2 [STOP], currentInputId 999 [undefined], currentSourceType undefined
jsiegenthaler commented 2 years ago

OK, I believe I know what is happening. I made the code more robust and pushed v0.0.6. Try it any let me know if the problem is cured.

huddx01 commented 2 years ago

@ChrisTav424 so you are not able to get the popup message on your TV during the "first pairing"? Right?

@jsiegenthaler The UE40H6400 maybe has another pairing method, with different ports as our D and E Models? I didnt checked this out exactly. But maybe a hint...

ChrisTav424 commented 2 years ago

@huddx01 Yes that's right. I can get it using a universal remote on my phone and I can get to 192.168.1.64:8001/api/v2/ successfully but don't get it from this plugin at the moment.

@jsiegenthaler I'm not home at the moment but will give the new code a try when I get home.

Thank you both :)

huddx01 commented 2 years ago

@ChrisTav424 Let us know... I think i can imagine what it could depend on, if it shouldn't work.

ChrisTav424 commented 2 years ago

It's not showing the update in HOOBS, I can see the latest version in git though. Is there a delay before it reaches the HOOBS plugin library?

I installed it manually using the following (showed as 0.0.6 in the log) but still get the same error which makes me think it hasn't installed properly.

sudo npm install -g homebridge-samsungtvht

FBB96DE8-134F-4658-A4F0-D9CE3CB6C2DB

jsiegenthaler commented 2 years ago

Hi. I do not have HOOBS and thus cannot say what HOOBS does or does not do, or how often HOOBS updates it's list of available packages or versions. On my Raspberry Pi and Homebridge, the new version shows up within about 10 seconds of publishing. The NPM repository is showing 0.0.6 as the current version: https://www.npmjs.com/package/homebridge-samsungtvht

But if you have installed it manually, then great.

To continue debugging your setup, please do this

  1. Set Homebridge to debug mode
  2. Ensure a samsungtvht debug line "debugLevel": 5, is present in the config. See my config example here: https://github.com/jsiegenthaler/homebridge-samsungtvht#configuration

Then reboot Homebridge, and send me the log. The log will have more debug entries, especially for the powerStateMonitor, which is where the problem lies I believe.

I need to see all the samsungtvht entries, but other entries and sensitive information can be removed.

Thanks

ChrisTav424 commented 2 years ago

I've installed homebridge today instead of HOOBS. Here is the full debug log. I tried powering on and off from HomeKit.

I've changed the password since running this :)

homebridge.log.txt

jsiegenthaler commented 2 years ago

All looks good, you just need to update Node:

[19/09/2021, 18:34:27] The plugin "homebridge-samsungtvht" requires Node.js version of >=14.17.6 which does not satisfy the current Node.js version of v14.17.4. You may need to upgrade your installation of Node.js - see https://git.io/JTKEF

ChrisTav424 commented 2 years ago

Great, have updated Node.js successfully.

AC72003A-26A9-452B-BD34-77B5F47EBEA0

Getting closer, but I still can't get the pin on the TV

homebridge.log.txt

jsiegenthaler commented 2 years ago

Ah. That is another issue. I was focused on solving the "UE40H6400 - characteristic was supplied illegal value: null " error!

I just went through the sequence to pair a new network remote to my Samsung D-5000 TV:

  1. First enable network remote control on the TV: Menu > Plug & Play > Network Remote Control > ON

  2. Ensure TV is connected to Ethernet LAN and you know it's IP address

  3. Ensure IP address is configured in the plugin

  4. Then turn on the TV, let the plugin detect the TV power-on state (wait for it to show the TV is on). This means the ping is working and the IP address is correct

  5. Then open the iOS Remote Control and tap any button to send a command.

  6. The TV will display New remote Node.JS S...(00:00:00:00) has been detected. Choose whether to use the remote control [ Allow ] [ Deny ]

Your TV menu options may be different if you have a different TV model to me. Just look for the network remote control setting.

jsiegenthaler commented 2 years ago

Does your H-series TV have Smart TV+ or Allshare? Where are you in the world?

ChrisTav424 commented 2 years ago

I'm in the UK. I don't have the Smart TV + streaming service but it does have apps like Netflix etc and I can control the tv using apps like "SamRemote".

I'll try removing it from HomeKit and attempt again but initially still get the same problem where it doesn't show the pin :(

Thanks again for your help with this!

jsiegenthaler commented 2 years ago

Hi @ChrisTav424

I am sure I have discovered the problem. The C, D, ES, EH and F series all have Network Remote Control and work without a PIN. The H-series requires a PIN for authentication. The samsung-remote that I use for the network remote control was designed for the Network Remote Control and does not support the PIN needed for the H series.

An alternative exists samsung-tv-control which appears to support legacy Samsung TVs (using Network Remote Control without PIN) and the newer TVs. I will experiment with this, but as I do not have an H-series TV, I would need your assistance.

I have opened issue https://github.com/jsiegenthaler/homebridge-samsungtvht/issues/3 to track the request for the H series

In the meantime, I will close this issue as the original problem has been fixed.