I've had no problem controlling WD-200+ status mode LEDs from events, but now I'd like to do it from a script, and my Googling skills are letting me down. Can anyone give me a quick example of this? Sorry if this should be obvious to anyone experienced with HomeSeer scripts, but I am not. lol Any help is appreciated.
Announcement
Collapse
No announcement yet.
Controlling WD-200+ status mode LEDs from a script
Collapse
X
-
Originally posted by sparkman View PostIn the event, are they set based on a z-wave parameter change, or a device change?
Comment
-
Originally posted by Doug Meredith View Post
I'm not sure I fully understand your question, but I already have the event triggering and execution of the script worked out. The script has the devRef, the LED number, and the color. I just need to know what code will send the message to the device.HS 4.2.8.0: 2134 Devices 1252 Events
Z-Wave 3.0.10.0: 133 Nodes on one Z-Net
Comment
-
Thanks. Looking at the manual, it looks like it is based on z-wave parameter changes (https://homeseer.com/wp-content/uplo...0-Manual-4.pdf), so you can use the following method to set them in a script using the parameters and values in the manual. The script below requires the parameters to be passed to the script, but you could hard code as needed.
Code:Imports System.Text 'call Main with NodeID|ParameterNum|Value 'Based on http://board.homeseer.com/showpost.php?p=1176987&postcount=11 Sub Main(parms As String) Dim logName As String = "Z-Wave Param" 'set log name for HS log Dim debug As Boolean = True Dim param as String() = parms.Split("|") Dim HomeID as String = "your home ID here" Dim NodeID as String = param(0) Dim ParamNumber as String = param(1) Dim Value as String = param(2) Dim ConfigResult As Integer = 0 Dim ConfigResultVal() As String = {" is Unknown"," is Successful"," has been Queued"," has Failed"} Try ConfigResult = hs.PluginFunction("Z-Wave", "", "Configuration_Set", New Object(){HomeID, Convert.ToByte(NodeID), Convert.ToByte(ParamNumber), Convert.ToByte(1), Convert.ToInt32(Value)}) If Debug Then hs.WriteLog(logName, "Result of Parameter " & ParamNumber & " change to " & Value & " on Node " & NodeID & ConfigResultVal(ConfigResult)) Catch ex As Exception hs.writelog(logName, "Error: " & ex.Message.ToString) End Try End Sub
HS 4.2.8.0: 2134 Devices 1252 Events
Z-Wave 3.0.10.0: 133 Nodes on one Z-Net
Comment
-
Doug check out my Flash plugin. I have support for the switch done and dimmer 99% done (need a value from someone who can install it with the 200 dimmers).
The plugin lets you create led flash sequences which are then merged into what the device displays. This way your (say) garage dooor open to long event only needs to set and clear its sequence (say flash an indicator red every second) without stepping on your gate open too long events which flashes yellow every 5 seconds.
If your open to trying use this version. It has the 200+ dimmer support 99% done. If you try to configure an action with one your hslog will report the integer model number. It’s this number I need to finish support. The on/off switch model is already supported in this version, just the dimmer needs to be added.
Latest version : http://download.casapiedrasoftware.i...r_override.txt
Comment
-
I'm trying to do this in C# and I'm having some troubles... when I call the Configuration_Set plugin function, the change is made in the device, but then I get an exception printed to the console and the plugin stops processing. Even reloading it doesn't do anything, InitIO doesn't seem to be called at all.
Code:Setting config option 13 for [redacted] to 1 Exception deserializing message: Unable to find assembly 'HSPI_ZWave, Version=3.0.2.240, Culture=neutral, PublicKeyToken=null'.
Code:public override string InitIO(string port) { Program.WriteLog(LogType.Verbose, "InitIO"); SetZwaveConfigOption(679, 13, 1); SetZwaveConfigOption(679, 21, 0); return ""; } private void SetZwaveConfigOption(int devRef, byte parameterNumber, int parameterValue) { SetZwaveConfigOption(GetDeviceAddress(devRef), parameterNumber, parameterValue); } private void SetZwaveConfigOption(ZwaveAddress address, byte parameterNumber, int parameterValue) { SetZwaveConfigOption(address.HomeId, address.NodeId, parameterNumber, parameterValue); } private void SetZwaveConfigOption(string homeId, byte nodeId, byte parameterNumber, int parameterValue) { Program.WriteLog(LogType.Debug, "Setting config option " + parameterNumber + " for " + homeId + "-" + nodeId + " to " + parameterValue); try { hs.PluginFunction("Z-Wave", "", "Configuration_Set", new object[] { homeId, nodeId, parameterNumber, (byte) 1, parameterValue }); } catch (Exception ex) { // don't care } } private ZwaveAddress GetDeviceAddress(int devRef) { DeviceClass device = (DeviceClass) hs.GetDeviceByRef(devRef); string[] addressParts = device.get_Address(hs).Split('-'); return new ZwaveAddress { HomeId = addressParts[0], NodeId = byte.Parse(addressParts[1]) }; } }
Comment
Comment