Organizing HA program rules/logic/code

A major reason why home automation systems that approach useful levels of complexity fail to thrive is that with increasing complexity of rules (IF/THEN?ELSE or other logic), the system becomes too complex for all but -- or even -- the original programmer to understand. (Remember spaghetti code ?)

And as a HA system grows beyond a few lights and gizmos and begins to involve usefully complex rules and logic, the likelihood that programming errors will be embedded increases towards certainty.

The software I use (Cyberhouse by Savoy) incorporates rule-making tools such as sets and graphical ways to show dependencies. Two major shells were developed and a major installer training program implemented to try to make the rule-making robust and serviceable. Both ultimately failed commercially although the software is still marketed commercially in a narrower industry.

Comparably advanced HA software by Premise Systems, after major hoopla and hardware support, was sold to Motorola and seems moribund. I suspect that a major part of its problem was the difficulty of managing the resulting custom software at a profit.

HomeSeer in 2005 is still quite primitive compared to CyberHouse circa

1999 in terms of rule-building and organizational tools.

Any experiences with other software that manages this well. Labview shell/derivative ? MIT project ? SCADA ?

TIA ... Marc

Reply to
MFHult
Loading thread data ...

In the software world, where we deal with this sort of thing all the time, one thing at least that has become pretty universally accepted is that object oriented languages are optimal for managing complexity. A large system is a large system, and it'll remain complex, so it's just a matter of what helps manage that complexity the best.

That's why we incorporated an object oriented macro language. It's just far and away the best way to deal with these issues, by creating reusable and extensible chunks of code. In particular, it lets us create 'object frameworks' where the major logic to do something is implemented by us, and it only requires extension to apply that logic to a particular set of circumstances. This sort of framework concept is used VERY widely in the software world.

Of course, the gotcha is that it's often beyond the non-technical to really fully grok in a lot of cases. For someone who cannot handle a programming language, I don't think that it will ever be possible to truely manage the complexity of a large body of logic. Visual tools are great, but when the system gets larger, and the 'view port' into that system remains the same size, it's like trying to build a car looking through a small hole that only shows a small part of it at once.

Anyway, I guess my answer is that there's no real answer, particualrly no answer that fits all. A strict object oriented language, in the hands of someone who has the software skills to wield it, is clearly capable of doing the trick, since that is how the huge applications we all use are written. CQC is of that sort. It's around 700,000 lines of code now, and without object orientation that would be joke for me to even try to do. The complexity would overwhelm me.

I guess a visual tool, if sufficiently well done, on a sufficiently large and high res screen, could work. But I just find that they are more of a hinderance because they so limit your view. But whatever the tool, techniques are just as important, and creating a system of reusable chunks of code, each one well understandable in and of itself, and being very self-protecting of itself, is the best way to deal with complexity. And assembling those chunks into larger chunks that do the same, just writ larger. It's the proven means by which enormous chunks of logic are built in the software world.

------------------------------------- Dean Roddey Chairman/CTO, Charmed Quark Systems

formatting link

Reply to
Dean Roddey

Interesting comments. But my question was not toward programmers, but towards the user experience. The inability to develop strategy for developing, checking, and presenting rules _ at the user interface _ is a large part of the reason why HA has not thrived. Some software does it better than others -- none well enough for mainstream use in a moderately complex HA environment IME.

Marc

levels

Reply to
MFHult

I guess what I was trying to get at in my post is that, there are ways to do it that are well proven, but the fact that no one really does it well in the way you are wanting, and the fact that there are so many benefits from doing it well in that way, probably usually means that it's not really practically doable in that way, else someone would have already done it and taken over the world, right? I.e. if there's an obvious market, and everyone knows the solution to tapping that market, but no one ever delivers the known solution (even after years or decades to do so), there's probably something either wrong with the supposedly well known solution or implementation of that solution isn't practical for some reason?

In the software world, from a business standpoint, it would be great if there was a way to do exactly what you want to do in a way that would allow less skilled (read 'lower paid') people to do it. So there is a huge financial incentive to create such a solution, which would obviously be applicable to the far simpler scenario of automation logic. And there have been many attempts in the software world to do these things, but I don't think that they've really made more than incremental headway really, because complexity is still complexity, no matter how pretty a face you put on it. And the more complex, as I said before, actually the worse those types of tools become because of the limited view into the data they provide.

I think that part of the problem is this: The complexity of the problem space itself is as big a hurdle than the complexity of the tools. I.e. you could make tools that would make the actual doing of the job easier, but that doesn't make the actual problem space that much less complex in terms of understanding all the issues required to actually create the logic required. So perhaps you end up spending a huge amount of money to create a very complex tool, but then you figure out that the market for that tool is a relatively thin band of people where the group of people technical enough to understand the problem space overlaps the people without the ability to do it via other existing tools. On either side of that band, you have have one group of people who can't do it no matter how helpful the tools, and on the other side you have a group of people who don't need that kind of tool to do it because they can do it via more powerful (though more complex) tools.

Anyway, I'm not trying to dump on your concern, since it's obviously valid. I'm just, for the sake of discussion, pointing out the issues with it. And I'm not saying such things are a waste of time. I'm sure that such tools, in particular applications, are a huge boon once the time is taken to create them. But in certain problem spaces, and perhaps home automaiton is one of them, I'm not sure, the problem space itself has sufficient complexity to create the filtering issue discussed above and doesn't make for a large enough market to justify creation of the tools.

Then again, perhaps I'm completely wrong.

------------------------------------- Dean Roddey Chairman/CTO, Charmed Quark Systems

formatting link

Reply to
Dean Roddey

Some of this is reminiscent of the PCDOS-era discussions ;-)

Here are some suggestions some of which I know have been implemented in at least some software but are still generally lacking.

1) A graphical interface for rule building (Cyberhouse went so far as to use a symbol representing if-then-else as its logo ...)

One simple (seems to me) graphical tool could be a visual indicator of what devices are affected by which rules (CyberHouse does this partially. )

2) Built-in rule checking for internal consistency. Rule checking should prevent or otherwise flag the addition of a rule incompatible with existing ones (ala Excel ?)

3) Grouping of rules into named sets which can be evoked and manipulated together

4) More smart functions "Use running 30-day mean of turn ON/OFF date/time for device X .)

And so on

There's no claim that this would inevitably lead to commercial success, but I have seen near-nil progress in the last five years. And the failures continue. Home Director (w/ IBM & Sears pocket backers among others) bellied up finally last month.

Marc

Reply to
MFHult

Cabling-Design.com Forums website is not affiliated with any of the manufacturers or service providers discussed here. All logos and trade names are the property of their respective owners.