Keep MacBook from Sleeping with Lid Down

The MacOS app Amphetamine is pretty slick. As promised, it keeps my MacBook Air awake even if the lid is closed and there is no external display attached. So now I can run it as a part-time file server (via SFTP and Secure ShellFish for iOS). At least, that’s the plan. Since it is running on a laptop, I really appreciate the audio alert it’ll give if I unplug the MBA while Amphetamine is keeping it awake. Now that MacOS 10.15.5 has battery aging management, now is the time to try this out.

My goal is to somehow simplify things by no longer needing an aging QNAP NAS and using a single platform. I love the idea of having a spare laptop but also actively using it and getting more value out of it.

Fruit Tree Irrigation: an Experiment

For several years I’ve watered my fruit trees using a Generation 2 Rachio controller and their irrigation method called “Flex Daily”. This method relies on many variables, a few of which I can only make good guesses at. For example, my soil’s Available Water Capacity from the U.S. Soil Survey.  Flex Daily on Rachio is really designed for watering lawns, and I don’t care about lawns. I water fruit trees with unevenly spaced emitters. So the other advanced zone variable that’s not easy to determine due to my needs is the Nozzle In/Hr setting.

Here is a formula I use to convert from my drip emitters GPH to In/Hr:

(96.25 * Q * 0.0167) / A = PR

Where Q is Gallons Per Hour (GPH) and A is, in the case of trees, drip line or canopy area. 0.0167 changes GPH to the needed Gallons Per Minute (or divide by 60).

Rachio’s Flex Daily method worked fine for the past few years, though it seemed to water too much in a day and too infrequently causing regular water stress in certain trees. I figure that’s because Flex Daily relies heavily on the AWC and root depth. It then waters to what it expects is the root depth.

Recently, in preparing for this irrigation season, I learned about a daily tree watering model from the University of California’s Center for Landscape and Urban Horticulture. I had always wondered what model local orchards use, and I bet it is this one because I have often seen the almond orchards watered daily. But with Rachio’s Flex Daily, it was every 3-5 days. According to the Center for Landscape and Urban Horticulture, deep watering of trees can actually be disadvantageous as water can leach nutrients to a depth where roots would never reach them. They also write that when using drip emitters, depth of watering isn’t as important for trees as the volume of water they actually need. I assume from this that the bulk of tree roots that take up water are shallow.

With Rachio’s Flex Daily, I had the root depth set to 8 inches for my trees. According to tree (crop) evapotranspiration (ETc) needs, it’d attempt to water to that root depth. But my settings would have to be perfect for that to work right — especially the Available Water Capacity. I’d also have to be reasonably certain about my tree root depths, which I am not! I doubt my settings are good enough for the watering depth to be accurate, especially as soil is not homogenous. Was this Flex Daily method watering well beyond the tree roots? Without digging some deep holes I’d never know. So the Center for Landscape and Urban Horticulture’s daily watering method for drip immediately appealed to me. All I need to know, for this method, is the tree’s drip (canopy) area and the tree’s Plant Factor (or its daily water usage):

 Gallons = ETo × PF × (R× R × 3.14) × 0.623

Where ETo is the reference evapotranspiration (figured from grass), PF is the Plant Factor or Crop Evapotranspiration coefficient, and R is the radius of the tree’s canopy. 0.623 is the conversion to gallons. ETo * PF results in the inches of the plant’s water use.

To get the water needs of my trees, I use the Irrigation Training and Research Center’s California Crop and Soil Evapotranspiration (PDF) guide. For my Reference ETo Zone, I use the Typical Year table to find my tree type, and then find the inches/month for my trees. I can use the above formula to calculate the amount of gallons needed per tree and then calculate, based on the total GPH of emitters under the trees, how long I need to water them. Of course, it is key to divide the monthly ET by that month’s number of days in order to get the average day’s water use.

The following image is extracted from the California Crop and Soil Evapotranspiration book. I’m interested in the monthly values for the bottom four rows. If you divide a tree monthly average by the grass reference ETo, you can get the Plant Factor or evapotranspiration coefficient. Divide the value for a tree on a given month by the days in that month to get the tree’s average water use in inches per day.

Zone 12 Crop Evapotranspiration Example

If all my trees were the same age and the same maturity, trees of the same kind (e.g., stone fruit or citrus) would have the same GPH per tree. They are not. So to get the same Nozzle In/Hr at each tree, I have to balance the emitters in each irrigation zone. For example, in my Stone Fruit zone, my mature and stingy apricot has emitters that total 12 GPH while at my much younger, prolific but severely bark beetle damaged Lapins cherry tree, has 2 GPH’s worth of emitters. But because the apricot’s drip line area is about 78.5 square feet and my cherry’s drip line area is 12.56 square feet, their inches/hour balances out to 0.246 in/hr for the apricot and 0.256 in/hr for the cherry. Close enough! So in this case, I can run the zone for nearly 18 minutes in April and both trees will (hypothetically) get the amount of water they need on a daily basis. This, of course, assumes the soil is suitably well draining and water can soak down some depth into the root zone. For the most part, this is the case for my trees.

So by balancing a watering zone’s trees to have similar inches/hour, I can figure the amount of time needed to water the zone:

Gallons per Day / Gallons per Hour * 60 minutes per hour = minutes per day 

(phew; the dimensional analysis would make more sense if written symbolically)

And, I can be as granular as I want at calculating the water need. For now, I’ve calculated water needs for each month using my trees’ average monthly water use. I have setup Fixed irrigation schedules for many different months using the Rachio Gen 2 controller for almost every month (if months seem similar in water use for a zone, I use one Fixed schedule). Each schedule has the month’s average ETo in the name, So when evapotranspiration regularly matches a set schedule, I’ll switch to that schedule (assuming the phenology makes sense; some trees have higher water use during certain parts of the season). I no longer need to use Flex Daily. Each zone has its own watering time based on its daily water needs. Rachio will still skip irrigating if enough rain happens, but none of the Flex features are in use now. I started this daily irrigation regime on April 22. It’s too early to say how the trees are responding, so I’ll have to report back on this big experiment.

Rachio Fixed schedules that I’ve created to suit ET and tree phenology.

.Rachio Fixed ET Schedules

I’m experimenting with [Meteobridge Templates](https://meteobridge.com/wiki/index.php/Templates) and Siri Shortcuts so Siri can tell me about the weather just by pulling data off the local network data logger. Works pretty good!

A Very Good Overcomplicated Journal Workflow

Our journal workflow is probably more complicated than it needs to be. There’s room to optimize this workflow. It grew out of our moving away from Day One when they went to the subscription model. At the time there were some terrible limitations and we wanted none of it. Instead, we went with a semi-automated method involving iOS Shortcuts, iOS Notes, 1Writer, Homebrew (for Pandoc and LaTeX toolchain), and my favorite Swiss army knife GraphicConverter. The final archival format of each journal entry is a beautiful, open standard and searchable PDF generated by Pandoc using LaTeX (MiKTeX distribution).

The Shortcuts step creates or seeds a range of dated Markdown files with dated headers. The filenames follow the very sortable format of “yyyy-MM-dd HH.mm.ss.md” or, for example, "2020-02-09 19.24.38.md". Of course, with Shortcuts limitations interacting with Files, I have to create the files in the Shortcuts folder and then move them to the 1Writer iCloud folder. Once those are seeded, we copy and paste from shared Notes to the Markdown files. I add a ✅  Checkmark emoji at the top of each Note that I’ve transferred so me and my partner know it’s been copied over. 1Writer is setup to save all journals to iCloud.

If we need to add a photo to a journal entry, we split screen with 1Writer and Photos and drag a photo over to 1Writer. 1Writer puts the image file, with the original filename, in the same folder as the Markdown files. If we need a collage, we create it in Google Photos app (though we don’t actually use it for sync!) because it does  a really good job at collages of photos with different dimensions. Google Photos saves the collage to Photos and we go from there.

Once a month’s worth of journal entries (Markdown files) are complete, I then have a workflow to convert the Markdown files to PDFs. This is where Finder, GraphicConverter, Pandoc and LaTeX come in.

Since 1Writer is using iCloud, it’s all downloaded to my MacBook without any effort. So first I copy the files to a non-iCloud syncing folder in my ~home folder. I then make sure the space in the .md file is turned into an _ before processing (won’t be escaped automatically with this command line “script”). Finder makes this child’s play by multi selecting files in Finder, right click, and click Rename n Items. This Rename feature is something I deeply miss whenever I’m on a Windows 10 machine.

Next, some photos won’t be properly rotated, so I use GraphicConverter to Auto-rotate photos by clicking the Rotation icon on a thumbnail in Browse mode.

Next, I finally run a command that I modified from somewhere on the internet. I was not talented enough to put this command together from scratch. This command is why I had to wait on installing Catalina until Homebrew was compatible with it. With the following command, you just need to have a working Pandoc and LaTeX environment with a subfolder named Archive:

cd ~/Journal-compile/
for f in *.md; do pandoc $f -o ./Archive/${f%.md}.pdf -t latex; done

To be neat, I then rename the output PDFs so that the _ are spaces. I’m not a monster. 

Then I load GraphicConverter, and in Browse mode, use the “Set Exif Date from Filename” tool on all the freshly minted PDFs. This sets the file date to the date of the journal entries. The format I use is YYYY-MM-DD. Then I copy the PDFs and source files (with images) to various Cloud and NAS folders. Of course, I keep the PDFs separate and that’s what we always reference back to. PDFExpert is currently our choice app for viewing journals since it has excellent file content search and SMB syncing.

Now, a lot of this is broken up so the workflow isn’t onerous. But I admit for most people, this is just ridiculous. But the benefit of this workflow is our memories are in a open format where it matters with no proprietary nonsense.

Since you likely read through all of this, here’s the Shortcut for generating blank journals. I bet it is also more complicated than it needs to be. But it works well.

Shared Photo Libraries

All these years Apple still has no way to share entire photo libraries with family. The shared family album is useful only to temporarily share the week's photos. So I use [PhotoSync iOS](https://www.photosync-app.com) App to sync our iPhone photos to the NAS, files prefixed with first names, and then once a week manually import to the two libraries via macOS Photos. Works well enough but Photos has very poor dupe detection. Supposedly iOS detects dupes -- I wish they would surface them in an aptly named album. Once imported, I use PhotoSync to mark the new imports on each device all as sync'd and then delete the week's worth of shared photos from the family shared album. That's two nearly exact copies of a 50 GB photo library stored in iCloud. We used to use Google Photos but decided they no longer deserved analyzing our lives.