getting and setting a device parameter without a variable name

hi,

i know how to get/set variables that exist within a device that have a variable name, for instance:

local LBayCurrentState = luup.variable_get(“urn:micasaverde-com:serviceId:SecuritySensor1”, “Tripped”,60 )

this returns the value of Tripped for device #60

But what if the parameter i want to get isn’t a variable listed on the advanced/variables page? I have a Fibaro FGMS-0001 and I want to get/set parameter 80 (1d) with Luup code. (80 controls the LED color and mode). but there isnt a variable named ‘LED signalling mode’ on the device variables page.

thanks for any help

What you’re looking for are not Luup device variables, but parameters of the (hardware) device that you want to configure. These are accessible from the device’s Options page (assuming you’re on UI7 here) under Add Configuration Settings.

This will open up a form which allows you to select the parameters (eg. your parameter #80), the data size (can be important to get this right - you probably need the documentation for the device) and the value, and then save the changes.

thanks for the reply!

I found those parameters and used them to successfully setup my device, but now I want to change them via a scene trigger. When scene X fires I want to set parameter 80 to value X, and when scene Y fires, I want to set that parameter to value Y.

Maybe that is something I cant do since these parameters are not variables?

ok, i’ve got it. (I included the http format here instead of luup becuase it was easier to develop with http.)

ip:3480/data_request?id=status&output_format=xml&DeviceNum=88

gives me a list of the serviceIDs from which i send this:

ip:3480/data_request?id=variableset&DeviceNum=88&serviceId=urn:micasaverde-com:serviceId:ZWaveDevice1&Variable=VariablesSet&Value=“86,1d,18,89,1d,0,87,1d,28,80,1d,22,81,1d,100”

which sets my new value for parameter 80 to 22

I check it with

ip:3480/data_request?id=variableget&DeviceNum=88&serviceId=urn:micasaverde-com:serviceId:ZWaveDevice1&Variable=VariablesGet

and after the device wakes and configures it works!

i just am not sure if i need to send all of the variables returned by variableGet, or just the ones I am changing

This is an interesting one. My understanding of this is as follows (I may be wrong):

When you use VariablesSet - this appears to be a one shot. Vera uses the value next time it configs the Z-Wave device(s). It then reports the changes via ConfiguredVariable. VariablesGet just returns the VariablesSet value. If you write an empty string with VariablesSet, VariablesGet will be empty. ConfiguredVariable contains info that probably comes from some file in Vera or down off the net.

If I want to just read all the registers in a Z-Wave device - I can’t. The problem is, if a value is changed accidentally somehow, you have no way of knowing that. If any one knows how all the registers can be read, then please show how.

You can copy the following code into the browser test code box to show all the config info in the log file:

[code]local PLUGIN_NAME = ‘ZWConfigInfo’
local DEBUG_MODE = true

local function debug(textParm, logLevel)
if DEBUG_MODE then
local text = ‘’
local theType = type(textParm)
if (theType == ‘string’) then
text = textParm
else
text = 'type = ‘…theType…’, value = ‘…tostring(textParm)
end
luup.log(PLUGIN_NAME…’ debug: '…text,50)

elseif (logLevel) then
    local text = ''
    if (type(textParm) == 'string') then text = textParm end
    luup.log(PLUGIN_NAME..' debug: '..text, logLevel)
end

end

– Find out which device is the Z-Wave controller. It’s normally
– ‘1’ but we’ll make sure by finding it programmatically. However,
– we “assume” it always exists.
– There may be more than 1 if there are secondary controllers
– attached as UPnP devices. We prefer #1 if it exists.
function getZWInterfacelId()
local DEVICE_CATEGORY_ZWAVE_INT = 19
local zwInt = -1
v = luup.devices[1];
if v ~= nil and v.category_num == DEVICE_CATEGORY_ZWAVE_INT then
return 1
end
for k, v in pairs(luup.devices) do
if (v.category_num == DEVICE_CATEGORY_ZWAVE_INT) then
zwInt = k
end
end
return zwInt
end

– Get the Z-Wave config info
local function getZWConfigInfo()
local zwInt = getZWInterfacelId()

-- extract the info about the Z-Wave devices
for k, v in pairs(luup.devices) do
    -- we're only interested in the Z-Wave devices
    if (v.device_num_parent == zwInt) then
        debug(v.description)
        
        local ZWvars1= luup.variable_get("urn:micasaverde-com:serviceId:ZWaveDevice1", "ConfiguredVariable", k)
        if (ZWvars1) then debug('ConfiguredVariable, Device id: '..k..' = '..ZWvars1)
        else debug('ConfiguredVariable, Device id: '..k..' = nil') end

        local ZWvars2 = luup.variable_get("urn:micasaverde-com:serviceId:ZWaveDevice1", "VariablesSet", k)
        if (ZWvars2) then debug('VariablesSet,       Device id: '..k..' = '..ZWvars2)
        else debug('VariablesSet,       Device id: '..k..' = nil') end

        local ZWvars3 = luup.variable_get("urn:micasaverde-com:serviceId:ZWaveDevice1", "VariablesGet", k)
        if (ZWvars3) then debug('VariablesGet,       Device id: '..k..' = '..ZWvars3..'\n')
        else debug('VariablesGet,       Device id: '..k..' = nil\n') end

    end
end

end

getZWConfigInfo()

return true
[/code]

To change the config info using Lua, you typically would:

luup.variable_set("urn:micasaverde-com:serviceId:ZWaveDevice1", "VariablesSet", "a_string_containing_the_config_info_request", SOME_DEVICE_ID) luup.call_action("urn:micasaverde-com:serviceId:HaDevice1", "Reconfigure", {}, SOME_DEVICE_ID) luup.call_action("urn:micasaverde-com:serviceId:HomeAutomationGateway1", "Reload", {}, 0)

I’m not sure, if the reload (last line above) is required or not. I’ve not tried it.