Airbnb automation (dynamic calendars based on guests)

@tykeal I saw you were playing with airbnb calendars and wondered if you had got over the issue that is bugging me which is that the calendar start & end date attributes switch to the next booking at midnight of the guests last night.
I want the heating to shut down after they’ve gone not at midnight when they are still there.

@ianadd yes I have been playing with an integration for AirBnB calendars. It’s intended to work hand in hand with Keymaster, but right now it’s not a strict requirement (and it may never actually be a hard requirement).

My current work is available here: GitHub - tykeal/homeassistant-rental-control: Rental Control system for Home Assistant

At present what you can do is the following:

  • Add an AirBnB calendar
  • Add prefixes to the Reserved events (in case you have more than one calendar you wish to configure)
  • Set a Check-in time (defaults to 16:00)
  • Set a Check-out time (defaults to 11:00)
  • Set how far into the future you wish to fetch in days (defaults to 365 / aka 1 year)
  • Select the Keymaster lock configuration you wish to tie against (though it doesn’t do anything right now and None is valid)
  • State what lock slot management will start at (defaults to slot 10) this is presently unused
  • Define the number of event sensors to create (defaults to 5) this will in the future be how many lock slots are actually managed

What this does it pull in the AirBnB calendar and refreshes it every 2 minutes.

It creates a calendar object and populates all of the events. Additionally, it rewrites the events to have actual start and stop times instead of being all day events. I’m pretty certain that this is what you’re really wanting.

In my personal HA I’ve also installed via HACS the Atomic Calendar Revive frontend which I’ve found makes it really easy to see the upcoming schedule when configured in event mode. Especially with the maxDaysToShow set to 30 or more so you can see the entire month. The Calendar view itself isn’t as useful as it doesn’t differentiate multi-day stays very well in that view.

Using the rudimentary integration as it is now would allow you to have better ability to control climate based on the calendar and sensor entities that get created by it given that you’ve got actual in/out times.

@tykeal I’ve copied the rental-control folder as instructed in your read-me.
I’ve restarted HA and no extra entry appears in integrations list.
I’m running 2021.12.7
Any other steps needed ?

Thanks for sharing

I take it this is your first time installing an integration? You’ll need to do two things for it to be available as a new integration:

  1. Restart your Home Assistant
  2. After it’s finished starting, on the integrations page you’ll need to do a force refresh for it to show up

Please note, that there is no icon available for it. I’m not an artist and I wasn’t expecting to release this to anyone just yet! :wink:

I would also recommend you get HACS installed if you haven’t done so already. When this integration is finally in a state I can consider it truly release worthy I intend to get it added there. As it is, right now I don’t pass all the needed validation tests for inclusion in HACS.

@ianadd you might want to pull the latest version. I just closed a bug related to editing rental control entities that do not have a lock associated with them. That is, Keymaster configuration to manage is set to (none).

Hi, a full refresh of of the browser solved finding it. Hadn’t thought to do that.
However it then errors:
config flow cannot be loaded

I use hacs a lot, i use atomic cal revive.

I will download the updated code as suggested.

Do you have Keymaster installed? Rental Control does have it listed as a dependency and may not fully load if it isn’t installed. I haven’t tested it in that configuration at all.

Ok, Installed Keymaster - not that I anticipate using such - so would be nice if you didn’t bind your dev to it (for me at least).
Next the add integration brings up a list of unlabelled fields to enter in info.
Your initial message gives me a clue as to what it might expect but…
1st field …
airbnb calendar ? what format and - the exported one from airbnb or the google calendar created one I currently have in google-calendars.yaml
Can it be a Tripadvisor calendar ? I use both services.

2nd field …
‘prefixes to the Reserved events’ tbh I haven’t a clue what this means.

3rd field …
???

The rest of the fields I understand.

The tick box at the bottom ??

Finally, it looks like aborting the entry of data into this dialog by changing to another HA page seems to leave HA in a corrupt state requiring a power off reboot. tbh I suspect this version of HA 2021.12.7 has some fragility I’ve not seen before.

Sorry if I am being a hassle but if you are aiming to publish it to HACS you can consider me a beta tester !!

You might want to do a force refresh of the page when you’ve got the entries up. I’ve noticed that labels don’t always load in properly when they’re first added.

The canceling and leaving HA in a corrupt state, I can’t explain that. I’m using the standard workflows show it should cancel cleanly!

As for the fields. The labels are currently (from top to bottom)

  • Calendar Name
  • Calendar URL (this must be the airbnb exported calendar. The code currently will reject any ics URL that does not start with https://www.airbnb.com)
  • Prefix for events. At least on all of my AirBnB calendars a guest staying is always titled Reserved and I’ve got two units I’ve got in my system so it was confusing. This allows you to add a prefix to events so that it comes out like Unit 1 - Reserved. This defaults to an empty string and can be ingored
  • Default Check-in time (defaults to 16:00)
  • Default Check-out time (defaults to 11:00)
  • Maximum number of days into the future to fetch (how far into the future will the integration watch for events). This really isn’t something I worry too much about, we only allow booking about 8 months in advance for our units, but I figured it would be nice to have in there
  • Keymaster configuration to manage (the keymaster locks to integrate with, defaults to (none)
  • Starting lock slot for management (defaults to 10) This is is the door lock slot that when Rental Control is finally able to do it, will be managed for door lock codes for guests
  • Number of event sensors to create. Fairly self-explanatory but it will also (once the previous variable is working as expected) be how lock slots are put under control of the integration.
  • Verify SSL certificates - in truth I should probably remove this, but it’s mostly for the eventuality that in the future I allow for more than just AirBnB calendars and people are exporting custom ics URLs from someplace that isn’t using a valid SSL cert. Unchecking it means that the SSL validation of the calendar ics file would not be performed in the fetch

Now, on to your other asks. Not binding to Keymaster is likely not going to happen. My whole intent for this integration is to get me back capabilities that I will lose when I move my rental units off of SmartThings and thus the RBoy Rental Lock Manager. Keymaster gets me half-way with the fact it’s got full automation of locks, including scheduling around them (of which I got a feature merged to suppport this). My integration is intended to be the calendar driver part of that.

Now, if someone wants to propose a patch to my integration that makes it optional in a way that doesn’t break the integration to Keymaster I’ll definitely consider it.

On the topic of calendars. I do presently have a hard requirement on it being AirBnB. The only real reason for that is that is the only calendar I’ve got access to work with. If I get access to other standardized calendars I can work out a way to either auto-detect what needs to happen or handle it just like the AirBnB calendar. In particular, I don’t want check-in / check-out times to override times that may come in from another calendar. For AirBnB I had to have them because they only present all day events. I could relax the calendar to just require that it be an ics file, but I don’t want to deal with bug reports for someone using a calendar that gets all messed up because they had start / stop times on the events and they lost it because of the check-in/out overrides.

I would love to get off smartthings for the rentals. I use vrbo as well as smartthings.
I also use guesty for managing my 2 suites so if possible adding those calenders would be great. I would be glad to beta test. Also the option to use day-in day-out for door code. Vrbo does not publish the phone number to the calendar so I use that format for both.

I will load this on my current home assistant when I get a chance and play.

Awesome to see someone working on this.

Craig

As I’ve mentioned, I’m open to PRs for getting other calendars.

Alternatively, if folks want to DM me to share details so I can get direct access to calendars and other platform specific information I’m open to it.

I probably should go create a proper post about this project instead of having semi-hijacked @Greenhouse’s request :wink:

@ianadd and @iscraigh latest code version of the integration now supports any calendar URL with the following limitations:

  • URL is an https:// URL
  • The URL must return back a Content-Type of text/calendar which AirBnB, VRBO, and Guesty all do. I assume that TripAdvisor does the correct thing as well

The events that are retained from the calendar are any event that does not contain the following in the summary of the event: Blocked or Not Available, any other event should be retained.

The integration still doesn’t actually manage the lock codes at this time. I’m still noodling on how to do that sanely :wink:

Also, I haven’t tried this yet, but my repo is configured so it should be installable via HACS though it might have some issues since I haven’t actually done any releases yet :smiley:

Great to hear of the added features. Can I suggest that blanket ignoring ‘blocked’ and ‘not available’ will cause problems for those who might take a private booking. eg family, repeat booking coming to you direct, and the such like. I get a few each year.

I’ll make it optional to ignore or not (default ignore)

@ianadd

Your request to make ‘blocked’ and ‘not available’ still be stored / represented is now in. As is your request to the Keymaster dependency optional.

Additionally, I’ve tested installation with HACS, this is working well even though I have yet to do a release. I haven’t updated the documentation, but to switch to using a HACS based install (which will overwrite the manual install you may have done safely) do the following:

Open HACS → Integrations
Select the triple dot menu at the top → Custom Repositories
Set the following

It should then be detected as a new repository, but if it isn’t, just hit the ‘+ Expore & Download Repositories’ button to add it per normal.

As new changes hit the mainline HACS will see the updates when it does its normal refreshes. When I finally switch to proper releases it should then start working correctly with that along with a more normal Changelog

2 Likes

If we wanted to not ignore Blocked/unavailable is that a menu option or do we edit a file?
I deleted and installed via Hacs all went smoothly.
Also am I supposed to have titles in the config boxes telling me what info to put in them?

Thanks

Craig

@tykeal rather than extending this I’ve raised an ‘issue’.

You’ll want to force a refresh on the integration page. So do something like this:

Configuration → Devices & Services → Integrations

Force a refresh of your browser (ctrl+shift+r)

Then to make it so it doesn’t ignore Blocked and Unavailable events you’ll want to select the Rental Control entity you want to modify and select the Configure option.

You’ll find two check boxes at the bottom of the configuration screen. The first one is Ignore events that are not standard reservations the second one deals with verifying SSL certs (useful for folks that are sourcing the ICS file from a system with a self-signed certificate :wink: After that just hit the Submit button.

I did not have those options so I deleted the custom components/rental… folder and removed the integration. Reboot and reinstalled via hacs and now it works. I also now have titles in the boxes telling me what information each box should have, I suspect something was wrong with my installation from the beginning.

Craig

1 Like

@iscraigh and @ianadd (and anyone else) I’ve finally announced the initial release of Rental Control. Please shift any further conversation related to it there, or the GitHub repository for issues.