Author Topic: DataYours - App Store Release  (Read 123958 times)

Offline d55m14

  • Sr. Member
  • ****
  • Posts: 430
  • Karma: +8/-1
Re: DataYours - App Store Release
« Reply #570 on: December 03, 2017, 03:54:38 am »
Right, this is the case : the variable doesn ?t change its state .

How can send the value to DY from a scheduled scene ?

Tnks

Offline akbooer

  • Moderator
  • Master Member
  • *****
  • Posts: 5725
  • Karma: +246/-69
  • "Less is more"
Re: DataYours - App Store Release
« Reply #571 on: December 03, 2017, 07:17:33 am »
How can send the value to DY from a scheduled scene ?

There's a number of different ways... am I right in thinking that your front-end machines are Veras, and that's where you want to do this?
3x Vera Lite-UI5/Edge-UI7, 25x Fibaro, 23x TKB, 9x MiniMote, 2x NorthQ Power, 2x Netatmo, 1x Foscam FI9831P, 2x Philips Hue
Razberry, MySensors Arduino, HomeWave, AltUI, DataYours, openLuup, ZWay, ZeroBrane Studio.

Offline d55m14

  • Sr. Member
  • ****
  • Posts: 430
  • Karma: +8/-1
Re: DataYours - App Store Release
« Reply #572 on: December 03, 2017, 07:30:06 am »
Yes akbooer,

the scene will be executed in Vera Controller

Offline akbooer

  • Moderator
  • Master Member
  • *****
  • Posts: 5725
  • Karma: +246/-69
  • "Less is more"
Re: DataYours - App Store Release
« Reply #573 on: December 03, 2017, 07:53:12 am »
Your easiest way, then, is probably to issue a local HTTP request of the form:

Code: [Select]
http://VeraIP:3480/data_request?id=lr_DataWatcherRelay&target=TARGET&new=VALUE

You can test this manually from a browser.  For example on one of my machines, I've just done:

Code: [Select]
http://172.16.42.129:3480/data_request?id=lr_DataWatcherRelay&target=test.test&new=42

which results in a new archive file called test.test.wsp with the value 42 in the current time period.

From a scheduled scene, you'd probably want to have a function which takes the target metric name and the serviceId / variable / device as parameters and sends the request locally.  Something like this, although I've not tested it:

Code: [Select]
local function update(target, srv, var, dev)
  local url = "http://127.0.0.1:3480/data_request?id=lr_DataWatcherRelay&target=%s&new=%s"
  local new = luup.variable_get (srv, var, dev) or '?'
  luup.inet.wget (url: format (target, new))
end 

This is the mechanism which the AltUI Data Storage Provider uses to log to DataYours.

3x Vera Lite-UI5/Edge-UI7, 25x Fibaro, 23x TKB, 9x MiniMote, 2x NorthQ Power, 2x Netatmo, 1x Foscam FI9831P, 2x Philips Hue
Razberry, MySensors Arduino, HomeWave, AltUI, DataYours, openLuup, ZWay, ZeroBrane Studio.

Offline d55m14

  • Sr. Member
  • ****
  • Posts: 430
  • Karma: +8/-1
Re: DataYours - App Store Release
« Reply #574 on: December 03, 2017, 08:56:42 am »
Tnks akbooer,

all very useful.... as usual

have a nice day

Offline d55m14

  • Sr. Member
  • ****
  • Posts: 430
  • Karma: +8/-1
Re: DataYours - App Store Release
« Reply #575 on: December 16, 2017, 09:01:39 am »
Your easiest way, then, is probably to issue a local HTTP request of the form:

Code: [Select]
http://VeraIP:3480/data_request?id=lr_DataWatcherRelay&target=TARGET&new=VALUE

You can test this manually from a browser.  For example on one of my machines, I've just done:

Code: [Select]
http://172.16.42.129:3480/data_request?id=lr_DataWatcherRelay&target=test.test&new=42

which results in a new archive file called test.test.wsp with the value 42 in the current time period.

From a scheduled scene, you'd probably want to have a function which takes the target metric name and the serviceId / variable / device as parameters and sends the request locally.  Something like this, although I've not tested it:

Code: [Select]
local function update(target, srv, var, dev)
  local url = "http://127.0.0.1:3480/data_request?id=lr_DataWatcherRelay&target=%s&new=%s"
  local new = luup.variable_get (srv, var, dev) or '?'
  luup.inet.wget (url: format (target, new))
end 

This is the mechanism which the AltUI Data Storage Provider uses to log to DataYours.

Hi akbooer,

I've tested your lua code to update DY/whisper database. The update is correct but Luup engine restart frequently during the day.

The scene (running every 5 minutes) where is the update function is attached and I've attached the log too with the luup crash.

I'm quite sure is something related to update wsp function because without it the luup engine doesn't crash.

Can you take a look at it if there's something wrong ?

tnks

donato

Offline akbooer

  • Moderator
  • Master Member
  • *****
  • Posts: 5725
  • Karma: +246/-69
  • "Less is more"
Re: DataYours - App Store Release
« Reply #576 on: December 16, 2017, 10:07:00 am »
You might try changing the url to the following...

Code: [Select]
local url = "http://127.0.0.1/port_3480/data_request?id=lr_DataWatcherRelay&target=%s&new=%s"

However, we all know that the slightest thing can upset Vera, in particular, extra I/O.  It may just be the straw which breaks the camel's back. I don?t immediately see anything intrinsically wrong with this.  The fact that it sometimes/often works OK would support that thought.
3x Vera Lite-UI5/Edge-UI7, 25x Fibaro, 23x TKB, 9x MiniMote, 2x NorthQ Power, 2x Netatmo, 1x Foscam FI9831P, 2x Philips Hue
Razberry, MySensors Arduino, HomeWave, AltUI, DataYours, openLuup, ZWay, ZeroBrane Studio.

Offline d55m14

  • Sr. Member
  • ****
  • Posts: 430
  • Karma: +8/-1
Re: DataYours - App Store Release
« Reply #577 on: December 18, 2017, 02:47:09 am »
Hi akbooer,

It seems that changing the url did the Vera more stable , only one restart in 48 hours.


tnks

Donato

Offline bucko

  • Hero Member
  • *****
  • Posts: 637
  • Karma: +26/-7
    • Travel and Living in China
Re: DataYours - App Store Release
« Reply #578 on: December 18, 2017, 07:05:40 pm »
Trying to install DataYours on my new VeraPlus and having problem with the NAS storage. Datayours sees mt storage, but won't mount CIFS because permission is denied. My Whisper folder is set with chmod 755 and worked before when I was on UI.

I can see the DY interface in my browser ok. (blank) Also not other devices were created . I Only have the DY panel.

I do not know how/why permission is denied. Any help would be appreciated.
Vera 3, 40+ Fibaro relays & dimmers, IPUX cams, Elk M1 Gold, M1XEP, M1SP, XVOR, M1RB, Elk124, Monoprice HDMI matrix & 6 zone amp, Denon AVR, Panasonic A8000, BI DV,On Controls

Offline d55m14

  • Sr. Member
  • ****
  • Posts: 430
  • Karma: +8/-1
Re: DataYours - App Store Release
« Reply #579 on: April 03, 2018, 07:39:16 am »
Hi akbooer,

I'm prototyping a sensor for air quality check measuring PM2.5, PM10, CO2, VOC, etc.. and I'm using Z-UNO to interface with the zwave Controller and send the data to my centralized Openluup-Datayours system.

Is it hard to have a mini-DY enviroment (I suppose only DataWatcher and peharps DataCache) on a Arduino platform in order to  bypass Zwave controller and send data directly from sensor to centralized Openluup-DY system ?

tnks

donato

Offline akbooer

  • Moderator
  • Master Member
  • *****
  • Posts: 5725
  • Karma: +246/-69
  • "Less is more"
Re: DataYours - App Store Release
« Reply #580 on: April 03, 2018, 10:16:07 am »
One of the joys of the Graphite system, on which DataYours is based, is that it is trivial to get data into the system from just about anywhere.

All the Arduino needs to be able to do is to send an appropriately formatted UDP datagram to the centralised DataCache.  The format is also trivial and documented here:
http://graphite.readthedocs.io/en/latest/feeding-carbon.html#the-plaintext-protocol

It is simply plain ASCII text
Code: [Select]
<metric path> <metric value> <metric timestamp>

Normally, your sender would need access to system time, but DataYours will substitute the time stamp with the received data time if it is missing.  So, for example, just a message like this will suffice
Code: [Select]
Station1.Outdoor.Temperature 21.3

I've not tried UDP on an Arduino, but have used TCP.  It should be very straight-forward.
3x Vera Lite-UI5/Edge-UI7, 25x Fibaro, 23x TKB, 9x MiniMote, 2x NorthQ Power, 2x Netatmo, 1x Foscam FI9831P, 2x Philips Hue
Razberry, MySensors Arduino, HomeWave, AltUI, DataYours, openLuup, ZWay, ZeroBrane Studio.

Offline d55m14

  • Sr. Member
  • ****
  • Posts: 430
  • Karma: +8/-1
Re: DataYours - App Store Release
« Reply #581 on: April 03, 2018, 10:34:51 am »
Tnks akbooer I?ll try