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

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 #15 on: July 27, 2012, 08:10:31 pm »
Quote
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.
Yeap, it literally sets the value of the variable and then stops.  Typically consumers of a plugin would call Actions on that plugin to manipulate it's state.

In turn, these actions would make some sort of actual call to the physical device, it in's native protocol,and then the action's implementation would update one or more of the plugin's state variables with the "new state" information.

When you call luup.variable_set directly, you miss out on the part that calls the physical device.

In reverse, there are times that the physical device itself will communicate with Vera, over Z-Wave or whatever.  When this happens, Vera "copies" that latest state information into the State variables so they'll be "in sync" with the device (more or less, barring a multitude of bugs)

You can think of these variables as a cache of the current state of the device.  While you can tweak the cache value(s) directly, it has no impact on the physical device itself.


That said, if you're able to manipulate the device itself via the UI and get the desired [LED] behavior then you can just see what [Vera] API's those URL's are calling and then reproduce that.  This can be captured either in a tool like Wireshark (Browser -> Vera interactions) or by putting Vera into verbose logging mode and observing the output of /var/log/cmh/LuaUPnP.log as you interact in the UI.

In both cases, these techniques should give you a lot of clues as to next-steps.  I don't have any GE devices in my home so I'm not going to be handy for this exercise.

Offline oTi@

  • Beta Testers
  • Master Member
  • *****
  • Posts: 4045
  • Karma: +30/-6
  • UI what ?!
Re: Setting Z-Wave parameters via Luup
« Reply #16 on: July 28, 2012, 06:49:22 am »
  2 = LED is off always
Ah, interesting; they must have added that in newer versions of the device. (An additional always-on mode would have been handy for your application.)

Quote
And yes, I plan to set the value when the switch changes from off to on, or vice versa[...]
That's what I figured. I would not recommend using a Reconfigure action (urn:micasaverde-com:serviceId:HaDevice1) on the device then. I believe it is the underlying action for the Configure node right now button in the GUI. As said, that does too much and takes a while.

That leaves a DIY workaround with SendData. Give the following a go:

Code: [Select]
luup.call_action('urn:micasaverde-com:serviceId:ZWaveNetwork1','SendData',{Node='<nodeID>',Data='112 4 3 1 <mode>'},1)
Where <nodeID> is the Z-Wave NodeID (Settings->ID / Advanced->altid), so not the Device#, of the device, and <mode> is:
0: LED is on if switch is off
1: LED is on if switch is on
2: LED is off always

Tried it on the in-wall dimmer and outlet.

Also, keep in mind that the GE's do not support instant updates, so getting the status change relayed to Vera may not be (reliably) instant.
« Last Edit: July 28, 2012, 10:26:25 am by oTi@ »
Dezwaved at the moment...

Offline jimshaughn

  • Newbie
  • *
  • Posts: 7
  • Karma: +0/-0
Re: Setting Z-Wave parameters via Luup
« Reply #17 on: August 07, 2012, 10:55:12 am »
Took a break at the beach, now back at it. 
It seems if I replace my GE dimmer with a Leviton, then my problem is solved with some code.  Before I invest $100 though, I wanted to check a couple of things with you guys.
1. Does the Leviton dimmer provide instant status update?  I think you said that it did.
2. With some LUA code, the dimmer's LED can be updated dynamically according to the description in Garret's wiki at
 http://wiki.micasaverde.com/index.php/Leviton_LED_Debugging
3. What is the best Leviton dimmer to buy?

Offline garrettwp

  • Beta Testers
  • Master Member
  • *****
  • Posts: 6376
  • Karma: +226/-128
  • Vera 3, Lite, ISY994
Re: Setting Z-Wave parameters via Luup
« Reply #18 on: August 07, 2012, 11:01:18 am »
1. Yes, all leviton devices support instant status updates.

2. Only works on scene and zone controllers.

3. Depends on what you are controlling.

- Garrett

Offline oTi@

  • Beta Testers
  • Master Member
  • *****
  • Posts: 4045
  • Karma: +30/-6
  • UI what ?!
Re: Setting Z-Wave parameters via Luup
« Reply #19 on: August 09, 2012, 07:29:44 am »
3. What is the best Leviton dimmer to buy?
As @garrettwp said, it (only) depends on what you are controlling: use an 'I' for incandescent, 'M' for magnetic low-voltage , 'E' for electronic low-voltage loads; make sure not to exceed the W/VA rating (and possible de-rating if used in multi-gang). Example: VRI06 for incandescent lighting, no more than 600W total. (Side note: The incandescent ones have no neutral. Attempting to use those with LED lighting may yield limited success. So for LED lighting you may want to have a look at other options; folks have documented their results in various topics.)
Dezwaved at the moment...

Offline jimshaughn

  • Newbie
  • *
  • Posts: 7
  • Karma: +0/-0
Re: Setting Z-Wave parameters via Luup
« Reply #20 on: August 11, 2012, 10:31:48 pm »
Pardon the dumb question, Garrett, but is Vera a scene controller?  If not what is an example of one.

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 #21 on: August 11, 2012, 10:48:31 pm »
This is an example Leviton scene controller:
    http://store.homeseer.com/store/Leviton-VRCS4-M0Z-Z-Wave-4-Button-Scene-Controller-P611.aspx

The buttons can be used to trigger scenes, in Vera for example, and Vera can control its LEDs.  Typically scene controllers don't control a load directly, instead the tell the regular ZWave switches when to turn on/off





Offline jimshaughn

  • Newbie
  • *
  • Posts: 7
  • Karma: +0/-0
Re: Setting Z-Wave parameters via Luup
« Reply #22 on: August 12, 2012, 08:57:18 am »
Thanks, Guessed.

The reason I asked is that there is a device in Vera called a _Scene Controller. However, as I look more closely, it appears to be a template for the device you pointed me to ... although that is a guess.  I don't really know its purpose.

Trying hard to learn this stuff.  Not much out there to read other than this forum which is a great help.

Offline garrettwp

  • Beta Testers
  • Master Member
  • *****
  • Posts: 6376
  • Karma: +226/-128
  • Vera 3, Lite, ISY994
Re: Setting Z-Wave parameters via Luup
« Reply #23 on: August 12, 2012, 09:50:46 am »
Thanks, Guessed.

The reason I asked is that there is a device in Vera called a _Scene Controller. However, as I look more closely, it appears to be a template for the device you pointed me to ... although that is a guess.  I don't really know its purpose.

Trying hard to learn this stuff.  Not much out there to read other than this forum which is a great help.

Is the _Scene_Controller labeled #2_Scene_Controller? If this is the case, that is Vera itself. This is mostly hidden in plain site and only shows up when creating scenes etc. Not sure why it is not hidden complete. I am sure it has some purpose to be seen in some scenarios. As guessed pointed out what a scene controller is, to answer your question, yes vera is like a large scene controller. Hence the reason for the #2_Scene_Controller device in Vera.

- Garrett

Offline jimshaughn

  • Newbie
  • *
  • Posts: 7
  • Karma: +0/-0
Re: Setting Z-Wave parameters via Luup
« Reply #24 on: August 12, 2012, 01:23:20 pm »
Nope. It is not  #2_Scene Controller, just  _Scene Controller.  Device ID 15, but ID is 1.  15 is the lowest device number in my system.  So it is Udoubedly Vera, as Garrett suggests.   I am on a Vera Light, in case that matters.

Offline denikin

  • Newbie
  • *
  • Posts: 5
  • Karma: +0/-0
Setting Device options via Luup
« Reply #25 on: February 05, 2014, 04:12:32 pm »
Hello,
I have a Vera Lite as a controller, a termostat EVR_ST814 and plug-in EVR_AN1582.
I have to implement next functionality:
1. When I'm at home the termostat (Associated with plug-in) manages a heater.
2. When I'm away then the heater must be switched off independing on the termostat.

Termostat has variable parametrs Ton = 20 C and Toff = 25 C (device option 2 and 3). If the current temperature is below Ton then trigger switch on, if  current temperature is above Toff then trigger switch off. Unfortunately, the termostat doesn't send status of the triger to Vera Lite directly and I can't use the features of scenario to switch it off only associated mode.
But I can change the parametrs Ton and Toff via GUI. In this case I can set up Ton = 0 Toff = 2 and current temperature will be below  and heater will be switch off all the time.
There is a question:
Can I change the parametrs (Device option 2 and 3) Ton and Toff via LUUP and could somebody show me an example or template?
Thank you in advance.
Denis

Offline famvis

  • Newbie
  • *
  • Posts: 4
  • Karma: +0/-0
Re: Setting Z-Wave parameters via Luup
« Reply #26 on: February 11, 2014, 03:57:17 pm »
Hi,
I am also trying to send Configuration settings to my siren.
The target is: 10 seconds only flashing the light. (variable 0, 1Byte Dec, 2)
After this time send new configuration settings and switch the sound on.(variable 0, 1Byte Dec, 0)
How can I fix this?

Offline dmckenna

  • Full Member
  • ***
  • Posts: 189
  • Karma: +7/-2
Re: Setting Z-Wave parameters via Luup
« Reply #27 on: November 14, 2014, 12:27:36 pm »
Can someone please post this elegant solution....... It's hidden behind a google document link.

Found a quite elegant solution to the problem.

Link to source code:
https://docs.google.com/document/d/1OiUuMNuNA1CSTQmQtsfS68p95JbhlE5-i6pw_iBSWuM/edit?hl=en&authkey=CIvk9cwN

Offline blingal

  • Jr. Member
  • **
  • Posts: 60
  • Karma: +1/-0
Re: Setting Z-Wave parameters via Luup
« Reply #28 on: April 01, 2015, 06:01:02 pm »
It took me a while to figure this out, but finally the solution was very simple. Hopefully this will help someone along the way


luup.variable_set( "urn:micasaverde-com:serviceId:ZWaveDevice1", "ConfiguredVariable", "[Parameter no],[bytes for ex 1d],[Parameter value]", Device ID )
luup.variable_set( "urn:micasaverde-com:serviceId:ZWaveDevice1", "VariablesSet", "[Parameter no],[bytes for ex 1d],[Parameter value]", Device ID )


For example here I am setting the max dim level of a Fibaro dimmer to 15% by setting variable 12 which is 1 byte decimal to the value of 15:

luup.variable_set( "urn:micasaverde-com:serviceId:ZWaveDevice1", "ConfiguredVariable", "12,1d,15", 48 )
luup.variable_set( "urn:micasaverde-com:serviceId:ZWaveDevice1", "VariablesSet", "12,1d,15", 48 )


IMPORTANT: Use the advanced tab in the scene and execute a "Reconfigure command" - This will send the parameters to the device.

You can set multiple parameters at once by serialising the command, ie:
luup.variable_set( "urn:micasaverde-com:serviceId:ZWaveDevice1", "ConfiguredVariable", "4,2d,6000,3,1d,1", 95 )
which is parameter 4, 2bytes decimal, value 6000, parameter 3, 1 byte decimal, value 1

The parameters will not take effect until you send and complete the reconfigure command.

Offline jhanson999

  • Newbie
  • *
  • Posts: 7
  • Karma: +1/-0
Re: Setting Z-Wave parameters via Luup
« Reply #29 on: November 23, 2015, 04:57:28 pm »
Maybe someone can help me figure this out.  I just got a new aeon labs doorbell, and I want to be able to change the ringtones on the fly depending on the scenario.  I found the info for this via the zwave alliance (http://products.z-wavealliance.org/products/1307/embedconfigs), so I should be able to change it via a parameter set:

Parameter Number                Parameter Size                       Parameter Name                                     Parameter Values
6                                        1                                             Select a ringtone to play.                    Value                              Description
                                                                                                                                                     0                                      Stop playing.
                                                                                                                                                     From: 1   To: 100              Play the specified ringtone.

Anyway, I'm trying to figure out how to send say a value of 5 to parameter 6 via zwave senddata, but I don't understand the hex in the data package... the command vera lists in the example here (http://wiki.micasaverde.com/index.php/Luup_UPnP_Variables_and_Actions) shows:

1. Set parameter 29 to "3" on node 15:
luup.call_action("urn:micasaverde-com:serviceId:ZWaveNetwork1", "SendData", {Node=15, Data="x70 4 29 1 3"}, 1)

Can someone please explain to me how they get "x70 4 29 1 3"???