Announcement

Collapse
No announcement yet.

Tasker plugin custom API docs

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

    Tasker plugin custom API docs

    I am have trouble with sending an SMS with the homeseer plugin API

    I am using the script command in the "download latest tasker plugin" thread.

    hs.PluginFunction("Tasker Plugin", "", "CustomAPI",New Object(){"Sony Experia Z2","sms=12345678","Hello this is a sms messsage"})

    I, of course, have replaced the device name with my device name and the sms= with the phone number that I wish to send the SMS to.
    When I run the script, nothing appears to happen. I am sending a SMS from my phone to my phone for testing.

    Where is the documentation for the custom API commands? For instance, what is the 2nd parameter for? (Currently null). Do I need to include the password for this device, and if so, where do I place it?

    I am pretty sure that I will never get this working without some explanation in the documentation.

    #2
    Originally posted by jimbell View Post
    I am have trouble with sending an SMS with the homeseer plugin API

    I am using the script command in the "download latest tasker plugin" thread.

    hs.PluginFunction("Tasker Plugin", "", "CustomAPI",New Object(){"Sony Experia Z2","sms=12345678","Hello this is a sms messsage"})

    I, of course, have replaced the device name with my device name and the sms= with the phone number that I wish to send the SMS to.
    When I run the script, nothing appears to happen. I am sending a SMS from my phone to my phone for testing.

    Where is the documentation for the custom API commands? For instance, what is the 2nd parameter for? (Currently null). Do I need to include the password for this device, and if so, where do I place it?

    I am pretty sure that I will never get this working without some explanation in the documentation.
    Hi, does the sms function in tasker device works for you? (number|message)
    If yes, below code should work.
    PHP Code:
      Public Sub Main(ByVal Parms As Object)
             
    hs.PluginFunction("Tasker Plugin""""CustomAPI", New  Object() {"Sony  Experia Z2""sms=12345678""Hello this is a sms  messsage"})
        
    End Sub 
    2nd parameter is described in hs3 scripting doc "The instance name of the plugin to access if this is a multi-instance plugin. For single instance plugins, pass an empty string"

    The parameters you need to care about is inside the brackets {}
    {Tasker device name, tasker commands, message}
    Same stucture as custom command but with the exception that =:= is replace with comma.
    You can find all tasker commands that is available in Tasker under HS3 Addons.

    Below example will send 3 commands in same command.
    First it will speak "Hello this is a message!"
    Second it will vibrate your device.
    And finally it will open a popup window with message "Hello this is a message!"
    PHP Code:
      Public Sub Main(ByVal Parms As Object)
    hs.PluginFunction("Tasker Plugin""""CustomAPI", New Object() {"Sony Experia Z2""say vibrate popup ""Hello this is a message!"})
        
    End Sub 
    Hope it helps.
    Please excuse any spelling and grammatical errors I may make.
    --
    Tasker Plugin / Speech Droid
    Tonlof | Sweden

    Comment


      #3
      It is now working

      Originally posted by tonlof View Post
      Hi, does the sms function in tasker device works for you? (number|message)
      If yes, below code should work.
      PHP Code:
        Public Sub Main(ByVal Parms As Object)
               
      hs.PluginFunction("Tasker Plugin""""CustomAPI", New  Object() {"Sony  Experia Z2""sms=12345678""Hello this is a sms  messsage"})
          
      End Sub 
      2nd parameter is described in hs3 scripting doc "The instance name of the plugin to access if this is a multi-instance plugin. For single instance plugins, pass an empty string"

      The parameters you need to care about is inside the brackets {}
      {Tasker device name, tasker commands, message}
      Same stucture as custom command but with the exception that =:= is replace with comma.
      You can find all tasker commands that is available in Tasker under HS3 Addons.

      Below example will send 3 commands in same command.
      First it will speak "Hello this is a message!"
      Second it will vibrate your device.
      And finally it will open a popup window with message "Hello this is a message!"
      PHP Code:
        Public Sub Main(ByVal Parms As Object)
      hs.PluginFunction("Tasker Plugin""""CustomAPI", New Object() {"Sony Experia Z2""say vibrate popup ""Hello this is a message!"})
          
      End Sub 
      Hope it helps.
      I now have it working. I am not exactly sure what I did, but I think it was the fact that I had a space in the nickname of the Autoremote device ("Note 4-2") and no space in the tasker device ("Note4-2"). I also removed the password from the tasker device in homeseer as well as Autoremote device. All seems to be working at this time.
      Thanks again for all the great help!

      Comment


        #4
        Something has changed and now it does not work

        I had not been using the tasker plugin for some time, but I am again using it. I am using the "send sms" example for testing.

        SMS function in tasker device works.

        I have an event that is executing the immediate script which used to work..

        The script is

        &hs.PluginFunction("Tasker Plugin", "", "CustomAPI", New Object() {"Note 4-3", "sms=6781231234", "Hello this is a sms messsage"})


        Homeseer log entries are

        Message/Source
        Jul-10 12:12:00 AM Error Running script(2) &hs.PluginFunction("Tasker Plugin", "", "CustomAPI", New Object() {"Note 4-3", "sms=6781231234", "Hello this is a sms messsage"}), init error: Expected end of statement
        Jul-10 12:12:00 AM Event Running script statement immediately: &hs.PluginFunction("Tasker Plugin", "", "CustomAPI", New Object() {"Note 4-3", "sms=67871231234", "Hello this is a sms messsage"})
        Jul-10 12:12:00 AM Event Event Trigger "Manual Triggered Send SMS to Note 4"
        Jul-10 12:12:00 AM Event Event Manual Triggered Send SMS to Note 4 triggered by the event page 'Run' button.

        I don't see anything wrong with the script statement.
        Last edited by jimbell; July 10, 2016, 08:32 AM. Reason: mistake

        Comment


          #5
          Originally posted by jimbell View Post
          I had not been using the tasker plugin for some time, but I am again using it. I am using the "send sms" example for testing.

          SMS function in tasker device works.

          I have an event that is executing the immediate script which used to work..

          The script is

          &hs.PluginFunction("Tasker Plugin", "", "CustomAPI", New Object() {"Note 4-3", "sms=6781231234", "Hello this is a sms messsage"})


          Homeseer log entries are

          Message/Source
          Jul-10 12:12:00 AM Error Running script(2) &hs.PluginFunction("Tasker Plugin", "", "CustomAPI", New Object() {"Note 4-3", "sms=6781231234", "Hello this is a sms messsage"}), init error: Expected end of statement
          Jul-10 12:12:00 AM Event Running script statement immediately: &hs.PluginFunction("Tasker Plugin", "", "CustomAPI", New Object() {"Note 4-3", "sms=67871231234", "Hello this is a sms messsage"})
          Jul-10 12:12:00 AM Event Event Trigger "Manual Triggered Send SMS to Note 4"
          Jul-10 12:12:00 AM Event Event Manual Triggered Send SMS to Note 4 triggered by the event page 'Run' button.

          I don't see anything wrong with the script statement.
          Hi, what happens if you remove "&" and use it inside a function or sub?
          Please excuse any spelling and grammatical errors I may make.
          --
          Tasker Plugin / Speech Droid
          Tonlof | Sweden

          Comment


            #6
            Originally posted by tonlof View Post
            Hi, what happens if you remove "&" and use it inside a function or sub?
            It works in the script. I tried several commands "say", vibrate, popup and all worked in the script.

            So where is the problem? In the plugin or homeseer itself?

            Homeseer version Pro 3.0.0.290.

            Plugin version 3.0.3.3.
            Last edited by jimbell; July 10, 2016, 03:43 PM. Reason: adding information

            Comment


              #7
              Originally posted by jimbell View Post
              It works in the script. I tried several commands "say", vibrate, popup and all worked in the script.

              So where is the problem? In the plugin or homeseer itself?

              Homeseer version Pro 3.0.0.290.

              Plugin version 3.0.3.3.
              I Think HS immediate window have problem with the { }
              Please excuse any spelling and grammatical errors I may make.
              --
              Tasker Plugin / Speech Droid
              Tonlof | Sweden

              Comment

              Working...
              X