The State of Vera: Home Control Vs. Home Automation

As simply an end user and not a developer I have been pondering some of the “get s@*t done” obstacles of Vera and the current crop of HA solutions in general. While Vera does allow a good deal of control over a limited set of domestic devices such as lights, thermostats and alarm systems there is a large gap in its ability to automate and fully integrate with domestic life. While having the ability to turn lights on and off via a timer, or even more advanced logic thanks in no small part to the community, the buck seems to stop there. I am often given hope for what the future may hold by reading the blog of Ian Mercer(1). He seems to have hit the nail on the head with regards to this topic. Vera generally gives you what he would refer to as a “dumb home”, which simply gives one computer control, possibly with an attractive UI, over things which can easily be done manually. True home automation on the other hand can make predictions, is highly aware of what the occupants of the home are doing, why they are doing it and can explain the decisions it made.

We are steadily moving forward with Vera’s integration with our domestic products thanks to the hard work of our community developers. It seems to me that the missing components that would bridge the gap at this point are a data base and a natural language interface. I imagine that for a developer, creating a DB of Vera’s actions might not be overly difficult. Even if an end user were to try to use Vera’s logs for such a purpose it would be fruitless as it’s not “human readable”. In my opinion one of the most exciting developments recently in the Vera world excluding the Program Logic tools provided by the Venerable RTS is the “Event logging database” by forum member Quinten (2). Unfortunately I don’t believe this goes far enough and we need more actions logged, more sources of input and more accessible Vera integration. Furthermore there is still no way to interface with it in a conversational fashion. For example you wouldn’t be able to ask it a question like “what did I do on the first Monday of last September?” even though Vera has a bare bones rudimentary form of a Google Calendar interface. I personally have been using Vera Alerts as a sort of primitive method of keeping track of some actions and I personally have begun using Google Calendar to keep track of my activities but this is still all manual for the most part and the amount of information I can log and later review is extremely limited due to the hassle of recording it querying it for later inspection.

With the advent of PLEG we can now use more complicated logic without resorting to code. This is probably the single greatest advancement with Vera I have seen since I first obtained the device close to three years ago. Absolutely the only related feature PLEG is lacking in is a natural language interface. I envision an interface where I can say something like “every year for the entire month of October turn the porch light on 30 minutes after sunset and off at 10 PM” or some such. This will be the real heavy development burden. The developer who brings this to fruit would revolutionize home automation and could well end up a very wealthy man.

I am thinking that Vera’s greatest use is to be a controller. I think any attempts to make it do more should stop there. I believe that the next step should be a software package which provides a DB and a natural language interface. As a controller and a physical method of integrating devices I believe that Vera is well suited for the task. What we desire from it very well may be beyond the scope of its keeper’s ability and vision. Not to mention beyond the ability of the hardware.

Thoughts?

(1) The Blog of Ian Mercer http://blog.abodit.com/

(2) Event logging database by forum member Quinten http://forum.micasaverde.com/index.php?topic=15245.0

Greate post! I fully agree.

Thanks for the hint about the event logging database.

Br,
Tomas

Interesting post @S-F, thanks for sharing.

Like anything in this HA world, money can buy you many things and I think in some of the high end kit that ‘image’ of an intelligent house is much closer than people think. (But I still think all fall short in certain ways)

Since joining the Vera bandwagon I’ve tried to bolt on a number of extra things to get a greater HA experience and over the past year Vera has captured a lot of my habits which could be wonderfully referenced and used to drive certain activities (but not all :))

Like you I’m not a programmer/developer but (again like you) I am an enthusiast and a day dreamer about the automated world I want (dare I say the Star Trek computer experience)

I’ve long categorised my own desire for a future home as having ?.

Home Monitoring (temp, motion, video etc.)
Home Control (turning lights, sockets, increase temps etc.)
Home Automation (controls reacting to triggers etc.)
Home Intelligence (based on learning, history, logic and leverages any of the above etc.)

And I agree the buzz is always around the HA, not the HI (if I can call it that ;))

I wrote a post a while back looking for the best partners for Vera, to help it evolve more in people HA world, as it’s impossible for Vera alone to do everything, plus the more we want to push at it the more spec’d up the kit needs to be and the more it might take it away from the things it does well…

I too have been trying to log as much as I can of late (with DataMine) so potentially that information can be leveraged by something else, but it’s been difficult to see what will come to leverage that data and where should i store it (a syslog server??). I will have a look at @Quinten’s Event Logging tool now that you’ve mention it, as the key for me is to have all that history data in one place to help the Controller present some form of intelligence (after all in part, our intelligence is what we know)

For things like voice activation i went with the Siri proxy interface and with that even I could potentially write scripts to present a level of intelligence, but to achieve the holy grail it would need some serious coding and I think they’re called algorithms… :wink: .

Thinking outload, even if someone did create an intelligent HA would I want to turn my house over to it…? I’m not sure, but I’d certainly like to find out.

All good questions/thoughts @S-F and thanks for making me think even more about it.

I really enjoyed reading this thread - and the blog of Ian Mercer - and it has taken me a while to assimilate it. Thinking more about variables, persistence, and history, it seems to me that, in Vera:

[ol][li]Device variables give us persistence[/li]
[li]dataMine gives us history (alas, from a programming point of view, it is write-only memory)[/li][/ol]

So, actually, when you say:

…you’re right, and it’s already been done. However, for this:

…you may be right, but I think this underestimates what’s possible now, and what might be in the future with forthcoming versions of Vera on faster hardware.

By way of demonstration I offer a light-weight, read-only wrapper for the dataMine database, loosely modelled on the Berkeley DB Core API. (This is an open-source, non-relational database designed for storing and retrieving key/data pairs - just what’s needed here - full documentation: [url=http://www.oracle.com/technetwork/products/berkeleydb/documentation/index.html]http://www.oracle.com/technetwork/products/berkeleydb/documentation/index.html[/url]).

Whilst this may mean little to a non-programmer, what it means is that it is very simple to get variable history back out of the dataMine database for any recorded variable.

dm,status = dmDB.open ()
dmc,status = dm:openCursor {key = {Variable = "CurrentTemperature", Device = 51} }	
x,t, status = dmc:getSearchKeyRange {t1 = os.time{year=2013, month=1, day=1}, t2 = os.time{year=2013, month=11, day=11} }
dmc:close ()
dm:close()

Line by line, this:

[ol][li]opens the database (with default parameters: location, etc.)[/li]
[li]opens a cursor (which allows random access) onto a specific dataMine channel[/li]
[li]gets all the data/time pairs for t1 <= range < t2[/li]
[li]closes the cursor[/li]
[li]closes the database[/li][/ol]

Simple as that. You can have as many cursors opened on different channels (or, indeed, the same) as you like. Other ‘get’ methods allow you to step forwards or backwards by individual samples (which is only slightly less efficient that retrieving a whole block at once, because each cursor has its own cache of a week’s worth of data.) Cursor keys can include Luup service / variable / device information, as above, or dataMine channel Name or Id. They can be truncated (eg. “Temp” for “Temperature”) but together must identify a unique channel.

This just retrieves raw data. What this is not is a proper Data Historian API layer, which would allow you to do all the things which Ian Mercer blogged: count transitions, calculate max / min / averages, resample, … this will be my next but one project.

It’s a few hundred lines of pure Lua - no Luup calls - so will happily run on a separate machine (I’ve done most of the testing on my development machine with a snapshot of my entire dataMine database, some 90 channels.) Code and documentation attached. I’d be pleased to hear any feedback from interested parties.

It’s been suggested that I start a new thread to comment on the dataMine / coding aspects of my previous post.

I have done, it’s here [url=http://forum.micasaverde.com/index.php/topic,17499.0.html]http://forum.micasaverde.com/index.php/topic,17499.0.html[/url]

More philosophical discussion on HA in general, should no doubt remain here.

With all the smart people here, working together to create plugins, scripts and so on…
Are we capable of co-creating software a step further then where Vera is now?

e.g. What if we create an Proof Of Concept (POC) together, about what HomeIntelligence is to us? What it should be capable of…
Will we be able to create our own software, based on the POC?

[quote=“Thiemen, post:6, topic:176569”]With all the smart people here, working together to create plugins, scripts and so on…
Are we capable of co-creating software a step further then where Vera is now?

e.g. What if we create an Proof Of Concept (POC) together, about what HomeIntelligence is to us? What it should be capable of…
Will we be able to create our own software, based on the POC?[/quote]

I would suggest that there isn’t enough interest or dev free time. Just look at how little attention this thread has generated with what, I at least thought, was something that would be relevant to most of us who tinker with HA.

Vera does not have adequate resources.
I contend that Vera only has adequate the resources to do two of the following (1 &2 or 2 & 3):

1) Home Monitoring (temp, motion, video etc.) 2) Home Control (turning lights, sockets, increase temps etc.) 3) Home Automation (controls reacting to triggers etc.) 4) Home Intelligence

I am hoping with Vera4 I and do 1,2 and 3.

[quote=“RichardTSchaefer, post:8, topic:176569”]Vera does not have adequate resources.
I contend that Vera only has adequate the resources to do two of the following (1 &2 or 2 & 3):

1) Home Monitoring (temp, motion, video etc.) 2) Home Control (turning lights, sockets, increase temps etc.) 3) Home Automation (controls reacting to triggers etc.) 4) Home Intelligence
[/quote]

Which is one of the main reasons I suggested a secondary layer. The other reason is the limitations involved in working with Vera from a development standpoint.

i welcome this development. I am not a programmer but with help of this forum i tend to find my way around.
The storing of variables through Datamine is a valuable ‘pocket’ of data for later interpretation, as you mentioned.

By connecting to the database you can then find patterns, sequences, dependencies etc… (statistics)

I truly believe that because of this our homes can become even smarter when you can guide the owners, maybe through apps, by providing analysed data.

I will follow this thread and hope that i will find some opportunities as well to work with this idea…

Thanks!

Hi,
it’s a great developpement !
but can you give some examples ? …

For example I want to make the sum of the consumption of all my devices for a given period that are recorded via datamine plugin and then this result is displayed in a Virtual Device
Is this possible?

[quote=“veravance, post:11, topic:176569”]it’s a great developpement !
but can you give some examples ? …[/quote]

There’s a conversation with coding and examples going on at the thread I pointed to previously: [url=http://forum.micasaverde.com/index.php/topic,17499.0.html]http://forum.micasaverde.com/index.php/topic,17499.0.html[/url]