Announcement

Collapse
No announcement yet.

Can we create Text box virtual devices

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

    Can we create Text box virtual devices

    Hi i am working on a HS3 to arduino Ethernet tool and what i really need is a way to set an address.

    is this possible?
    Raptor
    HS3 Pro on Windows 8 64bit
    53 Z-wave nodes(46 devices, 7 remotes), 15 DS10a's, 10 ms16a's, 9 Oregon Sensors, W800, RFXCOMtrx433, Way2Call, 3 HSTouch Clients, 2xRussound CAS44, Global Cache GC100-12,10 Rollertrol blinds(+ zwave) ,3 Squeezebox Radios and 1 Squeezebox Boom,DMX Arduino via ethernet,Rain8Net,3x Echo Dot's


    Check out my electronics blog here:
    https://www.facebook.com/RaptorsIrrationalInventions

    #2
    Can you elaborate a bit more on how this tool is developed so we may be able to offer suggestions.
    💁‍♂️ Support & Customer Service 🙋‍♂️ Sales Questions 🛒 Shop HomeSeer Products

    Comment


      #3
      Sure!

      so basically it uses a URL string to send parameters to the arduino using http get.

      e.g. http://192.168.1.66/?1,3,5,6

      homeseer sends the 1,3,5,6 from one of the virtual devices i have created:


      the issue i have is the URL is hardcoded in the script and is a bit tricky to change.

      i would write a plugin but i dont know how to get started with that.

      Raptor
      Attached Files
      HS3 Pro on Windows 8 64bit
      53 Z-wave nodes(46 devices, 7 remotes), 15 DS10a's, 10 ms16a's, 9 Oregon Sensors, W800, RFXCOMtrx433, Way2Call, 3 HSTouch Clients, 2xRussound CAS44, Global Cache GC100-12,10 Rollertrol blinds(+ zwave) ,3 Squeezebox Radios and 1 Squeezebox Boom,DMX Arduino via ethernet,Rain8Net,3x Echo Dot's


      Check out my electronics blog here:
      https://www.facebook.com/RaptorsIrrationalInventions

      Comment


        #4
        anyone?
        HS3 Pro on Windows 8 64bit
        53 Z-wave nodes(46 devices, 7 remotes), 15 DS10a's, 10 ms16a's, 9 Oregon Sensors, W800, RFXCOMtrx433, Way2Call, 3 HSTouch Clients, 2xRussound CAS44, Global Cache GC100-12,10 Rollertrol blinds(+ zwave) ,3 Squeezebox Radios and 1 Squeezebox Boom,DMX Arduino via ethernet,Rain8Net,3x Echo Dot's


        Check out my electronics blog here:
        https://www.facebook.com/RaptorsIrrationalInventions

        Comment


          #5
          Text boxes are created by setting the render type to TextBox_String, unfortunately even if you do that (and you can do that by creating the device from a script) I am not sure that practically speaking you can do anything with it. IIRC that it only calls SetIOMulti which is a plugin function and will do nothing, although you can try it...if it changes the string of the device then I guess you can call one of the device script functions.

          Comment


            #6
            Originally posted by mrhappy View Post
            Text boxes are created by setting the render type to TextBox_String, unfortunately even if you do that (and you can do that by creating the device from a script) I am not sure that practically speaking you can do anything with it. IIRC that it only calls SetIOMulti which is a plugin function and will do nothing, although you can try it...if it changes the string of the device then I guess you can call one of the device script functions.
            That might work for what i need, i really want to be able to store an IP address for the script to use.
            HS3 Pro on Windows 8 64bit
            53 Z-wave nodes(46 devices, 7 remotes), 15 DS10a's, 10 ms16a's, 9 Oregon Sensors, W800, RFXCOMtrx433, Way2Call, 3 HSTouch Clients, 2xRussound CAS44, Global Cache GC100-12,10 Rollertrol blinds(+ zwave) ,3 Squeezebox Radios and 1 Squeezebox Boom,DMX Arduino via ethernet,Rain8Net,3x Echo Dot's


            Check out my electronics blog here:
            https://www.facebook.com/RaptorsIrrationalInventions

            Comment


              #7
              I have tried it and yes it will put a text box on the page with a submit button if you set the render type that way, if you do not set the interface property then when you press submit it will put the string that you put into this box into the device string. I guess then you can use this in your scripts to send the data to that IP address although would worry as to how often your IP address changes to whether you need to do this, also think of other users having access to this and may through no fault of their own change this device and stop your lighting working...

              Comment


                #8
                Originally posted by mrhappy View Post
                I have tried it and yes it will put a text box on the page with a submit button if you set the render type that way, if you do not set the interface property then when you press submit it will put the string that you put into this box into the device string. I guess then you can use this in your scripts to send the data to that IP address although would worry as to how often your IP address changes to whether you need to do this, also think of other users having access to this and may through no fault of their own change this device and stop your lighting working...
                Hmm, maybe learning to write a plugin would be a better idea....
                HS3 Pro on Windows 8 64bit
                53 Z-wave nodes(46 devices, 7 remotes), 15 DS10a's, 10 ms16a's, 9 Oregon Sensors, W800, RFXCOMtrx433, Way2Call, 3 HSTouch Clients, 2xRussound CAS44, Global Cache GC100-12,10 Rollertrol blinds(+ zwave) ,3 Squeezebox Radios and 1 Squeezebox Boom,DMX Arduino via ethernet,Rain8Net,3x Echo Dot's


                Check out my electronics blog here:
                https://www.facebook.com/RaptorsIrrationalInventions

                Comment


                  #9
                  I might've muddled things up, I originally thought that it might be a function that you can script but would only try and call a plugin when you updated it (a couple of the render types IIRC work this way). It will work from a script, this is what you need to do;

                  Code:
                  Sub Main(Parm As Object)
                  
                      Dim CurrRef As Integer = 0
                      Dim BaseRef As Integer = 0
                      Dim dv As Scheduler.Classes.DeviceClass = Nothing
                  
                      dv = hs.GetDeviceByRef(hs.NewDeviceRef("Test Device Creation"))
                      dv.Address(hs) = "Test-TestDevice"
                  
                      dv.Location(hs) = "Test"
                      dv.Last_Change(hs) = Now
                      dv.Device_Type_String(hs) = "Test Device"
                  
                      hs.DeviceVGP_ClearAll(dv.Ref(hs), True)
                      hs.DeviceVSP_ClearAll(dv.Ref(hs), True)
                  
                      Dim Pair As VSPair
                  
                      Pair = New VSPair(HomeSeerAPI.ePairStatusControl.Both)
                      Pair.PairType = VSVGPairType.SingleValue
                      Pair.Value = 1
                      Pair.Status = ""
                      Pair.Render = Enums.CAPIControlType.TextBox_String
                      hs.DeviceVSP_AddPair(dv.Ref(hs), Pair)
                      hs.SetDeviceValueByRef(dv.ref(hs), 1, True)
                      dv.MISC_Set(hs, Enums.dvMISC.SHOW_VALUES)
                  
                  End Sub
                  Run that it will create a box and a submit button on a new device, put text in the box and it will update the device string.

                  Comment


                    #10
                    Sorry, to ask , Would do you know how to convert this to work on linux?

                    I would like to create a string device to be able to easily send a string payload to a mqtt ( mcsmqtt) topic for this device.

                    Comment

                    Working...
                    X