We have moved at community.getvera.com

Author Topic: Retrieve Variable from a 2nd Vera  (Read 1458 times)

Offline BulldogLowell

  • Hero Member
  • *****
  • Posts: 1576
  • Karma: +191/-85
Retrieve Variable from a 2nd Vera
« on: February 12, 2014, 10:29:11 am »
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)

Offline racarter

  • Hero Member
  • *****
  • Posts: 519
  • Karma: +12/-4
Indigo, Vera Edge (for Datamine only), Everspring and TKBHOME socket switches, SM103 door detectors, Homepro ZRP210 appliance modules, Fibaro relay switches, EZMotion, Heatmiser thermostats, Netatmo Weather, Camera and Healthy Home, Hikvision DVR/CCTV, Sonos, Texecom, Diax motorised deadlock.

Offline BulldogLowell

  • Hero Member
  • *****
  • Posts: 1576
  • Karma: +191/-85
Re: Retrieve Variable from a 2nd Vera
« Reply #2 on: February 12, 2014, 03:43:05 pm »

Offline racarter

  • Hero Member
  • *****
  • Posts: 519
  • Karma: +12/-4
Indigo, Vera Edge (for Datamine only), Everspring and TKBHOME socket switches, SM103 door detectors, Homepro ZRP210 appliance modules, Fibaro relay switches, EZMotion, Heatmiser thermostats, Netatmo Weather, Camera and Healthy Home, Hikvision DVR/CCTV, Sonos, Texecom, Diax motorised deadlock.

Offline BulldogLowell

  • Hero Member
  • *****
  • Posts: 1576
  • Karma: +191/-85
Re: Retrieve Variable from a 2nd Vera
« Reply #4 on: February 12, 2014, 03:53:03 pm »
terrific.  I love learning this stuff.

Offline racarter

  • Hero Member
  • *****
  • Posts: 519
  • Karma: +12/-4
Re: Retrieve Variable from a 2nd Vera
« Reply #5 on: February 12, 2014, 05:49:03 pm »
Me too  ;D
Indigo, Vera Edge (for Datamine only), Everspring and TKBHOME socket switches, SM103 door detectors, Homepro ZRP210 appliance modules, Fibaro relay switches, EZMotion, Heatmiser thermostats, Netatmo Weather, Camera and Healthy Home, Hikvision DVR/CCTV, Sonos, Texecom, Diax motorised deadlock.

Offline huib

  • Full Member
  • ***
  • Posts: 179
  • Karma: +0/-0
Re: Retrieve Variable from a 2nd Vera
« Reply #6 on: December 26, 2018, 07:24:10 am »
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
- veralite UI5 - veralite UI7 - 9 fibaro dimmers - 7 fibaro switches - 2 eminent movement sensors - remote control - opentherm gateway - remote powermeter reading - control of whr930 unit - control of washing machine -

Offline akbooer

  • Beta Testers
  • Master Member
  • *****
  • Posts: 6387
  • Karma: +290/-70
  • "Less is more"
Re: Retrieve Variable from a 2nd Vera
« Reply #7 on: December 26, 2018, 08:34:01 am »
Can't help thinking that perhaps "KHW" should be "KWH" ?
3x Vera Lite-UI5/Edge-UI7, 25x Fibaro, 23x TKB, 9x MiniMote, 2x NorthQ Power, 2x Netatmo, 1x Foscam FI9831P, 9x Philips Hue,
Razberry, MySensors Arduino, HomeWave, AltUI, AltHue, DataYours, Grafana, openLuup, ZWay, ZeroBrane Studio.

Offline huib

  • Full Member
  • ***
  • Posts: 179
  • Karma: +0/-0
Re: Retrieve Variable from a 2nd Vera
« Reply #8 on: December 26, 2018, 10:00:41 am »
@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
- veralite UI5 - veralite UI7 - 9 fibaro dimmers - 7 fibaro switches - 2 eminent movement sensors - remote control - opentherm gateway - remote powermeter reading - control of whr930 unit - control of washing machine -

Offline akbooer

  • Beta Testers
  • Master Member
  • *****
  • Posts: 6387
  • Karma: +290/-70
  • "Less is more"
Re: Retrieve Variable from a 2nd Vera
« Reply #9 on: December 26, 2018, 10:04:02 am »
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.
3x Vera Lite-UI5/Edge-UI7, 25x Fibaro, 23x TKB, 9x MiniMote, 2x NorthQ Power, 2x Netatmo, 1x Foscam FI9831P, 9x Philips Hue,
Razberry, MySensors Arduino, HomeWave, AltUI, AltHue, DataYours, Grafana, openLuup, ZWay, ZeroBrane Studio.

Offline huib

  • Full Member
  • ***
  • Posts: 179
  • Karma: +0/-0
Re: Retrieve Variable from a 2nd Vera
« Reply #10 on: December 26, 2018, 10:50:41 am »
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
- veralite UI5 - veralite UI7 - 9 fibaro dimmers - 7 fibaro switches - 2 eminent movement sensors - remote control - opentherm gateway - remote powermeter reading - control of whr930 unit - control of washing machine -