Announcement

Collapse
No announcement yet.

Z-Wave Device Parameters & Scripting

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

  • gthensl
    replied
    That is what I was using the reference number.

    Thank you for helping me. I am new to this scripting stuff. I am just a lowly PLC programmer.

    Leave a comment:


  • sparkman
    replied
    Originally posted by gthensl View Post
    Sparkman,

    I have tried what you suggested .tobyte(2) (447), but that gave me an error also. Now I don't know what to do. I want to get my Dome siren working for different doorbells, but can't if I can't get that to work.

    Thanks
    Can you post the whole script command that you are trying to use? Just realized that you are talking about the node ID, not the value you are trying to set it to. There can be no z-wave node ID that is 447. Make sure you are using the z-wave node number, not the the HS device's reference number.

    Leave a comment:


  • gthensl
    replied
    Sparkman,

    I have tried what you suggested .tobyte(2) (447), but that gave me an error also. Now I don't know what to do. I want to get my Dome siren working for different doorbells, but can't if I can't get that to work.

    Thanks

    Leave a comment:


  • sparkman
    replied
    Originally posted by gthensl View Post
    I have ran into the same problem and have narrowed it down to the nodeID(447) to convert to a byte. Of course, 447 is larger than a byte have have tried the same as you have, .toInt and received the same results.

    Have you had any luck? Where is the 'Pluginfunction("zwave"....' documented at? I have search the help file and the web and haven't found anything yet.


    Thanks
    Did you try what I had suggested to jvm in my previous post? What happens when you try that?

    PluginFunction is documented here: https://help.homeseer.com/help/HS3/s...pluginfunction. However, each plugin does their own thing with that and the z-wave plugin does not have public documentation on the available functions. You can use visual studio to look at the functions within the plugin itself, but it's sparsely documented there as well.

    Leave a comment:


  • gthensl
    replied
    I have ran into the same problem and have narrowed it down to the nodeID(447) to convert to a byte. Of course, 447 is larger than a byte have have tried the same as you have, .toInt and received the same results.

    Have you had any luck? Where is the 'Pluginfunction("zwave"....' documented at? I have search the help file and the web and haven't found anything yet.


    Thanks

    Leave a comment:


  • sparkman
    replied
    Check the documentation for the parameter that you are trying to set. I believe the "Convert.ToByte(1)" should be changed to the the number of bytes the parameter is. If it's 2 bytes, then change to "Convert.ToByte(2)", if it's 4 bytes, change to "Convert.ToByte(4)", etc. I don't have access to my system right now to confirm, so I'm doing an educated guess on that, based on the error that you are getting.

    Leave a comment:


  • jvm
    replied
    Originally posted by sparkman View Post

    Are you doing this as an immediate script command, or a full script? If the former, then use &nhs rather than &hs as you are using VB.NET syntax. &hs expects VBScript syntax.
    Thanks. I was trying for "immediate". Your &nhs suggestion gave me some progress (well, at least a something different!). I now get a different error: "Running script C:\Program Files (x86)\HomeSeer HS3\Temp\K1.vb :Exception has been thrown by the target of an invocation.Value was either too large or too small for an unsigned byte."

    I'm guess it may be in the conversion of the NodeID by the function Convert.ToByte(284) for the node id #284. I've also tried Convert.ToInt16 and Convert.ToInt32 which then give a different error ("cannot be converted to type 'System.Byte'").

    Any further thoughts or working "immediate" script examples appreciated.

    Leave a comment:


  • sparkman
    replied
    Originally posted by jvm View Post
    Can someone break this down for me to a very simple level. Specifically, I'd like to have an event with an immediate script which sets parameter 10 of device reference 284 to the value 5 for home ID "ABABABAB". I found the following general form for the set command:

    hs.PluginFunction("Z-Wave", "", "Configuration_Set", New Object(){HomeID, Convert.ToByte(NodeID), Convert.ToByte(ParamNumber), Convert.ToByte(1), Convert.ToInt32(Value)})

    And applying it to the example, came up with the script:

    &hs.PluginFunction("Z-Wave", "", "Configuration_Set", New Object(){"ABABABAB", Convert.ToByte(284), Convert.ToByte(10), Convert.ToByte(1), Convert.ToInt32(5)})


    But when this executes, I get an Init Error, Expected End of Statement.
    Anybody know what I'm doing wrong?

    Any working example of an immediate script setting a parameter value would be appreciated!

    Thanks.
    Are you doing this as an immediate script command, or a full script? If the former, then use &nhs rather than &hs as you are using VB.NET syntax. &hs expects VBScript syntax.

    Leave a comment:


  • jvm
    replied
    Can someone break this down for me to a very simple level. Specifically, I'd like to have an event with an immediate script which sets parameter 10 of device reference 284 to the value 5 for home ID "ABABABAB". I found the following general form for the set command:

    hs.PluginFunction("Z-Wave", "", "Configuration_Set", New Object(){HomeID, Convert.ToByte(NodeID), Convert.ToByte(ParamNumber), Convert.ToByte(1), Convert.ToInt32(Value)})

    And applying it to the example, came up with the script:

    &hs.PluginFunction("Z-Wave", "", "Configuration_Set", New Object(){"ABABABAB", Convert.ToByte(284), Convert.ToByte(10), Convert.ToByte(1), Convert.ToInt32(5)})


    But when this executes, I get an Init Error, Expected End of Statement.
    Anybody know what I'm doing wrong?

    Any working example of an immediate script setting a parameter value would be appreciated!

    Thanks.

    Leave a comment:


  • Toby
    replied
    i'm trying to configure a dimmer.
    i have the following code
    Code:
        Public Function SetSingleParameter(ByVal homeid As String, ByVal nodeID As Byte, ByVal Parameter As Byte, ByVal ParamSize As Byte, ByVal value As Int32) As Integer
    
            Dim ConfigResult As Integer = 0
            Dim ConfigResultVal(3) As String
    
            ConfigResultVal(0) = "Unknown"
            ConfigResultVal(1) = "Success"
            ConfigResultVal(2) = "Queued"
            ConfigResultVal(3) = "Failed"
    
            ConfigResult = Convert.ToInt16(hs.PluginFunction("Z-Wave", "", "Configuration_Set", New Object() {homeid, nodeID, Parameter, ParamSize, value}))
    
            Log(("ZWave Node " & nodeID & " on Network " & homeid & ": Parameter Set " & Parameter & " Value: " & value & " -  Result " & ConfigResultVal(ConfigResult)), LogType.Debug)
            Return ConfigResult
        End Function

    Leave a comment:


  • sparkman
    replied
    Originally posted by Toby View Post
    is there a delay also when you guys are testing this function?
    I don't get any errors when using the function and it is generally completed very fast. As an example I set a number of parameters on my Dome siren/chime in quick succession using the script here: https://forums.homeseer.com/forum/de...e-siren-script. Maybe post your whole script. What kind of device are you trying to set the parameter on?

    Leave a comment:


  • Toby
    replied
    is there a delay also when you guys are testing this function?

    Leave a comment:


  • Toby
    replied
    Originally posted by sparkman View Post
    Yes, what's the error message you get in the logs and are you running this on linux? If linux, use this instead (will work on Windows as well):
    Code:
    ConfigResult = hs.PluginFunction("Z-Wave", "", "Configuration_Set", New Object(){HomeID, Convert.ToByte(NodeID), Convert.ToByte(ParamNumber), Convert.ToByte(1), Convert.ToInt32(Value)})
    I get this error:
    Exception deserializing message: Unable to find assembly 'HSPI_ZWave, Version=3.0.1.252, Culture=neutral, PublicKeyToken=null'. in the console window right away and it stalls for some time and then I get an exception thrown "ConfigDevicePost: Object reference not set to an instance of an object. in the Homeseer log.

    The Configuration_Get part works fine, but not the _Set...

    I'm running windows10

    Edit: I found out that the parameter is actually set, but it still stalls for 20s and then throws an exception..
    when i read it out later with
    Code:
     newValue = Convert.ToInt16(hs.PluginFunction("Z-Wave", "", "Configuration_Get", New Object() {homeid, nodeID, Parameter}))
    it reads out the new value quite fast.

    how to set a value without delay and errors?

    Leave a comment:


  • sparkman
    replied
    Originally posted by Toby View Post
    I'm trying out this set command in a script but it's failing... should this Configuration_set command still work?

    hs.PluginFunction("Z-Wave", "", "Configuration_Set", {homeid, nodeID, Parameter, ParamSize, Convert.ToInt32(value)})
    Yes, what's the error message you get in the logs and are you running this on linux? If linux, use this instead (will work on Windows as well):

    Code:
    ConfigResult = hs.PluginFunction("Z-Wave", "", "Configuration_Set", New Object(){HomeID, Convert.ToByte(NodeID), Convert.ToByte(ParamNumber), Convert.ToByte(1), Convert.ToInt32(Value)})

    Leave a comment:


  • Toby
    replied
    I'm trying out this set command in a script but it's failing... should this Configuration_set command still work?

    hs.PluginFunction("Z-Wave", "", "Configuration_Set", {homeid, nodeID, Parameter, ParamSize, Convert.ToInt32(value)})

    Leave a comment:

Working...
X