get data from one vera lite to other vera lite

Transfer data from one VERA LITE (UI7) to VERA LITE (UI5)

I am running two vera lite at the same time (in the same network;
a) One veralite UI5 with standard apps (lighting etc) and a number of homemade applications
One application is the dutch smart meter with internet connection of the isk5meter
(fixed ip address with fixed gateway)

b) I have added a new vera lite running on UI7
With openterm gateway for the heating system (fixed ip address with fixed gateway)
All running smooth for a while separately.

Now i have moved the dutch smart meter to the UI7 unit and made connection to the iska meter with fixed ip and fixed gate.

I have two questions on which would like some advise;

Can I sent the following data

UI7(192.168.2.55) >UI5(192.168.2.100)
SM_ImporT1(KWH) ImportRate 1 (KWH),
SM_ImporT2(KWH) ImportRate 2 (KWH)
SM_ExporT1(KWH) ExportRate 1 (KWH)
SM_ExporT2(KWH) ExportRate2 (KWH)
SM_ImporGAS Gas

Is it better to sent to from the UI7 or read it from UI5 and what to use
My preference is to read the info from the UI5 from the UI7

You advice is much appreciated
Huib

after reading several posts on this forum i got the following;

xxx.xxx.x.xx:3480/data_request?id=variableget&DeviceNum=14&id=variableset&serviceId=urn:micasaverde-com:serviceId:EnergyMetering1&Variable=KHW
if i test i get the respond “OK”, so something happens

after reading and trying i came up with the following,but it does not work;
local status, result = luup.inet.wget("http://xxx.xxx.x.xx:3480/data_request?id=variableget&DeviceNum=14&id=variableset&serviceId=urn:micasaverde-com:serviceId:EnergyMetering1&Variable=KHW " ,3)

so some advise is helpfull
regards
Huib

[quote=“huib, post:2, topic:200309”]after reading and trying i came up with the following,but it does not work;
local status, result = luup.inet.wget("http://xxx.xxx.x.xx:3480/data_request?[b]id=variableget[/b]&DeviceNum=14&[b]id=variableset[/b]&serviceId=urn:micasaverde-com:serviceId:EnergyMetering1&Variable=KHW " ,3)[/quote]

Your request specifies the “id” parameter twice, so it’s likely getting clobbered. Try:

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

Also note that using the “:3480” port specifier will likely stop working at some future date; the replacement form is to use the /port_3480/ path.

@rigpapa

I have the following in a loop code but the file is not implementing, due to error in this part.

local http = require(“socket.http”)
local status, low = luup.inet.wget(“http://xxx.xxx.x.xx/port_3480/data_request?id=variableget&DeviceNum=14&output_format=text&serviceId=urn:micasaverde-com:serviceId:EnergyMetering1&Variable=KWH”)
luup.variable_set(“urn:Kuiper-com:serviceId:dutchSmartMeterCounter”, “Low”, Low, 94)

== running atUI5 (device 94 is dutchSmartMeterCounter)
Variable low is value to be taken from UI7 to UI5

== source running at UI7
Device 14 is dutchsmartmeter running at other vera

if i try the following if is working;
xxx.xxx.x.xx/port_3480/data_request?id=variableget&DeviceNum=14&output_format=text&serviceId=urn:micasaverde-com:serviceId:EnergyMetering1&Variable=KWH >> gives the correct value

can you advise?

regards
Huib

Your variable is called “low”, not “Low”.

Details matter.

@akboer
you are correct the details matters.

if i enter in the url xxx.xxx.x.xx/port_3480/data_request?id=variableget&DeviceNum=14&serviceId=urn:micasaverde-com:serviceId:EnergyMetering1&Variable=KWH_frac i get direct the respond of the value

if i use

luup.log(“dutchSmartMeterCounter import started”)
local http = require(“socket.http”)
local Status, LowMeter = luup.inet.wget(“http://xxx.xxx.x.xx/port_3480/data_request?id=variableget&DeviceNum=14&serviceId=urn:micasaverde-com:serviceId:EnergyMetering1&Variable=KWH_frac”,3)
luup.log(“dutchSmartMeterCounter import completed”)

i got the following in the log file

01 12/27/18 19:38:19.051 [31;1mLuImplementation::StartLua skipping device 94 implementation valid 1[0m <0x2bb9d680>

if i remove the line Local Status ===,3)
the file is implemened.
can it be that i am working on the internet in stead of local in the same network?

your advise is helpfull
regards
Huib

@ akboer

if i read on the wiki

function: wget
parameters: URL (String), Timeout (Number), Username (String), Password (String)
returns: operationStatusCode (Number), content (String), httpStatusCode (Number)

This reads the URL and returns 3 variables: the first is a numeric error code which is 0 if successful. The second variable is a string containing the contents of the page. The third variable is the HTTP status code. If Timeout is specified, the function will timeout after that many seconds. The default value for Timeout is 5 seconds. If Username and Password are specified, they will be used for HTTP Basic Authentication

it gives thee responds,

so should it not be
local operationStatus , LowMeter , httpStatus = luup.inet.wget ____
instead of
local Status, LowMeter = luup.inet.wget ____

regards
Huib

If you don’t actually check the status return value(s) then it really doesn’t matter.