In the previous post, we covered our motivations for automating, and the high-level of what we want. This post will detail how to do it.
What you'll need
- A Smart Things hub. Make sure your lock is already added to it and working.
- A ZWave lock. I use the Kwikset 910 with ZWave card...making it essentially a Kwiket 915.
- A Zapier account. A free account level will work.
- A Zapier Parser Account. I don't know why it's a separate account from Zapier...
- A Google/Gmail account. This is used for the calendar functionality. You can also use the filter functionality instead of a zap to forward emails.
- A SmartThings IDE account.
How it works
- VRBO sends email about new reservation
- Augment reservation email with guest email and forward to a Zapier zap (#1)
- Zapier parses out the guest name, email, phone, check-in, and check-out dates from the email and creates a Google Calendar event for it.
- The calendar event sends an invite to another Zapier zap(#2) that emails the cleaners
- The calendar event has an email notification set for 7 days before check-in.
- 7 days before check-in, google sends a notification email.
- The notification email is forwarded by another zap(#3) to two others: one (#4) that that emails the guest a welcome email and another (#5) that hits a Smart Things web hook.
- The Smart Things web hook schedules the door code to be added to the door about a day before check-in and removed about half-a-day after check-out.
- The guest door code is added to the door about a day before check-in.
- The guest door code is removed about half-a-day after check-out.
- The Smart Things web hook monitors door unlocks with the name "cleaners" and sends an SMS notification a few hours after use.
Zap #1: Email Parser from Zapier to Google Calendar
The first step is to setup the zap that will receive our forwarded reservation email. It uses the Email Parser from Zapier as the trigger on a new email. Then creates a detailed GooGle Calendar event for the action.
Trigger: New Email
The email parser sets up a new mailbox @robot.zapier.com, I chose firstname.lastname@example.org. You setup the parser by sending an email to it and then highlighting the fields you want to pull out. It's somewhat magical, but it's not perfect. Just pull out what you need. I had to play with it a bit to make it work right. You'll want several reservation emails to send to it. I created a field for user, email, phone, check-in, and check-out dates.
Action: Create Detailed event
You want to create a detailed event, using the user, email, phone, check-in, and check-out dates from the trigger.
The only other item worth noting is you'll want to add an invitee. The email is the email of another zap. For now, just pick the email address, I chose email@example.com, we'll create that zap next.
Zap #2: Email Parser from Zapier to SMTPThis rule takes the "you've been invited to this event" email sent from Google Calendar and turns it into an email to your cleaning crew.
Trigger: New Email
We've created an email here of firstname.lastname@example.org, which is invited to each event from google calendar. So, as soon as we make the event, an email is sent and we translated into a something more condensed for the cleaners. We set up parsers again to pull out all the fields from the event invite so that we can use them in the action step.
Here, we condense just the parts we need into a nice format for the cleaners.
Zap #3: Forward calendar notificationsOne week before check-in, Google Calendar will email your GMail with a reminder. We need to essentially bounce that email to Zapier, this rule does that.
Trigger: New Email matching search
Action: New Email
Set the to address to another Zapier parser address, I used email@example.com. Set the subject and body to be that from the original email from the trigger step.
Zap #4: Email Parser from Zapier to SMTPThis Zap takes the inbound email sent to firstname.lastname@example.org and converts it to a nice email for your upcoming guest.
Trigger: New Email
Similar to the email to the cleaners, except this time it's customized for the notification email. It pulls out name, email, phone, and dates to be used in the action.
Just fill out the fields for the email for your guest and wallah!
Zap#5: Email Parser from Zapier to Webhook
This zap warrants it's own post for setting up the webhook in smartthings. Read on!