Retrieve Variable from a 2nd Vera

Can anyone help me get a variable from another Vera into my VariableContainer?

I am stuck here:

–call to the other vera
local WeatherCondition=luup.variable_get(“http://10.0.1.25:3480/data_request?id=variableget&DeviceNo=89&serviceId=urn:upnp-micasaverde-com:serviceId:Weather1&Variable=Condition”)

– store the retrieved data in Variable Container (this part works)
luup.variable_set(“urn:upnp-org:serviceId:VContainer1”,“Variable3”,WeatherCondition,22)

Try using this form:

local status, result = luup.inet.wget(“http://192.168.0.11:3480/data_request?id=variableget&DeviceNum=131&serviceId=urn:upnp-org:serviceId:TemperatureSensor1&Variable=CurrentTemperature” ,3)

[quote=“racarter, post:2, topic:179483”]Try using this form:

local status, result = luup.inet.wget(“http://192.168.0.11:3480/data_request?id=variableget&DeviceNum=131&serviceId=urn:upnp-org:serviceId:TemperatureSensor1&Variable=CurrentTemperature” ,3)[/quote]

Worked. Much appreciated.

What is the “3” for? String?

Timeout in seconds.

http://wiki.micasaverde.com/index.php/Luup_Lua_extensions#function:_wget

terrific. I love learning this stuff.

Me too ;D

can you assist

i would like to do roughly te same as you

getinfo from veralite ui7 in to vera lite ui5

instruction written in ui5

local http = require(“socket.http”)
local status, result = luup.inet.wget("http://xxx.xxx.x.xx:3480/data_request?id=variableget&DeviceNum=14&serviceId=urn:micasaverde-com:serviceId:EnergyMetering1&Variable=KHW " ,3)

and luup file wil not me implemented, so something is not correct
can you advise

regards
huib

Can’t help thinking that perhaps “KHW” should be “KWH” ?

@akboer thanks for the typo; after a while you do not see clear

xx.xxx.x.xx:3480/data_request?id=variableget&DeviceNum=14&serviceId=urn:micasaverde-com:serviceId:EnergyMetering1&Variable=KWH

gives a clear respond 12345

if i make this an I_file it wont be implemented

local http = require(“socket.http”)
local status, result = luup.inet.wget(“http://xxx.xxx.x.xx:3480/data_request?id=variableget&DeviceNum=14&serviceId=urn:micasaverde-com:serviceId:EnergyMetering1&Variable=KWH”)

can you assist?

regards
Huib

Why would you want this to be in an I_xxx file?

Depends on your use-case, of course, but it’s probably easiest to put it into the Lua code of a scene and schedule that as required.

I have changed the dutchsmartmeter from one vera ui5 to the other machine ui7
Now i want to transfer the readings from one machine to the other to keep daily and monthly track of consumptions

For this i have made plugin which takes on a regulair bases the data from the smart meter into my app
For this i have made an I file

Now i want to get the info from the other vera and would like to incoperate this in the app

So if you can advice how to instruct this in the program i would be greatfull
If need be i can sent the file to you

Rgds
Huib