Copy

Home Control Assistant Newsletter for May 30 2021

Have you looked over the version 17 release notes? Lots of changes that you can incorporate into your designs right away. Easy upgrade.

Looking for answers to the most common questions about HCA? Check out our
Frequently Asked Questions page.
 
An HCA problem
No, not a problem with HCA, but a problem to solve using HCA. Got a support question and took a few minutes to come up with an answer and it is interesting enough to explain here. Let’s start, as always, with as clear a statement as possible of the problem.

There is a room with a device. This device is controlled by some process and it doesn’t matter what that process is. The room contains a motion sensor. I want to manually stop the device from being controlled by the process for 4 hours. I also want that 4 hours to be cut short if there is no motion in the room for about 5 minutes.

The first part of the solution is to note that much of this can be done by suspending the device so that the process that controls it can keep doing its thing, but it has no effect on the device when suspended. The “override” program has generic ON and generic OFF triggers. When started ON, perhaps by voice, it establishes the override, and when started OFF, removes the override should that be wanted. I’ll show that program in a minute once we get more of the solution in hand.

Now for the second part. We want a “timer” program that is started 5 minutes after the override starts. It would look at the state of the motion sensor and if it shows “inactive” then we can resume the device (cancel the suspend). If the motion sensor is “active” then we can restart this program again in 5 minutes to check again. The best way to do this is like this:


The Test element is there to check the motion sensor to see if it is active or not. I’m using a Hubitat managed motion sensor so I look at a tag on the sensor device for “active” or “inactive”. If it is inactive then I remove the suspend from the device and we are done.

If the motion sensor is active then it wants to start this program again in 5 minutes. The Start-Program element lets me do this with one of its options:


The Start-Program lets me delay the start of the selected program for the configured length of time. In this case 5 minutes.

Now back to the main override program. Here it is complete:


The program starts with the obvious test for the starting trigger – generic ON or generic OFF – and if the override is being removed it kills the timer program and resumes the device. This probably isn’t needed because of the 4-hour automatic removal and the motion sensor, but for completeness I elected to implement this path.

The case where the override is established does this: First it turns the device off, then it suspends it, and then it starts the timer program. Again, using the delayed option. The start-program element has the same configuration as the start-program element used in the timer program as seen above.

And that’s it. Or is it?

There are several problems here that one may want to handle in one way or the other.

The first happens in the main program when the OFF element controls the device OFF and the next element suspends it. Because of the separate process that is controlling the device, what could happen is that this program turns it off, and before the suspend happens, that other process could turn it back on. Since all HCA program run simultaneously with all others, this could happen. We can’t reverse the order of the elements – suspend first and then off – because once suspended the program can’t control it.  What to do? I’ve elected to ignore this problem because it is low probability.

The second problem is perhaps more of a problem. Suppose that the timer program was to start at 11:05:05. Then suppose that the motion sensor went from active to inactive at 11:05:00. The timer program will see it as inactive and cancel the override. But that could be against the problem statement: we wanted 5 minutes of no motion. In this case that maybe only gives 5 seconds of no motion. Again, what to do?

It depends upon the motion sensor itself. The motion sensor usually has a configurable time delay where it doesn’t see motion for that period before it sends the no-motion signal. We could set the motion sensor for 5 minutes and then it would all work. 

But what if the motion sensor is being used for other reasons and its time delay isn’t set for 5 minutes? If set for longer than 5 minutes, then we have a real problem because we will never be able to build a solution that matches the problem. 

If it is set for less than 5 minutes we could create a program that records the time when the latest no-motion signal is received – I would use a state change trigger for this. Then we can easily see how long it has been since the non-motion signal. If it wanted to be exact, the program could consider the configuration of the motion sensor. For example, if it was configured for 1 minute of no-motion, then the program could look for the no-motion signal being recorded as happening 4 minutes ago and if so, do the override cancel.

I’ll leave that out of my solution, but it wouldn’t be hard to do.

The key to this solution, besides a clear statement of the problem which can be hard to do, is the use of the delayed start option of the start-program element and the suspend element. I hope you can now see why those options exists.
Backup!

When was the last time you made a backup of your HCA design? Not a month goes by without at least one tale of woe from a HCA user. Please use the "Design Backup Assistant" on the Tools ribbon category. The work you save will be your own.


 
Want to take the next step in automation? Want to get started with Amazon Alexa and Google Assistant and control HCA by voice commands? Even if you are a long-time user of HCA, the Getting Started guides have all the info you need on client-server, mobile applications, DDNS, and voice assistants.

All of the
Getting Started Guides are available on the support website.
 
Copyright © 2021 Advanced Quonset Technology, Inc, All rights reserved.


Want to change how you receive these emails?
You can update your preferences or unsubscribe from this list.

Email Marketing Powered by Mailchimp