We have moved at community.getvera.com

Author Topic: Datayours in Openluup environment  (Read 567 times)

Offline d55m14

  • Sr. Member
  • ****
  • Posts: 449
  • Karma: +8/-1
Datayours in Openluup environment
« on: February 24, 2018, 01:12:41 pm »
Hi akbooer,

can you remember me how to define the DY parameters (daemons, local_data_dir, destinations, etc..) if I install it in a Openluup environment on a Unix system (Debian for example) without ALTUI ?

tnks

donato

Offline akbooer

  • Moderator
  • Master Member
  • *****
  • Posts: 6387
  • Karma: +290/-70
  • "Less is more"
Re: Datayours in Openluup environment
« Reply #1 on: February 24, 2018, 01:59:21 pm »
Wow! You are making life quite hard for yourself.

All the DataYours device variables belong to the serviceId "urn:akbooer-com:serviceId:DataYours1", so your can set these with a browser HTTP request...

Code: [Select]
http://ip_address:3480/data_request?id=variableset&DeviceNum=42&serviceId=urn:akbooer-com:serviceId:DataYours1&Variable=LOCAL_DATA_DIR&Value=...

DataWatcher, etc, keep their own configuration in files which you could edit, but also they have their own HTTP interface:

Code: [Select]
http://172.16.42.129:3480/data_request?id=lr_DataWatcher&watch=dev.service.var

turns on watching of that variable.  &nowatch=... turns it off.

Code: [Select]
http://172.16.42.129:3480/data_request?id=lr_DataWatcher&show=config

responds like this:
Code: [Select]
DataWatcher CONFIGURATION at Sat Feb 24 18:51:51 2018

DAEMON = {
  VERSION = "2016.10.10",
  client = "DataWatcher",
  destinations = {"127.0.0.1:2003"},
  errors = {count = 0},
  http = {received = 3},
  ip = "172.16.42.129",
  start_time = "Sat Feb 24 17:45:07 2018",
  udp = {
    last_received = {},
    last_sent = {["127.0.0.1:2003"] = "VeraEdge.MemFree.d 43236 1519498308"},
    received = 0,
    sent = 1859
  }
}

DATAWATCHER = {
  VERSION = "2017.09.18",
  live_energy_usage = {
    ["Vera-88800000.20352.urn:micasaverde-com:serviceId:EnergyMetering1.EnergyUsage"] = {"Study Module",0},
    ["Vera-88800000.20353.urn:micasaverde-com:serviceId:EnergyMetering1.EnergyUsage"] = {"Study Ceiling",0},
    ["Vera-88800000.20366.urn:micasaverde-com:serviceId:EnergyMetering1.EnergyUsage"] = {"Julia Ceiling",0},
    ["Vera-88800000.20371.urn:micasaverde-com:serviceId:EnergyMetering1.EnergyUsage"] = {"Loft Temp Humidity",124},
    ["Vera-88800000.20373.urn:micasaverde-com:serviceId:EnergyMetering1.EnergyUsage"] = {"Loft Humidity",63},
    ["Vera-88800000.30008.urn:micasaverde-com:serviceId:EnergyMetering1.EnergyUsage"] = {"Far Beam",0},
    ["Vera-88800000.30013.urn:micasaverde-com:serviceId:EnergyMetering1.EnergyUsage"] = {"Near Beam",0},
    ["Vera-88800000.30025.urn:micasaverde-com:serviceId:EnergyMetering1.EnergyUsage"] = {"Reading Right",0},
    ["Vera-88800000.30026.urn:micasaverde-com:serviceId:EnergyMetering1.EnergyUsage"] = {"Bedside 1",0},
    ["Vera-88800000.30027.urn:micasaverde-com:serviceId:EnergyMetering1.EnergyUsage"] = {"Bedside 2",0},
    ["Vera-88800000.30028.urn:micasaverde-com:serviceId:EnergyMetering1.EnergyUsage"] = {"Reading Left",0},
    ["Vera-88800000.30029.urn:micasaverde-com:serviceId:EnergyMetering1.EnergyUsage"] = {"Bedroom Table Lamp",0},
    ["Vera-88800000.30045.urn:micasaverde-com:serviceId:EnergyMetering1.EnergyUsage"] = {"Chandelier",0},
    ["Vera-88800000.30048.urn:micasaverde-com:serviceId:EnergyMetering1.EnergyUsage"] = {"Kitchen",80},
    ["Vera-88800000.30051.urn:micasaverde-com:serviceId:EnergyMetering1.EnergyUsage"] = {"Dining Table",0},
    ["Vera-88800000.30094.urn:micasaverde-com:serviceId:EnergyMetering1.EnergyUsage"] = {"Bedroom Ceiling",0},
    ["Vera-88800000.30095.urn:micasaverde-com:serviceId:EnergyMetering1.EnergyUsage"] = {"Ceiling",0},
    ["Vera-88800000.30131.urn:micasaverde-com:serviceId:EnergyMetering1.EnergyUsage"] = {"Power Meter",4573},
    ["Vera-88800000.30208.urn:micasaverde-com:serviceId:EnergyMetering1.EnergyUsage"] = {"PV Generation",0}
  },
  memory_stats = {},
  tally = {
    HTTP_relayed = {
      ["Batteries.Import.y"] = 1,
      ["Batteries.Netatmo.Guest.1d"] = 2,
      ["Guest.CO2.10m"] = 6,
      ["Indoor.CO2.10m"] = 7,
      ["Indoor.Pressure.10y"] = 6,
      ["Indoor.Temp.10m"] = 3,
      ["Internet.Uptime.1m"] = 66,
      ["Library.CO2.10m"] = 6,
      ["LoftHumidity.m"] = 2,
      ["Outdoor.Dew.10m"] = 6,
      ["Outdoor.Hum.10m"] = 4,
      ["Outdoor.Temp.10m"] = 7,
      ["Power.Import.W.20m"] = 1,
      ["Power.Import.w"] = 2,
      ["Studio.CO2.10m"] = 7,
      ["Studio.Hum.10m"] = 1,
      ["Studio.Temp.10m"] = 7,
      ["Vera0.CPU05.d"] = 31,
      ["Vera0.MemAvail.d"] = 33,
      ["Vera0.MemFree.d"] = 33,
      ["Vera0.Uptime.m"] = 5,
      ["Vera1.CPU05.d"] = 27,
      ["Vera1.MemAvail.d"] = 32,
      ["Vera1.MemFree.d"] = 31,
      ["Vera1.Uptime.m"] = 4,
      ["VeraEdge.CPU05.d"] = 30,
      ["VeraEdge.MemAvail.d"] = 32,
      ["VeraEdge.MemFree.d"] = 18,
      ["VeraEdge.Uptime.m"] = 5,
      ["Weather.Hum.10m"] = 2,
      ["Weather.Temp.10m"] = 2,
      ["Weather.Temp.10y"] = 2,
      ["cpu.d"] = 33,
      ["memAvail.d"] = 33,
      ["memFree.d"] = 33,
      ["memory.d"] = 33,
      ["uptime.m"] = 33
    },
    UDP_relayed = {},
    watched = {}
  },
  translations = {}
}

[cache] = {
  LOCAL_DATA_DIR = "whisper/",
  UDP_RECEIVER_PORT = "2003"
}

[dash] = {
  DATAMINE_DIR = "",
  ICON_PATH = "/cmh/skins/default/img/devices/device_states/",
  LOCAL_DATA_DIR = "whisper/",
  VERAS = ""
}

[graph] = {
  DATAMINE_DIR = "",
  LOCAL_DATA_DIR = "whisper/"
}

[mine] = {DATAMINE_DIR = ""}

[relay] = {
  DESTINATIONS = "127.0.0.1:2003",
  LINE_RECEIVER_PORT = "",
  LIVE_ENERGY_USAGE = "1",
  MEMORY_STATS = "",
  SYSLOG = ""
}


Do you REALLY want to do this... ?!
« Last Edit: February 24, 2018, 02:09:13 pm by akbooer »
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 d55m14

  • Sr. Member
  • ****
  • Posts: 449
  • Karma: +8/-1
Re: Datayours in Openluup environment
« Reply #2 on: February 24, 2018, 05:43:46 pm »
Hi akbooer,

I just need to set/change the variables "daemons", "destinations", "LOCAL_DATA_DIR", "CONFIG_DIR".

The other parameters are set through the file "storage_aggregation-conf" and "storage_schema.conf".

The variables watched are set in the remote Vera controllers .

If I remember well in some first Openluup version these variables (daemons, destinations, etc..) were set in startup file of Openluup.

I'm not sure if it's clear and if I remember well...

tnks

donato

Offline akbooer

  • Moderator
  • Master Member
  • *****
  • Posts: 6387
  • Karma: +290/-70
  • "Less is more"
Re: Datayours in Openluup environment
« Reply #3 on: February 24, 2018, 05:50:37 pm »
Yes, they can still run like that, but they have to be initialised slightly differently from the way that DataYours does it these days.  I can take a look if you really need, but all those variables can be set (once and for all) with simple HTTP requests.
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 akbooer

  • Moderator
  • Master Member
  • *****
  • Posts: 6387
  • Karma: +290/-70
  • "Less is more"
Re: Datayours in Openluup environment
« Reply #4 on: February 24, 2018, 06:11:22 pm »
The easiest way to run in the old file-based configuration is not to have a DataYours device at all, but simply start up the daemons you want in Lua Startup.

Code: [Select]
local watcher  = require "L_DataWatcher"
watcher.init()
local cache  = require "L_DataCache"
cache.init()

The global configuration file should, by default, be in /www/, and the database in /etc/cmh-ludl/whisper/ where the storage aggregation .conf files reside.

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 d55m14

  • Sr. Member
  • ****
  • Posts: 449
  • Karma: +8/-1
Re: Datayours in Openluup environment
« Reply #5 on: February 25, 2018, 08:02:29 am »
Hi akbooer,

in the global configuration example file (present in the Configuration directory on GitHub) there are many parameters of type "LINE_RECEIVER_PORT" . How do I set parameters to map the configuration like that I've attached ?  The other parameters are all ok ?

In other words I've to set the parameters as that attached (copy of ALTUI variables of DY device)

tnks

donato

Offline akbooer

  • Moderator
  • Master Member
  • *****
  • Posts: 6387
  • Karma: +290/-70
  • "Less is more"
Re: Datayours in Openluup environment
« Reply #6 on: February 25, 2018, 09:35:21 am »
in the global configuration example file (present in the Configuration directory on GitHub) there are many parameters of type "LINE_RECEIVER_PORT" . How do I set parameters to map the configuration like that I've attached ?  The other parameters are all ok ?

The configuration file is broken into sections with the daemon name in [brackets].  DataWatcher is an instance of the relay daemon, DataCache, the cache.

Hence a configuration with something like:
Code: [Select]
[cache]
LOCAL_DATA_DIR = /nas/whisper/
UDP_RECEIVER_PORT = 1955

[relay]
LINE_RECEIVER_PORT = 2013
DESTINATIONS = 127.0.0.1:1955

should actually be all that you need (the rest are defaulted.)


Why are you going through all this pain?  If you want to end up with a system with no AltUI, you could simply remove it after configuration.
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 d55m14

  • Sr. Member
  • ****
  • Posts: 449
  • Karma: +8/-1
Re: Datayours in Openluup environment
« Reply #7 on: February 25, 2018, 10:38:32 am »
ok akbooer,

thank you for your valuable support as usual.

I think to follow your last reasonable solution .

tnks

donato