Copy

Home Control Assistant Newsletter for Mar 27 2022

Have you read the Important Announcement posted on August 1, 2021? If you haven't you need to.
Long running programs
In my own home I have programs that run every so often. These programs look at environmental conditions and, based upon what they see, do stuff. From looking at user designs sent to me while handling support questions I see that these “long running programs” are not uncommon. 

I want to cover two aspects of this today. The first is a “best practice” for this sort of task, and the second is part of my quest for better resiliency.

The old way to handle this sort of “every ‘n’ minutes do something” was to create a program that performs the action and then executes a delay programmer element to wait for the necessary hold time and then begin again. A better method is to use the “Run again” option. The option for this is on the program “Advanced Properties”.




All you need do is to enable the option and choose the time to wait after execution completes to begin again. Why is this better than using a Delay element? Three reasons. First, I find it a “cleaner” solution. You need not have all paths through the program converge at the Delay element. This can easily be overlooked in large programs and if one path doesn’t go to the delay element then the program terminates if that path is taken. Second, it is more reliable. If the program unexpectedly terminates for some reason, it will not restart because once stopped there is no mechanism to get it going again. The last reason is that a program that uses the “Run again” option can be suspended and while suspended the program will not be started but will continue to process the Run again option. It keeps trying to start every ‘n’ minutes, and while suspended it will not start but when the suspend is removed it does start.

What if something goes wrong? What if for some reason the program doesn’t start and run every ‘n’ minutes? Maybe you were modifying the program and forgot to start it up again. I have done this more than once I can assure you!

In HCA 17.0.34 the concept of an “overdue device alert” was broadened to allow for configuring that alert for programs and devices. If a program is on the overdue list and it has not executed in the specified number of minutes, then it raises an overdue alert. I have my system configured to send me a message so I know something has gone wrong, and to just start the program again. The handler for the overdue alert is provided the name of the object that is overdue, which in this case is the program name.




Long running programs are useful and using these two features – the “Run again” option and the overdue alert - can make your design easier to manage and more resilient.
If you are using a version of HCA prior to version 17, you may have questions about the wisdom of upgrading to version 17 given the future of HCA. Here is something to consider:

The support policy for older HCA versions has been changed
 as I can no longer devote time to past version users. Support will only be available for HCA 17 users.

If you are on version 16 or earlier and want to continue using the cloud features and want to be assured that if you have a question that it gets answered, it is indeed time to upgrade.

HCA is fully operational for several more years so the update cost, spread out over that time, is very little. Knowing support is available when you need it is worth it.
Upgrade to HCA 17
Anyone who is using Hubitat with HCA – not SmartThings – please drop me a note as I would like to add you to a discussion list for those users. I have some Hubitat ideas that I would like to “kick around” and it would help to have a group of users who have experience with Hubitat. Please just send a note to the regular support address saying you would like to be added to that discussion list.
Copyright © 2022 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