Announcement

Collapse
No announcement yet.

First script on Linux

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

    First script on Linux


    #2
    Try:

    Sub Main(ByVal parm as Object)
    hs.writeLog("msg","Logged a message")
    End Sub
    HS4Pro on a Raspberry Pi4
    54 Z-Wave Nodes / 21 Zigbee Devices / 108 Events / 767 Devices
    Plugins: Z-Wave / Zigbee Plus / EasyTrigger / AK Weather / OMNI

    HSTouch Clients: 1 Android

    Comment


      #3
      I believe you cannot use vbscript but must use vb.net??

      Make sure file suffix is .vb


      tenholde
      tenholde

      Comment


        #4
        Progress! Thanks!

        Looks like i can't access the open comport method. How do i do that? Is that even a vb.net function? The scripting guide lists it: https://homeseer.com/support/homesee...lp/default.htm

        I am working towards a script that will receive data from a serial connected arduino, and eventually send data back to it.

        For now i have

        IMPORTS System.IO
        IMPORTS System.Net

        Sub Main(ByVal parm as Object)
        err = OpenComPort(1, "9600,N,8,1", 1, "comdatareceived.vb", "callback")
        hs.writeLog("msg", err)
        End Sub

        So that should open a com port (i need to figure out the port number, for now i put 1 in there till i get syntax correct), and call function callback in script comdatareceived.vb when data arrives.

        I get these errors:
        Compiling script /usr/local/HomeSeer/scripts/gettemps.vb: 'OpenComPort' is not declared. It may be inaccessible due to its protection level.
        Compiling script /usr/local/HomeSeer/scripts/gettemps.vb: The import 'System.Core' could not be found.

        Comment


          #5
          In Linux, a COM port is not a number, but rather a device. You'll have to use something along the lines of: /dev/ttyUSB0 or wherever you have your serial connection.

          You'd probably be better off using the Arduino plugin for HS.
          HS4Pro on a Raspberry Pi4
          54 Z-Wave Nodes / 21 Zigbee Devices / 108 Events / 767 Devices
          Plugins: Z-Wave / Zigbee Plus / EasyTrigger / AK Weather / OMNI

          HSTouch Clients: 1 Android

          Comment


            #6
            Problem with the arduino plugin is it only supports ethernet on linux. That is an option but i had problems with it remaining stable.

            If the port is a string then i assume i cant do the opencomport, since it requires an integer?

            Thanks for the continued advice, much appreciated!

            Comment

            Working...
            X