DataYours Beta Test - VERSION 2

[ul][quote=“jcsv75, post:400, topic:181793”]Ok, so I did a quick test. It was indeed very easy to create the html string for last week’s energy usage and output this to csv.

https://fwd7.mios.com/username/password/xxxxxxxx/data_request?id=lr_render2&from=-w&height=360&title=Weekly%20Energy%20Usage%20-%20&format=csv&target=Vera-xxxxxxxx.209.urn:micasaverde-com:serviceId:EnergyMetering1.Watts[/quote]
Oh, so you’re doing it remotely through the servers too. Neat!

In Excel (2013) I used the html string to download the data straight into an empty worksheet and I was able to create a quick graph showing the daily energy usage and cost. see also linked screenshot.

[url=http://1drv.ms/1CUZVTy]http://1drv.ms/1CUZVTy[/url]


Looks very tidy indeed - I could see some demand for that! (Should the WATTS column actually be Watt hours?)

Quick question, just to be sure I am looking at the right data here. Is the daily energy usage indeed the accumulation of all measuring points during 24 hours or should I apply a different calculation?

Very good question, and the answer depends on the details of what you have done. You are generating this (according to the URL) from the WATTS measurement, yes? Then you have to be very careful because of the ‘feature’ that I warned of: missing or nil values. You have two options:
[list type=decimal]
[li]If you’re adding up all the points at UNIFORM time internals, then you have to pick a value to insert for the nil measurements - a traditional one would be the last valid value, but you could get more sophisticated and do, say, linear interpolation.[/li]
[li]If you’re handling only the non-nil values, then you have to adjust your time period that this is averaged of to be the span between your valid points.[/li][/list]
Computationally it amount to the same thing, but if you’re only adding together the valid values then you may be wrong (unless your file archive is set to be coarser than your measurement sampling rate.) I personally only look at whole-house measurements from a meter in kWh, which simply doesn’t have this problem since it accumulates correctly for you and you just have to different the end values.

It’s all a bit of a minefield, missing values, and that’s one thing that makes writing a good-looking plotting routine difficult too.

Hope this makes sense.[/ul]

[quote=“d55m14, post:399, topic:181793”]in UI5 I’m using a USB stick connected to Veralite to store the data. The same is on VeraEdge.

In this configuration (USB stick directly connected to VeraEdge) is it possible to use a complete installation ?[/quote]

I know there was a USB firmware problem with the Edge. I think this may have been solved in the latest firmware (which I have yet to get.) So if you can mount and access a USB correctly on the Edge then, yes, no problem. I just need to post the missing daemons ([tt]DataCache, DataGraph, DataDash[/tt])

Here’s the next in the chain: [tt]DataCache[/tt] which actually writes the data to the Whisper database.

[ol][li]Install files as normal. [/li]
[li]Add [tt]Cache[/tt] to the [tt]DataYours[/tt] device variable [tt]DAEMONS[/tt] so it now reads: [tt]Watcher, Cache[/tt][/li]
[li]RESTART and refresh browser[/li][/ol]

This should create a [tt]Cache[/tt] child device with the following device variables under the Advanced tab:

[ul][li]SYSLOG - once again you can put the same (or different) syslog server address and port here[/li]
[li]UDP_RECEIVER_PORT - this has the default value of 2003, which is the port that [tt]DataWatcher[/tt] sends data to[/li]
[li]LOCAL_DATA_DIR - this is the Vera-accessible location of the Whisper database (by default a local directory [tt]/nas/[/tt] which you will have to create manually but you can change it to point to your USB or whatever[/li][/ul]

Then you should be up and running with local data storage.

Well yes, this is actually our holiday house, so I am doing this remotely :slight_smile:

Ok I understand it’s a bit more complicated. However I would already by quite happy to have the overall energy usage displayed in kwh but somehow I haven’t been able to figure out how to do this.

Do I need to setup a new whisper graph first displaying Kwh? And if yes, how can I then reference this query to pull the data into my excel sheet?

Thanks again!

You don’t need to set up a graph, but you do need to be watching the KWH variable and storing it the database - if you’re only interested in daily totals, then only set the granularity of the archive to 1 day. I use a NorthQ meter reader and it provides a standard UPnP service for power and kWh. For me, then, to get a month’s worth of data in CSV I’d use:

http://<YourVeraIP>:3480/data_request?id=lr_render2&target=Vera-35104571.131.urn:micasaverde-com:serviceId:EnergyMetering1.KWH&from=-30d&format=csv

Bear in mind that this gives you the last 30 day’s worth of data from now. If you wanted to be explicit your could use an absolute date format ([tt]DataYours[/tt] uses ISO format times) specifying [tt]&from=xxx&until=yyy[/tt].

Great thanks a lot.

This should help me get going setting up the report I was looking for. I am not using North Q but a CurrentCost device to measure the whole house electricity but I guess the same principles apply. To make these changes I will need local network access to my vera so I will get to that this weekend and report back.

[quote=“akbooer, post:394, topic:181793”]@d55m14 (and anyone else with VeraEdge already running [tt]DataYours[/tt] on another system)…

OK, let’s try this. This is, effectively, the VERSION 3 Beta release. I’m confident of the stability and operation of the UI7 versions of the underlying Graphite system daemons, so let’s set up [tt]DataYours[/tt] on your Edge to talk to your existing installation.

This won’t need any changes to your existing system aside from adding the IP address of your Edge to the [tt]carbon.conf[/tt] file - you do this by adding it to the very end of your file (obviously with your particular IPs) thus:

[dashboard]
VERAS = 172.16.42.1:3480, 172.16.42.2:3480

The new UI7 architecture starts with the installation of the basic [tt]DataYours[/tt] plugin. The files for this are attached. Simply manually create a new device (Develop Apps > Create Device) with a [tt]device_file[/tt] of type [tt]D_DataYours7.xml[/tt]. We’ll not bother with device icons yet. Restart twice, and you should end up with the following variables under the Advanced tab:

[ul][li]SYSLOG - if you run a syslog server, then set this to the IP and port number eg. [tt]172.16.42.112:514[/tt][/li]
[li]DAEMONS - this is going to list the optional components which you want to start up (you don’t have any yet)[/li][/ul]

On its own, the only thing of the slightest interest that it does is update a device variable saying how much app memory it is currently using.[/quote]

Hi akbooer,

I’ve followed your instructions but I can’t see the variables SYSLOG e DAEMONS in Advanced tab.
MCV installed 1.7.961 firmware on my VeraEdge and the USB port seems to work correctly .
tnks

donato

[quote=“d55m14, post:407, topic:181793”]I’ve followed your instructions but I can’t see the variables SYSLOG e DAEMONS in Advanced tab.
MCV installed 1.7.961 firmware on my VeraEdge and the USB port seems to work correctly .[/quote]

So sorry… this is my fault. I didn’t re-check this on a clean install. Could you try this?

[quote=“akbooer, post:408, topic:181793”][quote=“d55m14, post:407, topic:181793”]I’ve followed your instructions but I can’t see the variables SYSLOG e DAEMONS in Advanced tab.
MCV installed 1.7.961 firmware on my VeraEdge and the USB port seems to work correctly .[/quote]

So sorry… this is my fault. I didn’t re-check this on a clean install. Could you try this?[/quote]

Hi akbooer,

nothing … no variables .

I’ve just load the lua file, re-created the device and reload VeraEdge many times.

I’ve to do anything else ?

tnks

donato

You don’t get a startup error indication for the plugin?

If yes, we’ll trawl the logs, if no, then I’m deeply puzzled. I didn’t want to do it, but I will tear down my current install and start from scratch too. We are running different firmware, but I would sincerely hope that’s not an issue for something as basic as this.

Sorry to ask a silly question, but you ARE looking under the Advanced tab for these variables?
(You may have to scroll down the device control page to find it… it’s a UI7 layout nightmare.)

[quote=“akbooer, post:411, topic:181793”]Sorry to ask a silly question, but you ARE looking under the Advanced tab for these variables?
(You may have to scroll down the device control page to find it… it’s a UI7 layout nightmare.)[/quote]

Hi akbooer,

there is no variables in the tab “variables” of Advanced tab and I don’t see particular errors during startup.

Attached the files I’ve uploaded and a printscreen of variable tab.

Thanks for the screen shot. My control page for ANY device looks different from that, with Advanced, etc. at the bottom of the page. Maybe a change between firmware?

Anyway, to see if DataYours is actually running, could you tell me what response you get when browsing the following URL:

http://<YourVeraIP>:3480/data_request?id=lr_DataYours7&show=config

[quote=“akbooer, post:413, topic:181793”]Thanks for the screen shot. My control page for ANY device looks different from that, with Advanced, etc. at the bottom of the page. Maybe a change between firmware?

Anyway, to see if DataYours is actually running, could you tell me what response you get when browsing the following URL:

http://<YourVeraIP>:3480/data_request?id=lr_DataYours7&show=config [/quote]

The response to http request is “No handler”.

Attached a printscreen of Advanced option. As you can see the param, variables, services, command are now on separate tab.

tnks donato

Can you show me the variables tag of any other device? This firmware is certainly significantly different in UI terms.

…something familiar…

donato

Fair enough. I’ll start again from scratch and try and duplicate. The files you posted in the zip look fine, of course.

Would I be correct in inferring that the [tt]impl_file[/tt] device parameter is blank?

Try setting it to [tt]I_DataYours7.xml[/tt] and see what happens.

… this took a bit of finding.

Would I be correct in inferring that the [tt]impl_file[/tt] device parameter is blank?

Try setting it to [tt]I_DataYours7.xml[/tt] and see what happens.

… this took a bit of finding.[/quote]

Something is changed…

now I get a msg “DataYour7 (the device) startup Lua failed” but the variables appeared in the Advanced Tab of the Device.

tnks donato

Yup, expected that.

This should fix that message, but you should already see your device variables now.

Change the [tt]DAEMONS[/tt] variable to “Watcher”