I have a simple problem that has cost me way more time than it should have.
I want to beep a horn controlled by a Z-Wave device, subject to the following requirements:
There is at least one simple way to meet requirements (1) and (2), and it works:

What I don’t like about this approach is the overhead. Even if the horn isn’t triggered for the next three months, the event engine still has to check every 20 seconds to determine whether beeping is to be done.
An alternative approach, though it requires two events, ought to add zero overhead to event processing during those same three months while the horn is not needed. The first event is triggered when the controlling device becomes True:

The second event has a trigger condition requiring that the controlling device value is still True. If so, it simply invokes the first event:

To my mind, the alternative design is superior because it respects requirement (3). For three months, the event engine doesn’t have to do anything to support the horn. And it works for a minute or so– until it encounters an “Object reference not set” and quits:

That log message may provide info for somebody, but certainly not for me.
Perhaps I have made a logic error in my alternative design, though it seems quite simple, and it does work for just a little while. But I do believe that, if one’s system isn’t running scripts (as mine is not), then any “Object reference not set” in a logged error message amounts to a confession of a bug in somebody’s software. Am I wrong?
One of the many things that I really like about the HomeSeer forums is the courtesy members extend to one another. From what I’ve seen, flame exchanges are almost nonexistent. On the other hand, I sometimes wonder whether that same courtesy encourages folks to look the other way when bugs should be addressed.
My personal priority wish list puts bug fixes ahead of eye candy every time.
I want to beep a horn controlled by a Z-Wave device, subject to the following requirements:
- The horn beeps only while the state of a controlling virtual device is True.
- While beeping, the horn sounds for 3 seconds, then is quiet for 17 seconds. The cycle is repeated every 20 seconds while the controlling device value is True.
- Because the horn is expected to beep only once every few days – perhaps every few months, the event design should minimize system overhead when it is not beeping.
There is at least one simple way to meet requirements (1) and (2), and it works:
What I don’t like about this approach is the overhead. Even if the horn isn’t triggered for the next three months, the event engine still has to check every 20 seconds to determine whether beeping is to be done.
An alternative approach, though it requires two events, ought to add zero overhead to event processing during those same three months while the horn is not needed. The first event is triggered when the controlling device becomes True:
The second event has a trigger condition requiring that the controlling device value is still True. If so, it simply invokes the first event:
To my mind, the alternative design is superior because it respects requirement (3). For three months, the event engine doesn’t have to do anything to support the horn. And it works for a minute or so– until it encounters an “Object reference not set” and quits:
That log message may provide info for somebody, but certainly not for me.
Perhaps I have made a logic error in my alternative design, though it seems quite simple, and it does work for just a little while. But I do believe that, if one’s system isn’t running scripts (as mine is not), then any “Object reference not set” in a logged error message amounts to a confession of a bug in somebody’s software. Am I wrong?
One of the many things that I really like about the HomeSeer forums is the courtesy members extend to one another. From what I’ve seen, flame exchanges are almost nonexistent. On the other hand, I sometimes wonder whether that same courtesy encourages folks to look the other way when bugs should be addressed.
My personal priority wish list puts bug fixes ahead of eye candy every time.
Comment