The yachts I am building all have a multi monitor dispay system in the engine room. Attached is a screenshot of our HVAC system.
I see potential in using Vera as a portal to important industrial types of information…EG: notify me if Compressor One goes above 290 psi.
I program on a very low level using Labview. I would like to access the Data in Vera using TCPIP or UDB calls but I don’t want to have to write an addon package to do it. I was thinking that I could use an existing addon such as the one SQRemote uses if I knew the protocol of communication they used. I would simply appear to be an SQRemote client. Is the addon protocol open source?
Any idea?
This would be a great way to expand the functions of Vera on the home front as well…we have many systems that could be monitored and text messages sent out if a data / variable is outside the range we have set.
I am still pondering on how to get the data in…don’t have time to learn new languages!
Regards
Tim Alls
AllSeas Yachts
Tim,
I have a Windows tool available in the “Luup and Development/I am making a graphing tool available for Vera” forum which can fetch several pieces of data at regular intervals from anywhere (ie local WiFi or remote Internet) and save them to a csv file - which is a text-based “comma separated variables” files where the data could be easily accessed.
Have a look if you think it might help you, or maybe I could modify it to fit your needs?
Regards,
bob
I will take a look…thanks.
Labview can easily read and write to tab delimited files so that would be easy!
Can you fetch any data available in the Vera?
If so then all I have to figure out is how to stuff the data into Vera!
Regards
Tim Alls
Allseas Yachts
Tim,
Reply to my via the email in my other posting - I can send you a copy of the tool and we can take it from there.
Regards,
bob
FlyBoyBob,
I ran your program and it works flawlessly!
I can easily read the file and bring it into Labview for display.
I am curious…what language did you write it in?
Are you calling some common DLLs for the reading of the XML as well as parsing the data to extract the variables?
Can the update be less than one minute or do you think that polling too close together will slow Vera’s response time down.
Do you know if you have to send the entire XML file to Vera to update variables or do they have routines to update individual variables?
Thanks again…this will be a great tool to go along with the Vera…visual data such as graphs are extremely useful!
Regards
Tim Alls
AllSeas Yachts
Glad it works well for you Tim,
I wrote it in M$ Visual C++, in about 2 days on and off.
No DLLs, I wrote my own simple parser using CString functions.
The update can be any fraction of a minute, ie 0.1 is 10x per minute, but I would only recommend that locally. Going through the MCV server at that rate is bordering on “hammering”. Obviously setting the poll rate faster than the Vera can respond is bad, although the program is protected against “re-entrant” problems like that.
The Vera generates and sends the XML file, there are ways to get the Luup engine to parse variables itself but the transfer is so fast I didn’t bother.
Do me one favor Tim - copy and paste your post to my Luup and Development section post so that others might see the program’s usefulness. Also I am open to suggestions on more functionality if you need it.
Regards,
bob
Thanks again…I posted under your other topic as requested.
Is there an easy way to create generic devices that can hold the variables I want To use …EG Water Temp, Compressor Pressure?
Tim Alls
AllSeas Yachts
[quote=“TimAlls, post:7, topic:167884”]Thanks again…I posted under your other topic as requested.
Is there an easy way to create generic devices that can hold the variables I want To use …EG Water Temp, Compressor Pressure?
Tim Alls
AllSeas Yachts[/quote]
Yes, although I have not used it yet so can’t advise you on it.
Do a forum seach for “virtual devices”. Once you have created one and stored variables in it my program can fetch them for you just like any other device.
Hope that helps!
bob
Thanks
I will do a search and let you know how it works out.
Regards
Tim Alls
AllSeas Yachts
FlyBoyBob,
Just curious if you set a limit to the file size being created…I ran mine for a couple of days and it gets pretty big.
Maybe consider a revolving buffer when it gets to a certain size?
Just a thought.
Regards
Tim Alls
Allseas Yachts
I could delete older records if the file size gets to a certain limit, thanks for the idea.
Just out of curiosity - what do you use as a scan rate? When I want to graph something over a day or two I usually set it for about once every ten minutes, especially if it is a slow-changing variable like temperature or light levels. When I want to test a Scene Luup code response time, like the event trigger versus the commands being executed, I will set the rate for several times a minute but obviously not run it for very long.
And do you think the 10 fields for data collection is enough?
Regards,
bob
I have been running with a once a minute update time…I run my monitoring system 24 / 7 so I can see that at the end of a month or so the file would be pretty big. My goals are a little different than yours so I didn’t expect a perfect marriage…but it is working great for extracting Vera data. With Labview and its elegant screens, I can show doors status for example on a diagram of the boat. Next I will have a bilge diagram showing bilge sensors as well. Eventually I would like to tackle feeding vital information into the Vera and trigger notifications when needed…a big plus for lot’s of applications…not just yachts.
As for the ten fields…When I get done i will need to monitor more, 16 to be exact. I noticed that the XML file is being saved as well so i have been stripping the variables with Labview to take care of the limitations. I really must learn more about talking to the Vera…I can write modbus drivers using TCPIP and UDB calls…I have a driver i wrote to read the 485 bus on power meters…but I am in the dark as to the communication routines used in this case! Excuse my ignorance!
Regards
Tim Alls
Allseas Yachts
Tim,
If you can parse the XML data file with Labview then you are probably better off developing your own app, and I understand all too well the frustration of “finding out what it is you need to find out”! So maybe I can help with that…
Fetching the data is well documented in these forums and the MCV documents:(http://docs.micasaverde.com = not well documented how to find it!) Here’s what I use:
https://fwd2.mios.com/username/password/device/data_request?id=lu_status&output_format=xml
and I simply replace udername etc with what is in the boxes on my dialog. The documentation states output_format=json which is a java format but I prefered xml for the availability of xml viewers. Locally you can use:
http://local_ip:49451/data_request?id=lu_status&output_format=xml
Onward and upward!
bob
FlyBoyBob,
You are correct…it’s time for me to take the plunge and learn to talk to Vera. It looks like from your example that extracting the XML file is easy so I will tackle that one first. Any idea where I can find examples of code writing data into Vera?
I thank you for your help!
What kind of software do you write where you work?
Do you get into Modbus communication? If Vera spoke Modbus my job would be soooooo easy!
Regards
Tim Alls
Allseas Yachts
Also bear in mind that Vera’s native format is JSON, not XML. When you ask it to produce an XML version of the output it does a LOT more work internally, draining resources from other things it could be doing.
I’ve also seen a number of cases where it produces invalid XML, and even hangs the system altogether (both due to Bugs).
If you’re going to extract data from Vera, the best path is JSON, and then do any post-conversion processing on that elsewhere. It’s definitely a path that has much more testing done on it.
I am familiar with XML files now but unfamiliar with JSON files. Can you steer me into a resource that gives the format?
How about sending data into Vera…JSON file structure as well?
I do not want to slow down the machine…
Regards
Tim Alls
Allseas Yachts
Run the URL’s you’re using without the:
&output_format=xml
bit at the end, and it’ll come in JSON format. It’s fairly self-describing, but you can get more information on JSON format by running a Google search.
I am watching this thread hoping someone will answer your question above too. I haven’t found any obvious details about writing data into the Vera as yet, but it is oviously done by several applications I have seen.
I have downloaded the “cook your own UI” VC++ application that is available but… let’s just say it wasn’t written with brevity or clarity in mind. Still… it’s nice that it is available to us “experimenters”
[quote=“TimAlls, post:14, topic:167884”]What kind of software do you write where you work?
Do you get into Modbus communication? If Vera spoke Modbus my job would be soooooo easy![/quote]
I write mostly in C++ since we do industrial-strength applications here. Yes we use Modbus but in my opinion Modbus should have been obsoleted with the coils and contacts it used to control back in the 50’s ! 
Point well taken on Modbus…I only use it to read input or output registers and even then I have written my own communication routines that are simple and fast.
I will continue experimenting with code and I will keep you up to date.
The Folks at SQRemote are talking to the Vera the way I want to…you can tell by the response to the lighting commands when using their dimmers.
In regards to the JSON format it is just as easy to sort out as the XML files to So I will try to stick to the native since Vera is so low in resources.
Regards
Tim
Point taken on JSON vs XML also.
I made some changes to my program to bring in and parse JSON vs XML as a test:
First of all I did not notice a difference in response time from the Vera, but I will take Guessed’s word that XML contains more bugs and consumes more resources.
Second = JSON is not as verbose OR explicit as XML: in XML the “device id” is explicitly named, whereas in JSON there is an implicit “id” field in the “device” context, which requires a lot more elaborate parser to not make mistakes.
Third - for my purposes of debugging Vera operation (your purpose is different Tim) I can output the XML directly to a file and invoke the free nifty XML editor built into Internet Exploder, which means I can easily find and read the variables I am looking for.
In summary - JSON is probably the better format for your application, if you have the time and skill to parse it accurately. I’ll stick with XML for my intermittent development use.
Also - regarding your concern of big files from my program - if you write a batch file or whatever language you want to rename files on an interval basis, ie every hour or day, my program will make a new file automagically and start filling that, no changes for me to make.