Announcement

Collapse
No announcement yet.

TV IP Control possibillity or Do we need IR?

Collapse
X
 
  • Filter
  • Time
  • Show
Clear All
new posts

    TV IP Control possibillity or Do we need IR?

    I don't see any solutions or plugins to control any TVs over IP. I noticed an RS232 version for Panasonic.
    Does everyone prefer a Global Cache or Harmony Solution as opposed to controlling TV directly?

    #2
    I'm not sure about other TVs, but I have a Samsung smart TV. It can be controlled with the DLNA plugin. Annoyingly though, there is no command to turn it on over IP (seems all Samsung are this way) so you have to revert to IR for that. More of a hassle than it's been worth for me, so I don't control the TV at all.
    HS Pro 3.0 | Linux Ubuntu 16.04 x64 virtualized under Proxmox (KVM)
    Hardware: Z-NET - W800 Serial - Digi PortServer TS/8 and TS/16 serial to Ethernet - Insteon PLM - RFXCOM - X10 Wireless
    Plugins: HSTouch iOS and Android, RFXCOM, BlueIris, BLLock, BLDSC, BLRF, Insteon PLM (MNSandler), Device History, Ecobee, BLRing, Kodi, UltraWeatherWU3
    Second home: Zee S2 with Z-Wave, CT101 Z-Wave Thermostat, Aeotec Z-Wave microswitches, HSM200 occupancy sensor, Ecolink Z-Wave door sensors, STI Driveway Monitor interfaced to Zee S2 GPIO pins.

    Comment


      #3
      I have used RS232 over the "Service" or "ExLink" ports to turn on my 2009 and 2012 Sammy TVs and the DLNA plugin to control it. However, I also have a Harmony Ultimate remote and now that that is integrated into HomeSeer and my Amazon Echo, I rarely use the original solution.
      cheeryfool

      Comment


        #4
        Originally posted by cheeryfool View Post
        I have used RS232 over the "Service" or "ExLink" ports to turn on my 2009 and 2012 Sammy TVs and the DLNA plugin to control it. However, I also have a Harmony Ultimate remote and now that that is integrated into HomeSeer and my Amazon Echo, I rarely use the original solution.
        Can you tell me a little more about how you integrated the Harmony remote? We have a couple of those too. Do they have to be pointed at the TV to control it?
        HS Pro 3.0 | Linux Ubuntu 16.04 x64 virtualized under Proxmox (KVM)
        Hardware: Z-NET - W800 Serial - Digi PortServer TS/8 and TS/16 serial to Ethernet - Insteon PLM - RFXCOM - X10 Wireless
        Plugins: HSTouch iOS and Android, RFXCOM, BlueIris, BLLock, BLDSC, BLRF, Insteon PLM (MNSandler), Device History, Ecobee, BLRing, Kodi, UltraWeatherWU3
        Second home: Zee S2 with Z-Wave, CT101 Z-Wave Thermostat, Aeotec Z-Wave microswitches, HSM200 occupancy sensor, Ecolink Z-Wave door sensors, STI Driveway Monitor interfaced to Zee S2 GPIO pins.

        Comment


          #5
          Originally posted by reidfo View Post
          Can you tell me a little more about how you integrated the Harmony remote? We have a couple of those too. Do they have to be pointed at the TV to control it?

          I am using Rien's Harmony Plugin which pulls the activities and device actions into HS3. For the majority of my AV stuff it is using IR, but not from the remote itself, so the remote doesn't have to be pointing at the TV. There's an IR blaster that I have positioned on the back of my AV credenza that easily controls the TV on the wall above. You can also use the Harmony remote app on your smartphone.

          For the Echo control of the Harmony I cheated and used IFTTT. E.g. IF Echo Then Harmony which allows you to switch between activities plus some other stuff. The good thing is that HS3 stays in sync whether you use the physical remote, IFTTT or HS3, via the plugin.
          cheeryfool

          Comment


            #6
            Back in the day (15 years ago!) I controlled our Panasonic plasma as for 5+ years via Girder by Promixis. The Panasonic serial support is fantastic, and it has a very easy protocol.

            Let me know if you can't find the protocol, I have the documentation from that era, and doubt it's changed.

            Comment


              #7
              I have a Panasonic TC-65AX800U and am able to turn it on via WOL sent via BLLAN.

              I found a project on GitHub for Control Panasonic Viera TVs using C#
              I then saw some talk over on iRule.
              I grabbed the Advanced REST client on the Chrome web store

              In the Chrome Advanced REST client, I did the following:

              Set up the URL as: http://192.168.1.10:55000/nrc/control_0/ with POST as the method

              Then set the header:
              Code:
              Accept: text/xml
              Cache-Control: no-cache
              Pragma: no-cache
              SOAPACTION: "urn:panasonic-com:service:p00NetworkControl:1#X_SendKey"
              Content-Length: 324
              Content-Type: text/xml;charset="utf-8
              then set the payload:

              Code:
              <?xml version="1.0" encoding="utf-8"?>
              <s:Envelope xmlns:s="http://schemas.xmlsoap.org/soap/envelope/" s:encodingStyle="http://schemas.xmlsoap.org/soap/encoding/">
              <s:Body>
              <u:X_SendKey xmlns:u="urn:panasonic-com:service:p00NetworkControl:1">
              <X_KeyEvent>NRC_POWER-ONOFF</X_KeyEvent>
              </u:X_SendKey>
              </s:Body>
              </s:Envelope>
              When I hit send, my TV shuts off.
              The GitHub project referenced above lists all of the commands that you can send.

              So, IP control is possible.

              Now to find out how I can wire this up in HS3


              NOTE: I had to turn two settings on for this to work.. In the menu for the tv, navigate to network and then TV Remote App settings and turn both TV Remote and Wake on LAN ON

              Comment


                #8
                Originally posted by macrho View Post
                So, IP control is possible. Now to find out how I can wire this up in HS3
                You can use URLAction to send these commands.
                💁‍♂️ Support & Customer Service 🙋‍♂️ Sales Questions 🛒 Shop HomeSeer Products

                Comment


                  #9
                  Thanks but I'm not having much luck with my code, a bad request is returned. This is what I'm using:

                  Code:
                  
                  Sub Main(Optional ByVal pParms As String = "")
                  
                      Dim server As String
                      server = "http://192.168.1.10:55000/nrc/control_0/"
                  
                      Dim headers As String
                      headers = "Accept: text/xml " + vbCr +
                                "Cache-Control: no-cache " + vbCr +
                                "Pragma: no-cache " + vbCr +
                                "SOAPACTION: ""urn:panasonic-com:service:p00NetworkControl:1#X_SendKey""" + vbCr +
                                "Content-Length: 324 " + vbCr +
                                "Content-Type: text/xml;charset=""utf-8"" "
                  
                      Dim payload As String
                      payload = "<?xml version=""1.0"" encoding=""utf-8:""?> " + vbCr +
                                "<s:Envelope xmlns:s=""http://schemas.xmlsoap.org/soap/envelope/"" s:encodingStyle=""http://schemas.xmlsoap.org/soap/encoding/""> " + vbCr +
                                "<s:Body> " + vbCr +
                                "<u:X_SendKey xmlns:u=""urn:panasonic-com:service:p00NetworkControl:1""> " + vbCr +
                                "<X_KeyEvent>NRC_POWER-ONOFF</X_KeyEvent> " + vbCr +
                                "</u:X_SendKey> " + vbCr +
                                "</s:Body> " + vbCr +
                                "</s:Envelope> "
                  
                      Dim s
                      s = hs.URLAction(server, "POST", payload, headers)
                      
                      hs.WriteLog("Response",payload) 
                  
                  End Sub
                  I couldn't find a way to send each header individually, perhaps that's my issue?

                  Comment


                    #10
                    I'm not convinced the headers work in urlaction from past experiments, you might have better luck with the .net functions.

                    Comment


                      #11
                      I basically hacked together some of the C# from the Github site I linked to above. This now works:

                      Code:
                       using Microsoft.VisualBasic;
                       using System;
                       using System.Collections;
                       using System.Collections.Generic;
                       using System.Data;
                       using System.Diagnostics;
                       using System.Net;
                       using HomeSeerAPI;
                        
                       public object Main(object[] Parms)
                       {
                           hs.WriteLog("CSHARP","From C# script");
                      
                           string server = "http://192.168.1.10:55000/nrc/control_0/";
                      
                          System.Net.WebRequest req =    System.Net.WebRequest.Create(server);
                          System.Net.HttpWebRequest httpReq = (System.Net.HttpWebRequest)req;
                      
                          httpReq.Method = "POST";
                          httpReq.ContentType = "text/xml; charset=utf-8";
                          httpReq.ProtocolVersion = System.Net.HttpVersion.Version11;
                      
                                  // Add SOAP header
                                  httpReq.Headers.Add("SOAPAction: \"urn:panasonic-com:service:p00NetworkControl:1#X_SendKey\"");
                      
                                  
                                  System.Text.StringBuilder request = new System.Text.StringBuilder("<?xml version=\"1.0\" encoding=\"utf-8\"?>");
                      
                                  request.Append("<s:Envelope xmlns:s=\"http://schemas.xmlsoap.org/soap/envelope/\" s:encodingStyle=\"http://schemas.xmlsoap.org/soap/encoding/\">");
                                  request.Append("<s:Body>");
                                  request.Append("<u:X_SendKey xmlns:u=\"urn:panasonic-com:service:p00NetworkControl:1\">");
                                  request.Append("<X_KeyEvent>");
                                  request.Append("NRC_POWER-ONOFF");
                                  request.Append("</X_KeyEvent>");
                                  request.Append("</u:X_SendKey>");
                                  request.Append("</s:Body>");
                                  request.Append("</s:Envelope>");
                      
                      
                                  string data = request.ToString();
                                  httpReq.ContentLength = data.Length;
                      
                                  System.IO.Stream requestStream = httpReq.GetRequestStream();
                                  System.IO.StreamWriter writer = new System.IO.StreamWriter(requestStream, System.Text.Encoding.ASCII);
                                  writer.Write(data);
                                  writer.Close();
                      
                      
                           return 0;
                       }
                      How do I properly use namespaces in this C# script? I did set "Using System.Net" , for example, but it errored out and I had to explicitly name the objects: System.Net.WebRequest, for example.

                      Comment


                        #12
                        Did you ever get this to work? I tried your C# script, and got an error:
                        Code:
                        [COLOR=Red]
                        aug-12 22:59:18 	  	Error 1 	Running script more info: The request timed out 
                        aug-12 22:59:18 	  	Error 1 	Running script /usr/local/HomeSeer/scripts/Panasonic.cs :Exception has been thrown by the target of an invocation. 
                        [/COLOR]

                        Comment


                          #13
                          I did and just verified it worked (haven't used it in a while)
                          Just change the IP of your TV and you should be good to go.

                          Code:
                          using Microsoft.VisualBasic;
                          using System;
                          using System.Collections;
                          using System.Collections.Generic;
                          using System.Data;
                          using System.Diagnostics;
                          using System.Net;
                          using HomeSeerAPI;
                          
                          public object Main(object[] Parms)
                          {
                            hs.WriteLog("CSHARP","From C# script");
                            string server = "http://192.168.1.10:55000/nrc/control_0/";
                          
                            System.Net.WebRequest req =	System.Net.WebRequest.Create(server);
                            System.Net.HttpWebRequest httpReq = (System.Net.HttpWebRequest)req;
                            httpReq.Method = "POST";
                            httpReq.ContentType = "text/xml; charset=utf-8";
                            httpReq.ProtocolVersion = System.Net.HttpVersion.Version11;
                          
                            // Add SOAP header
                            httpReq.Headers.Add("SOAPAction: \"urn:panasonic-com:service:p00NetworkControl:1#X_SendKey\"");			
                            System.Text.StringBuilder request = new System.Text.StringBuilder("<?xml version=\"1.0\" encoding=\"utf-8\"?>");
                            request.Append("<s:Envelope xmlns:s=\"http://schemas.xmlsoap.org/soap/envelope/\" s:encodingStyle=\"http://schemas.xmlsoap.org/soap/encoding/\">");
                            request.Append("<s:Body>");
                            request.Append("<u:X_SendKey xmlns:u=\"urn:panasonic-com:service:p00NetworkControl:1\">");
                            request.Append("<X_KeyEvent>");
                            request.Append("NRC_POWER-ONOFF");
                            request.Append("</X_KeyEvent>");
                            request.Append("</u:X_SendKey>");
                            request.Append("</s:Body>");
                            request.Append("</s:Envelope>");
                            string data = request.ToString();
                            httpReq.ContentLength = data.Length;
                            System.IO.Stream requestStream = httpReq.GetRequestStream();
                            System.IO.StreamWriter writer = new System.IO.StreamWriter(requestStream, System.Text.Encoding.ASCII);
                            writer.Write(data);
                            writer.Close();
                            return 0;
                          }

                          Comment


                            #14
                            VB Event Control Script for Panasonic Viera

                            Thanks for the lead on this guys.

                            I have pasted below a VB script that I have crafted to allow me to create Events and send the command as a parameter to the script making it easy to setup the commands I need.

                            I'll use BL's WOL to turn on the TV.



                            Code:
                            Imports System.Diagnostics
                            Imports System.Net
                            Imports System.Text
                            Imports System.IO
                            
                            
                            Sub Main(parm as object)
                                    Dim parms() As String
                                    Dim command as String
                            
                                    parms = Split(parm.ToString,",")
                                    Command = parms(0)
                            
                                    Dim request As New System.Text.StringBuilder()
                                    request = New System.Text.StringBuilder("<?xml version=""1.0"" encoding=""utf-8""?>")
                                    request.Append("<s:Envelope xmlns:s=""http://schemas.xmlsoap.org/soap/envelope/"" s:encodingStyle=""http://schemas.xmlsoap.org/soap/encoding/"">")
                                    request.Append("<s:Body>")
                                    request.Append("<u:X_SendKey xmlns:u=""urn:panasonic-com:service:p00NetworkControl:1"">")
                                    request.Append("<X_KeyEvent>")
                                    request.Append(Command)
                                    request.Append("</X_KeyEvent>")
                                    request.Append("</u:X_SendKey>")
                                    request.Append("</s:Body>")
                                    request.Append("</s:Envelope>")
                                    Dim data As String = request.ToString()
                                    Dim url As String = "http://192.168.0.207:55000/nrc/control_0/"
                                    Dim responsestring As String = ""
                                    Dim myReq As HttpWebRequest = WebRequest.Create(url)
                                    Dim proxy As IWebProxy = CType(myReq.Proxy, IWebProxy)
                                    Dim proxyaddress As String
                                    Dim myProxy As New WebProxy()
                                    Dim encoding As New ASCIIEncoding
                                    Dim buffer() As Byte = encoding.GetBytes(data)
                                    Dim response As String
                            
                                    myReq.AllowWriteStreamBuffering = False
                                    myReq.Method = "POST"
                                    myReq.ContentType = "text/xml; charset=utf-8"
                                    myReq.Accept = "text/xml"
                                    myReq.ContentLength = buffer.Length
                                    myReq.Headers.Add("soapaction", """urn:panasonic-com:service:p00NetworkControl:1#X_SendKey""")
                                    proxyaddress = proxy.GetProxy(myReq.RequestUri).ToString
                            
                                    Dim newUri As New Uri(proxyaddress)
                                    myProxy.Address = newUri
                                    myReq.Proxy = myProxy
                                    'myReq.Timeout = 500   '<-- 500ms timeout.  Adjust as needed.
                            
                                    'Try
                                        Dim post As Stream = myReq.GetRequestStream
                                        post.Write(buffer, 0, buffer.Length)
                                        post.Close()
                            
                                        Dim myResponse As HttpWebResponse = myReq.GetResponse
                                        Dim responsedata As Stream = myResponse.GetResponseStream
                                        Dim responsereader As New StreamReader(responsedata)
                                        response = responsereader.ReadToEnd
                            
                                    'Catch ex As Exception
                                    'End Try
                            
                            End Sub
                            Attached Files

                            Comment


                              #15
                              Also have a look at Media Controller plugin. This provide DLNA compatibility which should be able to control compatible IP TVs

                              Comment

                              Working...
                              X