Turn On/Off Sighthound Security Cam Rules via IFTTT

We just moved, and in my last apartment, we lived on the second floor and I had my Foscam security camera [~$60] (which is controlled by the Basic version of Sighthound Video [$60]) trained on the only stairwell, which only captured people arriving or leaving. However in our new house, none of the doors are in locations where the camera only captures egress & ingress events.  There’s a bathroom right next to one door and the other is between the living room and the stairs.  Thus, anywhere I set up a security camera is bound to capture the regular activity inside the house. So I first experimented with setting the rules to make the cameras active during certain hours on the weekdays, which turned out pretty annoying, because my wife’s schedule is random.  What I needed was a way to turn the camera rules off & on based on when we arrive & leave the house, the same way I use WeMo to control the window unit air conditioners and the air filter.

I discovered that Sighthound has an IFTTT channel and an iOS app, but their IFTTT channel only has triggers upon motion detection and no “actions” that could be run using Life360 (the app I use to control the AC & filter – e.g. turn on when the first person arrives and off when the last leaves or vice versa).  So I emailed Sighthound to see if they had any tips for enabling and disabling camera rules.  They pointed me to one of their forums called Hacker’s Corner, where I got pointed in the right direction.

Here’s how to enable your security camera (rule) when the last person in your family leaves the house and disable the camera when the first person in your family arrives.

Continue reading

Arctic Blast Ice-Jam Warning System

Last winter, a house that I rent out sustained 11 thousand dollars worth of water damage because an ice jam formed above the gutters.  I learned a lot about how this happens during the ordeal.  Heat from the house melts the bottom layer of ice & snow on the roof.  The water from the melting trickles down the roof, but once it gets to the eaves (away from the heat because the eaves are not enclosed and extend away from the house), it freezes and forms a dam.  Since the water has nowhere to go, it backs up from the eaves between the roof and the ice above it and gets under the slates/shingles.

My tenants didn’t notice the water coming in in the dining room through the ceiling and walls until the damage had started showing on the first floor.  Once I was alerted, I hired a company to come and remove the ice dam above the gutters.

The conditions needed for an ice dam/jam to form on the roof are 4 or 5 days where the temperature never gets above freezing and ice or snow has accumulated on the roof.  Dealing with the ice jam was such an ordeal that this year, I wanted to figure out a way (or ways) to get an early warning that an ice jam could be forming.

I had an idea to use a moisture sensor in the windows that would sound an alarm if water made contact with the sensor.  There was one window in particular where the water built up the most, so I bought this cheap moisture sensor (only $12) and installed it between the window and the storm window:

moisturesensor

However, by the time it goes off, a good bit of damage will have occurred already.  That makes it a good backup, but I needed something predictive.  Long ago, I had tried looking into the possibility of getting weather alerts when the temperature stays below freezing for multiple days, however after installing tons of apps and even looking into IFTTT‘s weather channel, the best alerts I could find were when the temperature went below freezing on a single day.  So today I finally sat down and rolled my own way to get an alert after 4 or more days of freezing temperatures in a row.

The basic idea was, I wanted to use IFTTT‘s weather channel to add tomorrow’s high temperature from the forecast to a google spreadsheet every day.  I then would create a google script attached to the spreadsheet to email me when the last 4 entries in the spreadsheet all had values below 33 degrees (F).  The script can be set to be triggered whenever a new row is added.

The first hurdle I faced was that IFTTT only lets you set 1 location for weather alerts and I already have my location set to where I live (not where the house I rent out is) and I already have weather recipes that rely on my location (e.g. when the pollen count gets high, turn on my air filter).  If I was to change the location, all my recipes would use the new location, which made no sense.  So I posted to the reddit IFTTT board and found out from the suggestions there that you can create multiple IFTTT accounts connected to the same gmail address by using gmail’s magical “+” feature.  So if your gmail address is johndoe@gmail.com, you can register an alternate IFTTT account using johndoe+ifttt1@gmail.com.  Note, after you create the account, you’ll need to go into your account settings and change your default username from “johndoe+ifttt1” to something like “johndoeifttt1” because IFTTT complains about the plus sign.

Next, you must create an IFTTT recipe (now called an “Applet”).  The trigger will be the weather channel’s “tomorrow’s forecast” trigger and the action will be to add a row to a google drive spreadsheet.  The settings when you’re done should look like this:

temptospreadsheet.png

Note, you might need to add the Google Drive and WU Weather channels (now called “Services”) to your IFTTT account.  Make sure to go into the weather channel’s settings to ensure it’s set to the correct location and that you’ve given IFTTT‘s google drive channel permission to access your google drive.

Next, you’ll need to create a google drive folder named “IFTTT” (or whatever you entered in the recipe above).  In there, create a spreadsheet with the name you used for the IFTTT recipe.

You then need to add a script to the spreadsheet.  In the google docs tool bar, select “Tools->Script Editor…”.  Replace the code there with the following code, but be sure to enter your email address you want to receive the ice jam warnings.  Click the image to access copyable code on pastebin:

freezingmonitor.png

Save the script, click the “Select function” drop-down list, select the “createSpreadsheetChangeTrigger”, and click the play button.

You can now close the script editor window and test out your spreadsheet by entering temperatures in the first column.  I entered “22”, 4 times to test it out.  2 things should happen upon entering the 4th value:

  1. You receive the email alert
  2. Column 3 gets the value “ICE JAM WARNING!”

Now, when IFTTT adds a row, if it’s the fourth or more day in a row of freezing temperatures, you’ll get an email warning that maybe you should check for an ice jam!

Today’s Apple Feedback: Recalcitrant Shared Calendar Notifications

There seems to be no end to the efforts to quell unwanted event notifications on the iPhone. Don’t get me wrong, I love well timed (and desired) notifications, but Apple has fallen far short of the mark when it comes to taming notifications, especially those from shared calendars. This bug I’ve found is particularly insidious. My wife shares her calendar with me and despite having it set to “Ignore alerts”:

ignore-alerts

I still get notifications about her events on my iPhone:

alert-on-phone

Incidentally, there’s no way to set “Ignore alerts” on the iPhone.  You have to do it on a computer or perhaps on the iCloud website.

The kicker here is that I don’t think I’m actually getting notifications that she has explicitly set and I am not getting these notifications on my computer:

no-imac-notif.png

The event in question, i.e. the notification which finally pushed me over the edge to look into what the heck was going on here is one my wife has on her calendar for tomorrow.  Note also here that my computer shows that the event has no notification/alert set:

imac-calendar-event-no-notif

And the event is on her calendar that is shared with me, as seen both in my phone’s calendar settings:

cal-shared-with-me

and in the google calendar sync settings:

gcal-sync

And even though my computer shows that the event has no alert set, unbelievably, the same event on my iPhone does show an alert:

def-alert-added

I couldn’t figure out why my iPhone had an alert set for the same event for which my calendar on my computer showed that there was no alert set, until I realized that the time of the alert was the default time I’d set on my iPhone:

def-alert-setting

So what this means is that if I sync a google calendar shared with me on my iPhone, even if I set the calendar to “Ignore alerts”, and as long as I have a default alert setting for my calendars on my iPhone, I will get my default alert from those shared calendars’ newly created events.  Phew! That’s a very specific loophole in calendars in iOS, hence Today’s Apple Feedback:

My default alerts are being added to events created by others on my synced version of their calendars shared with me

I could not figure out why I was getting alerts on my iPhone for events on calendars shared with me and I think I figured it out. The default alert setting on my iPhone is adding alerts to events created by the sharer ONLY ON MY IPHONE’S SYNCED COPY of their calendar. My computers show that the event has no alert set, but my phone shows my default alert for newly created events on that event and the alert goes off despite “ignore alerts” being checked for that calendar. I have catalogued all the evidence of this in a series of screenshots from both the iPhone and my iMac. The event for which I got the latest notification was “Jeffrey will call”, which is an event my wife created on HER calendar. See linked images.

I’m still running iOS 9.3.4 on my iPhone, so I hope that my next update will address this issue, but somehow I doubt it. I will post an update after the iOS update. I’ve been holding off on the next iOS update because I was given a very specific and lengthy set of instructions from Applecare on performing the next update to address a slew of other issues I’ve had since I buying my new iPhone 6S early this year (2016), mainly the fact that Siri initially doesn’t work after plugging in a pair of headphones (an extant problem right out of the box), but that’s a whole other blog post. Note, my version of OS X in the screenshots is OS X 10.12.1 (Sierra).