Question about luup.variable_get and BatteryLevel

Hi,

Can you help me with this mistake please ?

[code]
– Action 1 : OK => t = 0
local t = luup.variable_get(“urn:micasaverde-com:serviceId:SecuritySensor1”, “Tripped”, 4)
luup.log(t)

– Action 2 : KO => t2 = nil
local t2 = luup.variable_get(“urn:micasaverde-com:serviceId:SecuritySensor1”, “BatteryLevel”, 4)
luup.log(t2)[/code]

I can retrieve “Tripped” but not “BatteryLevel”.

I don’t understand because the BatteryLevel is OK in Advanced Settings (see attachment).

I’m using Vera Lite UI5 and HSM02 Motion Sensor.

Many Thanks

I found the solution by chance looking at the logs.

I have to change the ServiceId.

local t2 = luup.variable_get("urn:micasaverde-com:serviceId:HaDevice1", "BatteryLevel", 4 )
luup.log(t2)

How can I find this information with UI5?

Most of the services, variables and actions used by MiOS can be found here: http://wiki.micasaverde.com/index.php/Luup_UPNP_Files#HaDevice
For others you must look in the Luup files: in the device files (D_…xml) to see the service IDs and in the service files (S_…xml) to see the variables and actions for a service.

Also going here:

http://:3480/data_request?id=lu_invoke

Can give you an idea of what type of parameters can be used with each device. It will not show all the variables, just ones that can take a request.

  • Garrett

Perfect

I have now finished setting up my new vera thanks to your advice.

Thank you very much.