Announcement

Collapse
No announcement yet.

Entering Text from HSTouch to HS3

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

    Entering Text from HSTouch to HS3

    Hi,

    I'm using the Kodi/XBMC plug-in and there is a control feature that allows for sending text to the Kodi device. In HS3 there is a field for enter text and a Submit button. In HSTouch there Send Text controll for the device, but that is the Submit button. is there a way in HSTouch to populate the Send Text field in HS3?Click image for larger version

Name:	yfjy.jpg
Views:	2
Size:	82.4 KB
ID:	1210231

    In my HSTouch design project I have Text Box for entering my text, but having problem sending it to the HS3 field. I posted a thread on the Kodi/XBMC forum and they suggest talking to the HSTouch gurus

    I'm running on a Linux machine if that matters

    Thanks

    #2
    Do you know if the Kodi plugin has a scripting action to send the text? I think that is likely to be the only way to do this, you have a text box and button in HSTouch, that calls a script, the script then sends it to Kodi. I don't imagine you will be able to do this all in HSTouch.

    Comment


      #3
      yes the Kodi plugin has an InputSendText scripting function

      Code:
      void InputSendText(string player, string text)

      Comment


        #4
        What would a sample script look like?
        I tried the following:
        Sub Main(parm as object)

        void InputSendText(Kodi (localhost), justice league dark)

        End Sub


        And got the following errors in the log:



        Nov-23 9:49:35 PM Error Compiling script /usr/local/HomeSeer/scripts/kodi.vb: 'End Namespace' must be preceded by a matching 'Namespace'.
        Nov-23 9:49:35 PM Error Compiling script /usr/local/HomeSeer/scripts/kodi.vb: Identifier expected.
        Nov-23 9:49:35 PM Error Compiling script /usr/local/HomeSeer/scripts/kodi.vb: Expected 'Class'.
        Nov-23 9:49:35 PM Error Compiling script /usr/local/HomeSeer/scripts/kodi.vb: Expected 'End'.
        Nov-23 9:49:35 PM Error Compiling script /usr/local/HomeSeer/scripts/kodi.vb: End of statement expected.

        Comment


          #5
          try that (not tested)

          Code:
          Sub Main(ByVal parm as object)
             
          hs.PluginFunction("XBMC", "", "InputSendText", new String() {"Kodi (localhost)", "justice league dark"})
          
          End Sub

          Comment


            #6
            I had to put this down for bit, but now I'm back at it.

            I get the script to work, but I have to type the text that I want to send in the last quotation marks (highlighted in bold) of the script itself.

            Sub Main(ByVal parm as object)

            hs.PluginFunction("XBMC", "", "InputSendText", new String() {"Kodi (localhost)", "justice league dark"})

            End Sub

            How can get my text from HSTouch into those quotation marks? I've tried playing around with Run a Homeser Script with Values From Elements action type. Can I create a device that is string based?

            Comment


              #7
              Originally posted by huntley1 View Post
              I had to put this down for bit, but now I'm back at it.

              I get the script to work, but I have to type the text that I want to send in the last quotation marks (highlighted in bold) of the script itself.

              Sub Main(ByVal parm as object)

              hs.PluginFunction("XBMC", "", "InputSendText", new String() {"Kodi (localhost)", "justice league dark"})

              End Sub

              How can get my text from HSTouch into those quotation marks? I've tried playing around with Run a Homeser Script with Values From Elements action type. Can I create a device that is string based?
              You are in the right area, in the 'Run a Homeser Script with Values From Elements' in the ScriptParameter1 box you need to put the text box element in there. Run this action from a button.

              In the script whatever is in that box should in theory then be passed into the script, I don't have the plugin to test but try this as a script;

              Code:
              Sub Main(ByVal parm as object)
                 
              hs.writelog("XBMC-HSTouch", parm(0))
              
              hs.PluginFunction("XBMC", "", "InputSendText", new String() {"Kodi (localhost)", parm(0)})
              
              End Sub

              Comment


                #8
                It works perfectly! Thank you!

                So, hs.writelog is a way to send a string from HSTouch to HS3? How do you send a string from HS3 to HSTouch?

                Comment


                  #9
                  Glad it worked - I just put the hs.writelog in so if it did not work I was going to get you to check the HomeSeer log and it should contain the same text that goes to HSTouch. You can take that line out if you so wish - the clue is in the last bit of the hs.pluginfunction line - parm(0) gets the parameters that are sent into the script and then sends then back out into the plugin. In this case parm(0) = ScriptParameter1.

                  In terms of your last question it would depend on your application but the easiest way is to create a device in HS, then set the device string in a script and in HSTouch you status track it to this device. Change the string and the device updates in HSTouch.

                  Comment


                    #10
                    That is some useful information.

                    Thanks you!

                    Comment


                      #11
                      Hi,

                      I'm trying run the following script to send a message on Kodi.

                      Sub Main(parm as object)

                      'functions available from scripts
                      'GUIShowNotification(string player, string title, string message, int displaytime = 5000)

                      hs.PluginFunction("Kodi", "", "GUIShowNotification", new String() {("Kodi (localhost)", "Message", "Dinner's ready", 10000"})

                      End Sub

                      I'm getting the following error message in my log, I'm I don't have the syntax right.

                      Feb-12 6:33:06 PM Error Compiling script /usr/local/HomeSeer/scripts/MessageKodi.vb: 'End Namespace' must be preceded by a matching 'Namespace'.
                      Feb-12 6:33:06 PM Error Compiling script /usr/local/HomeSeer/scripts/MessageKodi.vb: Identifier expected.
                      Feb-12 6:33:06 PM Error Compiling script /usr/local/HomeSeer/scripts/MessageKodi.vb: Expected 'Class'.
                      Feb-12 6:33:06 PM Error Compiling script /usr/local/HomeSeer/scripts/MessageKodi.vb: Expected 'End'.
                      Feb-12 6:33:06 PM Error Compiling script /usr/local/HomeSeer/scripts/MessageKodi.vb: Expected ')'.
                      Feb-12 6:33:04 PM Event Running script in background: /usr/local/HomeSeer/scripts/MessageKodi.vb

                      Comment


                        #12
                        Originally posted by huntley1 View Post

                        'functions available from scripts
                        'GUIShowNotification(string player, string title, string message, int displaytime = 5000)

                        hs.PluginFunction("Kodi", "", "GUIShowNotification", new String() {("Kodi (localhost)", "Message", "Dinner's ready", 10000"})

                        End Sub

                        I'm getting the following error message in my log, I'm I don't have the syntax right.
                        it looks like you have an extra parenthesis and an extra quote that need to be removed (see red above)

                        try this:

                        Code:
                        Sub Main(parm as object)
                        
                        'functions available from scripts
                        'GUIShowNotification(string player, string title, string message, int displaytime = 5000)
                        
                        hs.PluginFunction("Kodi", "", "GUIShowNotification", new String() {"Kodi (localhost)", "Message", "Dinner's ready", 10000})
                        
                        End Sub

                        Comment


                          #13
                          Have you resolved this problem?

                          Comment


                            #14
                            yeah, this is how the script should like :

                            Sub Main(parm as object)

                            hs.PluginFunction("Kodi", "", "GUIShowNotification", new Object() {"Kodi (localhost)", "Message", "Dinner's ready", 10000})

                            End Sub

                            Comment

                            Working...
                            X