|
|
trail de-poison-ivyification Tuesday, August 13 2024
A feature that I was able to finally complete today in my ESP8266 Remote Control system was one whose necessity occurred to me once I'd added automation to the system and then wanted to make manual changes to turn device features on and off. If I did this while autmation conditions were such that the changes would automatically be reversed, then my manual changes would have no effect. An example of this was when we arrived at the cabin and I decided to turn off the basement window fan (which uses the better part of 100 watts to run) so I could allocate its electricity budget to something else. Since the conditions to turn the fan on were simply "whenever the outdoor temperature is greater than 70 degrees Fahrenheit," the fan would immediately turn back on unless I also disabled automation. But if I disabled automation, there was a good chance I would forget to re-enable it when we left the cabin. The solution I came up with over the past week or so was to store two additional values with every device_feature. One is the time in hours during which an automation override would go into effect. The other was a timestamp of when an override began. If, when attempting to automate a change to the state of a device_feature, a datetime was found in automation_disabled_when and that automation_disabled_when datetime was less than
restore_automation_after hours in the past, then the automation action would be skipped. To set automation_disabled_when, one could do so manually using the backend control website. Or, if one used the Local Remote to turn a device_feature on or off, automation_disabled_when would be set automatically at the instant the change was made. Then, restore_automation_after hours later, automation_disabled_when would be set to null and automation would resume. This would allow me to set different restore_automation_after values for different device_features, allowing automation suspension to timeout in different appropriate timeframes. For EV charging, that timeframe might be as little as six hours. For the water heater, it might be as much as 48 hours. Of course, once automation is suspended, it can always be re-automated manually by simply clearing automation_disabled_when.
As part of the implementation of this feature, it also made sense to start logging the user_id of whoever is initiating such changes, at least when known. Such information is available when manual changes are made using the backend website, though the Local Remote is an implicitly trusted device that anyone can use, so the user_id from changes made with that are unknown.
This afternoon I took Charlotte on a walk down to the Stick Trail with a specific goal in mind. I brought an especially long pair of needle-nosed pliers so that I could remove a sprig of poison ivy from the trail. I didn't remember exactly where I'd seen it, so I had to keep my eyes to the ground for the whole walk at least until I found it. Where I found it was a little after the trail left our parcel maybe a half mile from home. I extracted the poison ivy and continued walking. I would've walked the Stick Trail all the way to its end had I not set down the pliers while photographing an Amanita mushroom and then forgotten to take it with me. When I remembered, I doubled back down the trail and continued all the way back home once I'd found the pliers.
I'd taken 150mg of pseudoephedrine to help me with the programming tasks, but I managed to effectively wind down at the end of the day usig diphenhydramine alone.
Poison ivy in the middle of the Stick Trail just before I removed it.
Click to enlarge.
The Amanita mushroom I photographed.
Click to enlarge.
For linking purposes this article's URL is: http://asecular.com/blog.php?240813 feedback previous | next |