AntonioMeireles / homebridge-vieramatic

Homebridge plugin for Panasonic™ Viera™ TVs (includes support for 2018 and later models)
Apache License 2.0
43 stars 9 forks source link

TV show as off when it is on #93

Closed AkAPerryAkA closed 2 years ago

AkAPerryAkA commented 2 years ago

Describe your issue

When setting up the TV i had some trouble using the gui wizard because it failed with "The Viera TV at 192.168.1.112 could not be edited.". I got it in with adding the json config manually with ip;

{
    "platform": "PanasonicVieraTV",
    "name": "PanasonicVieraTV",
    "tvs": [
        {
            "friendlyName": "Living Room TV",
            "ipAddress": "192.168.1.112",
            "mac": "8c:c1:21:9f:3a:3a",
            "customVolumeSlider": false,
            "hdmiInputs": [
                {
                    "id": "1",
                    "name": "HDMI 1"
                },
                {
                    "id": "2",
                    "name": "HDMI 2"
                },
                {
                    "id": "3",
                    "name": "Onkyo"
                }
            ]
        }
    ]
}

I later added the mac, customVolumeSlider and hdmiInputs too see if it made any difference. After this the homebridge gives me only good feedback from the plugin:

[1/25/2022, 2:37:49 PM] [PanasonicVieraTV] Initializing PanasonicVieraTV platform...
[1/25/2022, 2:37:49 PM] Loading 2 accessories...
[1/25/2022, 2:37:49 PM] [PanasonicVieraTV] handling '192.168.1.112' from config.json
[1/25/2022, 2:37:50 PM] [PanasonicVieraTV] found a 'Panasonic VIErA' TV (ET60) at '192.168.1.112' .
[1/25/2022, 2:37:50 PM] [PanasonicVieraTV] successfully loaded Living Room TV
[1/25/2022, 2:37:50 PM] Living Room TV BC04 is running on port 52429.
[1/25/2022, 2:37:50 PM] Please add [Living Room TV BC04] manually in Home app. Setup Code: XXX-XX-XXX

Then when i add it to the Home it appears as "Off", but i can still control it with the built inn apple remote on my phone by selecting the TV. Also when i go inn to the TV icon on Home and press the "View Settings TV" it opens the settings on the TV. I can also see all the apps the TV has available under inputs. When i press the TV to turn it on it spins with the loading icon for about 4 seconds and goes back to Off state 2 seconds later.

Issue Context

  1. the homebridge logs, up from starting until the bug popped up there.
    [1/25/2022, 2:37:49 PM] [PanasonicVieraTV] Initializing PanasonicVieraTV platform...
    [1/25/2022, 2:37:49 PM] Loading 2 accessories...
    [1/25/2022, 2:37:49 PM] [PanasonicVieraTV] handling '192.168.1.112' from config.json
    [1/25/2022, 2:37:50 PM] [PanasonicVieraTV] found a 'Panasonic VIErA' TV (ET60) at '192.168.1.112' .
    [1/25/2022, 2:37:50 PM] [PanasonicVieraTV] successfully loaded Living Room TV
    [1/25/2022, 2:37:50 PM] Living Room TV BC04 is running on port 52429.
    [1/25/2022, 2:37:50 PM] Please add [Living Room TV BC04] manually in Home app. Setup Code: XXX-XX-XXX
  2. your homebridge's config.json contents.
    {
    "platform": "PanasonicVieraTV",
    "name": "PanasonicVieraTV",
    "tvs": [
        {
            "friendlyName": "Living Room TV",
            "ipAddress": "192.168.1.112",
            "mac": "8c:c1:21:9f:3a:3a",
            "customVolumeSlider": false,
            "hdmiInputs": [
                {
                    "id": "1",
                    "name": "HDMI 1"
                },
                {
                    "id": "2",
                    "name": "HDMI 2"
                },
                {
                    "id": "3",
                    "name": "Onkyo"
                }
            ]
        }
    ]
    }
  3. the contents of accessories/vieramatic.json (path is relative to homebridge's datadir)
    {"4D454930-0200-1000-8001-8CC1219F3A3A":{"data":{"inputs":{"applications":{"0":{"id":"0387878700000016","name":"VIERA Link","hidden":0},"1":{"id":"0387878700000032","name":"Media Player","hidden":0},"2":{"id":"0387878700000014","name":"Media Server","hidden":0},"3":{"id":"0077777700000002","name":"Web Browser","hidden":0},"4":{"id":"0387878700000009","name":"Main Menu","hidden":0},"5":{"id":"0387878700000003","name":"TV Guide","hidden":0},"6":{"id":"0387878700000001","name":"TV","hidden":0},"7":{"id":"0010000200000001","name":"Netflix","hidden":0},"8":{"id":"0020004400000001","name":"Viaplay","hidden":0},"9":{"id":"0020007100000001","name":"Meteonews TV"},"10":{"id":"0020001000000001","name":"euronews"},"11":{"id":"0010001000000001","name":"Dailymotion"},"12":{"id":"0020000600000001","name":"ARTE"},"13":{"id":"0070000400000001","name":"SHOUTcast Radio"},"14":{"id":"0070001000000001","name":"PlayJam"},"15":{"id":"0070000E00000004","name":"Chess Challenge"}},"hdmi":[{"id":"1","name":"HDMI 1"},{"id":"2","name":"HDMI 2"},{"id":"3","name":"Onkyo"}],"TUNER":{"hidden":0}},"ipAddress":"192.168.1.112","specs":{"friendlyName":"Living Room TV","manufacturer":"Panasonic","modelName":"Panasonic VIErA","modelNumber":"ET60","requiresEncryption":false,"serialNumber":"4D454930-0200-1000-8001-8CC1219F3A3A"}}}}
  4. Details about your specific homebridge setup
    • hardware and arch Running on a custom built PC with x64 arch.
    • Operating System and its version Windows 10
    • NodeJS version v16.13.2
    • Homebridge version v1.4.0
    • specific vieramatic version being used homebridge-vieramatic v4.0.21
    • Viera TV(s) model(s) being used (and connectivity type being used - wired or wireless) Panasonic VIErA TV (ET60) with wired connection
  5. anything else you may find relevant I have looked on other post and have double checked sometings allready: I can ping the TV when it is on for the homebridge server. Running the command "curl -Lsk http://192.168.1.112:55000/nrc/ddd.xml" reports the following:
    <?xml version="1.0"?>
    <root xmlns="urn:schemas-upnp-org:device-1-0" xmlns:vli="urn:schemas-panasonic-com:vli" xmlns:viera="urn:schemas-panasonic-com:viera" xmlns:pxn="urn:schemas-panasonic-com:pxn">
    <specVersion><major>1</major><minor>0</minor></specVersion>
    <device>
    <deviceType>urn:panasonic-com:device:p00RemoteController:1</deviceType>
    <friendlyName>TV</friendlyName>
    <manufacturer>Panasonic</manufacturer>
    <modelName>Panasonic VIErA</modelName>
    <modelNumber>ET60</modelNumber>
    <UDN>uuid:4D454930-0200-1000-8001-8CC1219F3A3A</UDN>
    <viera:X_DMSUDN>uuid:4D454930-0000-1000-8001-8CC1219F3A3A</viera:X_DMSUDN>
    <viera:X_DMRUDN>uuid:4D454930-0100-1000-8001-8CC1219F3A3A</viera:X_DMRUDN>
    <viera:X_NRCUDN>uuid:4D454930-0200-1000-8001-8CC1219F3A3A</viera:X_NRCUDN>
    <viera:X_VERSION>NRC-3.00</viera:X_VERSION>
    <viera:X_DEVICE_TYPE>DTV</viera:X_DEVICE_TYPE>
    <viera:X_KEY_TYPE>PAL-16,PAL-6,PAL-1</viera:X_KEY_TYPE>
    <viera:X_NRCCAP>VR_DMR,VR_DMS,VR_GPAD,VR_VECTOR,VR_BROWSER,VR_LAUNCH,VR_RECDMS,VR_TUNERDMS,VR_MEDIADMS,VR_LVDMS,VR_UPDMS,VR_TVMUTE,VR_OWNPLAY,VR_XRC</viera:X_NRCCAP>
    <iconList>
      <icon>
        <mimetype>image/png</mimetype>
        <width>48</width>
        <height>48</height>
        <depth>24</depth>
        <url>/nrc/dlna_icon_48.png</url>
      </icon>
      <icon>
        <mimetype>image/png</mimetype>
        <width>120</width>
        <height>120</height>
        <depth>24</depth>
        <url>/nrc/dlna_icon_120.png</url>
      </icon>
      <icon>
        <mimetype>image/jpeg</mimetype>
        <width>48</width>
        <height>48</height>
        <depth>24</depth>
        <url>/nrc/dlna_icon_48.jpg</url>
      </icon>
      <icon>
        <mimetype>image/jpeg</mimetype>
        <width>120</width>
        <height>120</height>
        <depth>24</depth>
        <url>/nrc/dlna_icon_120.jpg</url>
      </icon>
    </iconList>
    <serviceList>
      <service>
        <serviceType>urn:panasonic-com:service:p00NetworkControl:1</serviceType>
        <serviceId>urn:upnp-org:serviceId:p00NetworkControl</serviceId>
        <SCPDURL>/nrc/sdd_0.xml</SCPDURL>
        <controlURL>/nrc/control_0</controlURL>
        <eventSubURL>/nrc/event_0</eventSubURL>
      </service>
    </serviceList>
    </device>
    </root>

    I can control the tv with the Panasonic TV Remote 2 and 3. I have not used this plugin, but have had no problem with another plugin "homebridge-panasonic-viera-tv v7.2.0".

I really wanted to use this plugin as it is verified and probably will run more smooth on the homebridge as the other plugin does not like when the TV is offline. It does not look like the TV supports to turn on remotely or with wake on lan (but not a big problem for me as i usually turn on the TV with the xbox.

AntonioMeireles commented 2 years ago

@AkAPerryAkA

many, many thanks for your ultra detailed report.

a quick question - with Panasonic TV Remote 2 and 3 can you turn TV on or off ? will get you with something to test later today.

thanks in advance!

AkAPerryAkA commented 2 years ago

Hi,

I can turn the TV off no problem, but on isn't supported. Thanks!

AntonioMeireles commented 2 years ago

@AkAPerryAkA

plz install a debug version - npm i -g homebridge-vieramatic@debug, and restart homebridge. then please attach here the noisy contents from your homebridge logs when TV is ON.

in your case i'm specially interested in whatever pops surrounding after "X_ScreenState":

AkAPerryAkA commented 2 years ago

@AntonioMeireles

I did as you said and there were no more messages in the Homebridge log. I had the TV on when i reinstalled the plugin and restartert homebridge. I also tried turning the TV off and on, but no change in the logs. I even tried restart of the hb-service, but no luck there either. Am i doing something wrong?

This is all that show in the log event after 30 minutes of waiting:

[1/25/2022, 10:15:19 PM] Loaded plugin: homebridge-vieramatic@4.0.22-debug1
[1/25/2022, 10:15:19 PM] Registering platform 'homebridge-vieramatic.PanasonicVieraTV'
[1/25/2022, 10:15:20 PM] [PanasonicVieraTV] Initializing PanasonicVieraTV platform...
[1/25/2022, 10:15:20 PM] Loading 2 accessories...
[1/25/2022, 10:15:20 PM] [PanasonicVieraTV] handling '192.168.1.112' from config.json
[1/25/2022, 10:15:20 PM] [PanasonicVieraTV] found a 'Panasonic VIErA' TV (ET60) at '192.168.1.112' .
[1/25/2022, 10:15:20 PM] [PanasonicVieraTV] successfully loaded Living Room TV
[1/25/2022, 10:15:20 PM] Living Room TV BC04 is running on port 64211.
[1/25/2022, 10:15:20 PM] Please add [Living Room TV BC04] manually in Home app. Setup Code: XXX-XX-XXX
AntonioMeireles commented 2 years ago

@AkAPerryAkA

with TV ON?!

AkAPerryAkA commented 2 years ago

@AntonioMeireles Yes, i really cant see why its not showing any more messages in the log. The TV is on right now and im watching the log constantly.

AntonioMeireles commented 2 years ago

@AkAPerryAkA

update again to latest debug version. npm i -g homebridge-vieramatic@4.0.22-debug2, and restart homebridge.

and tell please me if still nothing in logs

(thanks for the patience)

AkAPerryAkA commented 2 years ago

@AntonioMeireles

Same as before, tried restart of homebridge again and turning the tv off and then on again.

AntonioMeireles commented 2 years ago

@AkAPerryAkA

i suspect issue is with ... windows. the UPnP subscription doesn't seem to be working at all. have you a way to try this on plain linux VM or host ?

AkAPerryAkA commented 2 years ago

@AntonioMeireles

Right, i was planning on moving my setup to a hyper-v instance. I can do that and report back tomorrow :)

AntonioMeireles commented 2 years ago

@AkAPerryAkA

do plz... and thanks again!

AkAPerryAkA commented 2 years ago

@AntonioMeireles

I could not help myself and i have now moved too hyper-v linux. And the plugin startert to report without problem in the homebridge log:

isTurnedOn() {
  "?xml": "",
  "e:propertyset": {
    "e:property": [
      {
        "X_InputMode": "rc-mode"
      },
      {
        "X_KeyboardType": "default"
      },
      {
        "X_ScreenState": "on"
      },
      {
        "X_AppInfo": ""
      }
    ]
  }
}
isTurnedOn() [
  {
    "X_InputMode": "rc-mode"
  },
  {
    "X_KeyboardType": "default"
  },
  {
    "X_ScreenState": "on"
  },
  {
    "X_AppInfo": ""
  }
]

Also when i checked in apple home, the problem is solved! I updated it to the last version and still no problem. Even the UI settings for the plugin works great now.

So windows was the culprit all along as you though. Thank you so much for awesome work!

AntonioMeireles commented 2 years ago

@AkAPerryAkA

glad it's all sorted out!

just come back if issues arise.

all the best!