Announcement

Collapse
No announcement yet.

mcsMQTT send message via Script

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

    mcsMQTT send message via Script

    I tried the example from the mcsMQTT PDF document but I get a compilation error:

    Apr-23 13:09:21 Error Compiling script /usr/local/HomeSeer/scripts/MQTTTest.vb: 'inFunction' is not declared. It may be inaccessible due to its protection level.
    Apr-23 13:09:21 Error Compiling script /usr/local/HomeSeer/scripts/MQTTTest.vb: Namespace or type specified in the Imports 'System.Core' doesn't contain any public member or cannot be found. Make sure the namespace or the type is defined and contains at least one public member. Make sure the imported element name doesn't use any aliases.

    here is the example out of the PDF:
    Sub Main(parm as object)
    Dim iResult as integer
    Dim sTopic as string = "easy01/cmd"
    Dim sPayload as string= "oled,8,1,TestText"
    Dim sQOS as string = "EXACTLY_ONCE"
    Dim sRetain as string = "FALSE"
    Dim sArray() as string = {sTopic,sPayload,sQOS,sRetain}
    iResult = hs.Plug-inFunction("mcsMQTT","","SendMqttMessage",sArray)
    if (iResult < 0) then
    hs.Writelog("mcsMQTT","MQTT Message Failure for " & sTopic)
    end if
    end Sub

    #2
    Looks like a typo in the example script. It is "hs.PlugInFunction", not "hs.Plug-InFunction".

    Bill

    Comment


      #3
      Originally posted by bdickhaus View Post
      Looks like a typo in the example script. It is "hs.PlugInFunction", not "hs.Plug-InFunction".

      Bill
      Stupid me; just took over the example without thinking...


      Thank you!

      Comment


        #4
        ...without thinking

        same for me doing a global replace of plugin with plug-in for consistency throughout the document.

        Comment

        Working...
        X