Author Topic: Setting Z-Wave parameters via Luup  (Read 20912 times)

Offline Ap15e

  • Beta Testers
  • Sr. Hero Member
  • *****
  • Posts: 2000
  • Karma: +11/-0
Setting Z-Wave parameters via Luup
« on: September 07, 2009, 07:12:40 am »
I would like to control the raising and lowering time of my Merten roller shutter devices. The raising and lowering time can be adjusted by changing Z-Wave parameters 177-180 (see http://www.merten.de/download/DL_doku/V5025_581_01_web.pdf, page 23). Can this be done via Luup as part of a scene?

More general question:
How can Z-Wave parameters be adjusted via Lua/Luup?

Of course, one could modify the appropriate configuration file and reload/reboot Vera,
but there must be an easier - and safer - way to achieve this.

Offline LibraSun

  • Hero Member
  • *****
  • Posts: 530
  • Karma: +0/-0
Re: Setting Z-Wave parameters via Luup
« Reply #1 on: September 07, 2009, 08:24:14 am »
Ap15e, what you want to accomplish should be easy:  Go to DEVICES, find your Merten, click the + button at right, and then the ADVANCED button below.

Parameters, 177, 178, 179 or 180 may already be present and contain a value - which you can change - or you may have to add a new Variable/Value pair by typing them in (click ADD).  Click SAVE to keep all changes.

(I'm not sure what "New Service:" means, as newer Luup firmware altered the language of these Advanced fields .. you may need to experiment, or ask MCV for clarification.  Sorry.)

MCV, is there a clear Wiki entry for adding these "Capabilities" to a device??  Should be one!
Vera Model I running UI4 (Firmware 1.1.1338) ? died in 2015
Vera Plus running UI7 () ? still waiting for tech support to fix!

Offline Ap15e

  • Beta Testers
  • Sr. Hero Member
  • *****
  • Posts: 2000
  • Karma: +11/-0
Re: Setting Z-Wave parameters via Luup
« Reply #2 on: September 07, 2009, 09:00:01 am »
Right, setting Z-Wave parameters via Vera's GUI is no challenge.

But what I am looking for is a way to configure these parameters via Lua/Luup.

Offline LibraSun

  • Hero Member
  • *****
  • Posts: 530
  • Karma: +0/-0
Re: Setting Z-Wave parameters via Luup
« Reply #3 on: September 07, 2009, 09:10:14 am »
Oops, I had suspected you already knew the UI approach!

I'll be interested to see if someone like 'guessed' can help you out with a Luup approach.
Vera Model I running UI4 (Firmware 1.1.1338) ? died in 2015
Vera Plus running UI7 () ? still waiting for tech support to fix!

Offline Ap15e

  • Beta Testers
  • Sr. Hero Member
  • *****
  • Posts: 2000
  • Karma: +11/-0
Re: Setting Z-Wave parameters via Luup
« Reply #4 on: September 13, 2009, 05:47:48 pm »
Pseudocode (untested):

  • res := urn:micasaverde-com:serviceId:HomeAutomationGateway1 -> GetVariable(DeviceNum, 'urn:micasaverde-com:serviceId:ZWaveDevice1', 'VariablesSet')
  • modify res
  • urn:micasaverde-com:serviceId:HomeAutomationGateway1 -> SetVariable(DeviceNum, 'urn:micasaverde-com:serviceId:ZWaveDevice1', 'VariablesSet', res)
  • urn:micasaverde-com:serviceId:HaDevice1 -> Reconfigure()

But there are at least two difficulties (1.0.918):

  • DeviceNum is declared as ui1, but some of my devices have DeviceNum > 16000
  • GetVariable does not work (even for devices with DeviceNum < 256; GetStatus plus parsing could be used as a workaround)

MCV, could you take a look at these issues, please?

Offline Ap15e

  • Beta Testers
  • Sr. Hero Member
  • *****
  • Posts: 2000
  • Karma: +11/-0
Re: Setting Z-Wave parameters via Luup
« Reply #5 on: September 16, 2009, 02:21:42 pm »
« Last Edit: March 31, 2011, 04:40:37 am by Ap15e »

Offline TedStriker

  • Jr. Member
  • **
  • Posts: 65
  • Karma: +2/-0
Re: Setting Z-Wave parameters via Luup
« Reply #6 on: September 16, 2009, 05:40:08 pm »
Very nice one! I think this can be used in other cases too.
ACT ZRM /ZDM has night lights within the switches which can be turned on/off by parameters.

What I'm thinking about is, when it's day, they could be turned off and otherwise in the night...
I'll give it a try the next few days. Thank you for this so far ;)

Offline Chris K.

  • Newbie
  • *
  • Posts: 12
  • Karma: +0/-0
Re: Setting Z-Wave parameters via Luup
« Reply #7 on: August 12, 2010, 04:38:38 am »
Does setting the raising and lowering times result in "dimmable" Merten roller shutter devices, that then support levels?

If yes: do I have to get these times by stopwatch or is there a kind of "stopwatch-/calibration-script" for a scene?

If no: is there another way to make them understand level-commands?

using Vera2 in Munich/Europe since June'10 with several MERTEN dimmers, switches, MERTEN roller-controls, DÜWI dimmers, iPhone, iPad, Mac-mini.
Planning to connect Vera to a mac-mini (eyeTV, iTunes etc) Planning a new iPhone/Android/iPad-UI based on Sencha Touch (http://www.sencha.com)

Offline Ap15e

  • Beta Testers
  • Sr. Hero Member
  • *****
  • Posts: 2000
  • Karma: +11/-0
Re: Setting Z-Wave parameters via Luup
« Reply #8 on: August 12, 2010, 05:21:38 am »
Replace the merten shutter devices with duewi shutter devices, see http://forum.micasaverde.com/index.php?topic=3359.0 - or ask merten to provide a firmware upgrade, which supports dimming ...

If you are going to use my script for merten shutter devices, you should add a check, that the 'Reconfigure' was successful.

http://forum.micasaverde.com/index.php?topic=3512.msg17078#msg17078 might be of interest, too.
« Last Edit: August 12, 2010, 07:10:59 am by Ap15e »

Offline Ap15e

  • Beta Testers
  • Sr. Hero Member
  • *****
  • Posts: 2000
  • Karma: +11/-0
Re: Setting Z-Wave parameters via Luup
« Reply #9 on: August 12, 2010, 05:29:31 am »
@micasaverde

There should be luup function for setting Z-Wave parameters.

Offline jimshaughn

  • Newbie
  • *
  • Posts: 6
  • Karma: +0/-0
Re: Setting Z-Wave parameters via Luup
« Reply #10 on: July 27, 2012, 09:56:43 am »
I have a Vera Lite installed and it is functioning superbly.  Also, I have a GE ZW3003 dimmer which is also working quite well. 

I would like to use the blue LED on the ZW3003 as a signal to indicate that my part of my system is armed.   I have tried to get the LUA code to turn the LED on and off by setting the ConfiguredVariable parameter, but that has not been successful. 
Here's the code:

luup.variable_set("urn:micasaverde-com:serviceId:Dimming1","ConfiguredVariable","3,1d,2",nn)  where nn is my device no.
(The "3,1d,2" turns the LED off.)

Also tried:  luup.variable_set("urn:micasaverde-com:serviceId:ZWaveDevice1","ConfiguredVariable","3,1d,2",nn)
and this:    luup.variable_set("urn:micasaverde-com:serviceId:Dimming1","VariablesSet","3,1d,2",nn)
and this:    luup.variable_set("urn:micasaverde-com:serviceId:ZWaveDevice1","VariablesSet","3,1d,2",nn)

The device/Vera accepts the code, but the device does not change the parameter.  Ap15e posted some code in GoogleDocs a while back, but that code is locked. 

I have been writing code forever, but this stuff is new to me, and frankly, it is not well documented.  Any help would be appreciated.

Does anyone has some sample code that allows turning the LED on and off?

Offline garrettwp

  • Beta Testers
  • Master Member
  • *****
  • Posts: 6376
  • Karma: +226/-128
  • Vera 3, Lite, ISY994
Re: Setting Z-Wave parameters via Luup
« Reply #11 on: July 27, 2012, 12:13:50 pm »
Does the device even support the modification of the led? The only devices that I know of that allow the modification of the led is the Leviton scene  and zone controllers.

- Garrett

Offline guessed

  • Master Member
  • *******
  • Posts: 5294
  • Karma: +90/-22
  • Release compat is not a bolted-on afterthought
Re: Setting Z-Wave parameters via Luup
« Reply #12 on: July 27, 2012, 12:26:47 pm »
Setting Variables via variable_set does just that, these values are not propagated to the physical device.  You'll probably need to muck with the SendData service method.... If those devices are able to take commands, and you can work out how to send it in ZWave form.

For the Leviton's, there's a built in method as Garrett indicates:
    http://wiki.micasaverde.com/index.php/Leviton_LED_Debugging

Offline oTi@

  • Beta Testers
  • Master Member
  • *****
  • Posts: 4045
  • Karma: +30/-6
  • UI what ?!
Re: Setting Z-Wave parameters via Luup
« Reply #13 on: July 27, 2012, 12:34:29 pm »
@jimshaughn,

Welcome!

You'd probably have to do a Reconfigure on the device to actually get the settings updated in the device itself, not just the variable in Vera.
Reconfigure is a bit of a crude method though, as it does 'too much'. However, I'm not aware of a call (other than low-level Z-Wave) to rewrite just the configuration parameter in the device.

Also, I'm guessing the LED parameter takes 0 or 1 as a value, but perhaps anything other than 0 is fine to invert.

Are you going to invert the LED with every state toggle, also?

Edit:
partial cross-reply with @guessed; the low-level Z-Wave command I mentioned, is the SendData @guessed is referring to.
« Last Edit: July 27, 2012, 12:37:21 pm by oTi@ »
Dezwaved at the moment...

Offline jimshaughn

  • Newbie
  • *
  • Posts: 6
  • Karma: +0/-0
Re: Setting Z-Wave parameters via Luup
« Reply #14 on: July 27, 2012, 06:36:09 pm »
Does the device even support the modification of the led? The only devices that I know of that allow the modification of the led is the Leviton scene  and zone controllers.

- Garrett
The doc for the GE ZW3003 switch says that:
  0 = LED is on if switch is off (default)
  1 = LED is on if switch is on
  2 = LED is off always
By setting this manually in Configuration Settings under Device Options on the Vera, it works as advertised.  So one would assume it should also be programmable because the result gets posted to the Advanced variable, "urn:micasaverde-com:ServiceId:ZWaveDevice1, ConfiguredVariable".  Go figure.

Setting Variables via variable_set does just that, these values are not propagated to the physical device.  You'll probably need to muck with the SendData service method.... If those devices are able to take commands, and you can work out how to send it in ZWave form.

For the Leviton's, there's a built in method as Garrett indicates:
    http://wiki.micasaverde.com/index.php/Leviton_LED_Debugging

Guessed, I am not sure what you mean, "... does just that, ... "  Do you mean it gets posted in Vera, but not transmitted to the physical device?  That would match the symptoms, except that the ConfiguredVariable field does sometimes change, but it is not consistent.  I'm not certain why.  Perhaps I should be more rigorous in my testing.


You'd probably have to do a Reconfigure on the device to actually get the settings updated in the device itself, not just the variable in Vera.
Reconfigure is a bit of a crude method though, as it does 'too much'. However, I'm not aware of a call (other than low-level Z-Wave) to rewrite just the configuration parameter in the device.

Also, I'm guessing the LED parameter takes 0 or 1 as a value, but perhaps anything other than 0 is fine to invert.

Are you going to invert the LED with every state toggle, also?

Edit:
partial cross-reply with @guessed; the low-level Z-Wave command I mentioned, is the SendData @guessed is referring to.

The parameter it takes is: "3,1d,n", where n is the value I mention in reply to Garret above.  The 3 means parameter 3 in the switch (7 sets the dimming rate, 9 sets the steps in dimmer's rocker, etc. etc.) ... 1d is the format, that is, 1 byte decimal.  All this works fine manually, so I suspect you are correct that this is never getting downloaded to the device.  And yes, I plan to set the value when the switch changes from off to on, or vice versa,but is also being driven by other events such as a sensor being tripped.

Any help on "Reconfigure" and the SendData command would be appreciated.