[Custom Integration] Rental Control - for AirBnB, VRBO, etc

Announcing the first release of Rental Control!

An integration for managing rental property calendars and eventually door codes with the help of Keymaster.

Current features are as follows:

  • Ingests ICS calendars from any HTTPS source as long as it’s a text/calendar
  • Define checkin/checkout times which will be added to all calendar entries
  • Ability to ignore ‘Blocked’ and ‘Not available’ events
  • Creates a customizable number of event sensors that are the current and
    upcoming events
    • sensor.rental_control_my_calendar_event_0
    • sensor.rental_control_my_calendar_event_1
    • sensor.rental_control_my_calendar_event_2
    • (…)
  • Creates a calendar-entry that can be used with calendar cards
    • calendar.rental_control_my_calendar
  • Calendars can have their own timezone definition that is separate from the
    Home Assitant instance itself. This is useful for managing properties that are
    in a different timezone from where Home Assistant is
  • Events can have a custom prefix added to them to help differentiate between
    entities if more than one calendar is being tracked in an instance
  • Door codes can be managed in Keymaster, for calendars that do not have a different timezone than Home Assistant

You know I’m in! I’ve got a lock setup that I’ve been using for testing. I’ll get this installed for some testing in the next few days.

Moving our conversation over from the Keymaster discussion

I’ve got access to the following calendar types right now:

  • AirBnB (from my own units)
  • Guesty
  • VRBO
  • TripAdvisor

The last 3 were provided to me by early adopters (before I even had a HACS release!)

Yes, that is sort of the intended design with what I’m doing with Keymaster. An HA per unit, or if the units are close enough, perhaps a central HA that can manage a few units. I’m dealing with full house rentals and they’re a distance apart (several miles :wink: )

My current design is to use the last 4 digits of the phone number as the lock code. It’s what I currently do with the RBoy app. I’ve got a feature request to support some other code generation (say based on in/out dates) but that’s not my initial focus. I’ve noticed with the calendars I do have access to that none of them have the in/out times in the events, though I’ve seen that if I had access to the Guesty API (which I’m not doing anything with) that’s actually something available in the delivery payloads. So, Rental Control just allows you to set a default in/out time and it adds that time to the in/out dates. Nothing is planned for how this gets communicated to the guests and that would presently be an implementation detail for the unit manager :smiley:

My plan on this is to actually monitor the start / stop schedule in Keymaster. If the time is changed then update calendar entries to track it, but it’s all in Keymaster’s control to make sure that the codes get in and out of the locks at the needed time. There is no current plan to allow for a manual shifting of the start or stop date.

Finally, please note, that this is very much a work in progress. I’ve got the basic calendar and sensors working already. What I don’t have working is actually getting codes added to Keymaster. I’m still trying to figure out the best way to do that.

Yep, totally get that it’s a work in progress. I’m happy to be a guinea pig.

I’ve installed Rental Control for use with my test lock and from what I can tell, it’s looking good!

A couple of questions:

  • I’m not using Prefix (I’ve only got 1 calendar and 1 lock). I’m curious how this works though. Is it for multiple calendars using the same installation? Does the Prefix need to match something else or is it just an internal reference of some sort?
  • Starting Lock Slot for Management. Is this the slot to start using for they RC codes? Meaning, 1-9 in a setup where the value is 10 are reserved for static programming? If this is the case, in the example where you have 10 as the default, and we setup 5 sensors for RC, do we need 15 slots in the initial KM setup? Or does RC setup its own slots?
  • Depending on the answer to your last question, when Rental Control is sending lock codes, will they show up in the KeyMaster with the PIN in the dashboard?
    And finally, when do the details of the reservation get sent to the lock? If we have 5 slots, do the next 5 reservations use those slots or does the code get sent to the lock immediately?

I have RC installed and this is what I’m seeing. Using the Kwikset 914.

  • Using an AirBnB calendar link for this one.
  • I’ve got 10 code slots in KM. I’ve set RC’s starting lock slot for management at 5 and my number of sensors to create is 5.
  • sensor.rental_control_calendar_event_0 state is Reserved - 1 March 2022 16:00 (correct check-in date and time) and it shows details for the reservation. All info related to the reservation are correct.
  • What’s ETA?
  • calendar.rental_control_calendarname state is off.
  • Calendar card on dashboard and it shows the reservation.
  • The code doesn’t show up in the dashboard under slot 5 (or any other slots) and the code doesn’t work on the lock (the reservation hasn’t started yet).

Thanks for working on this.

It’s designed as a personal reference. For instance. AirBnB has the following reservation summaries that I’ve seen:

  • Reserved
  • Unavailable
  • Blocked

If you’ve got more than one calendar attached to your system then it’s hard to differentiate which calendar a given event comes from. As such, the prefix, if it is defined, is pre-pended to all events from the given calendar.

For example. Let’s say I have two calendars in the system from different properties and they’re both on AirBnB. If they both have reservations at the same time, then just from looking at the HA calendar you can’t tell which property is reserved! So, if you add a distinguishing prefix to each calendar, let’s say for this we use P1 and P2 for our prefixes, then all the events attached to the P1 calendar would look like P1 Reserved and all the ones from P2 would end up looking like P2 Reserved

It’s the starting slot that RC will start controlling from. So, if you go with the default setup (slot 10) then you have 9 codes that are not managed by RC at all. The sensor count will be (though not yet) the number of additional slots you will need. So, if you want to setup Keymaster with just the minimal amount of slots needed with the defaults then you would need to have Keymaster set with 14 slots. Slots 1-9 would be managed by you, and slots 10 - 14 (that is 5 since RC is 0 based counting) would be managed by RC.

Once RC learns how to actually manage the codes (it still doesn’t know how) then the codes will be assigned to one of the managed slots as the events are picked up. The intention for RC is that it will do the following when configuring a particular lock slot:

  1. Put a unique identifier into the Keymaster slot name input
  2. Put the RC determined door code into the code slot, if you have Keymaster configured to show the codes, then it would be visible there.
  3. Configure the start and stop date and time in the advanced settings
  4. Configure the advanced settings to be used
  5. Set the slot to be enabled, Keymaster will do all the rest of the scheduling related to putting the code into the door slot and taking it out all at the proper time :slight_smile:

See above. TL;DR the code will be put into Keymaster, but Keymaster won’t send the lock to the door until the start date and time and it will remove it at the end date and time.

If you’ve got KM setup with 10 slots and want 5 managing by RC, then you really want to start your RC management at 6. RC is 0 based in indexing, so 10 - 4 (which is 5) = 6. Yes, I know it can be confusing and maybe I should fix that… Probably should change the default to slot 11 and switch to 1 based numbering instead.

It’s the rough estimate of when the start of the event will be. After the event has started it it will become negative.

As expected. The state of the calendar.rental_control_calendarname will transition to on when the event starts.

This is currently expected since RC still doesn’t know how to push codes to Keymaster yet and therefore there is no lock code management current!

Great stuff. Thanks for the detailed reply.

One last question based on the answers. If there are 5 slots assigned to RC, what is going to happen if there are more than 5 upcoming reservations in a calendar?

The calendar is still going to pick up all of the events. The way the sensors are setup they are your first N events of the calendar. The very first sensor (currently sensor 0) will be your earliest event. In general this will mean that it is your current / next event. It will be “discarded” on event end day + 1 @ 00:00, that is the midnight of the checkout day. All of the event sensors will slide down one spot and the last sensor (currently sensor 4) will pick up the next event from the calendar that doesn’t have a sensor assigned to it yet.

My intention with how this will all work with KM is that as an event gets scheduled into the lock, it will hold the lock slot it gets assigned until the event attached to it is gone. That slot will be freed up and the next new event will get scheduled into it.

If it should happen that you have all the sensors already filled (and thus the lock slots all assigned) and a new event comes in that is newer than a current sensor/lock slot, that slot will get cleared and then reassigned to the new sensor.

Version v0.5.6 is now out. It adds in door code generation in 3 different ways along with making it easy to identify the guest.

This version still does not control the lock nor does it yet give a way to update the check-in/out times of a single event.

1 Like

Version v0.7.5-beta is now out. Please note that this definitely a beta release. I’ve already found at least one bug related to the upgrade requiring a couple of restarts and re-configurations of components.

That being said, I would like for willing folks to pick it up and give me feedback.

This version brings in the long-awaited feature to actually control lock slots. Please see the release notes and integration info on all the features.

And a follow on to yesterday’s announcment:

v0.7.5 is now out. I’ve corrected the upgrade problem.

Along with the lock management feature, Booking.com is now supported as an imported calendar and VRBO calendars have been fixed. I found that they had stopped working correctly with changes that went in for v0.7.1

I’ve been pondering the ETA field available on the sensors. Currently it’s an ETA in days and I realized yesterday the logic is such that the day of check-in ETA == 1, when it really should be 0.

I’m thinking of breaking that up into three distinct fields:
Eta days == Number of whole days until the event starts
Eta Hours == Number of whole hours until the event starts
Eta minutes == Number of whole minutes until the event starts

These would all go to None instead of negative as it currently does.

Any thoughts or comments? Is this even a useful feature? Should I just pull it out since it’s something that folks can generate from a template on their own?

Would you prefer an extra sensor that is just an ETA sensor to the next event start?

Thank you for this wonderful integration. I"m new to this Vacation rental game and got my first reservation today and the integration scheduled the code slot just fine. This is so awesome. Thank you so much

1 Like

I just started using this (finally!) after you solved my problem here:

Airbnb automation (dynamic calendars based on guests)

Just came here to say a huge thankyou for this - it’s really great :slight_smile: I currently don’t use the key codes portion of it (just as a ‘calendar’ plus using future events) but I imagine I will in the future. The fact that it sidesteps my previous middle man of google calendar is even more awesome!

Glad you like it :slight_smile: your thread was a great jumping off point for me to get folks using it :wink:

Not sure if this is related to the latest release or not but all of my entities are now showing up as unavailable.
I’ve had it regenerate the files a few times but no love. The only thing I haven’t attempted to do was to remove the integration and then redo it, but it the same thing shows up for VRBO and Booking as well.

EDIT: Nevermind for some reason my pfsense decided it was a good time to start blocking things from HA. Ugh

Happy you resolved it. I was getting worried I was going a bit crazy as I haven’t seen that except for when I break it during development :wink:

1 Like

Ok qq is there anything special I need to do if I’m using multiple rental sites for the same listing?
My airbnb config works great and all of the entities are enabled perfectly.

For VRBO and Booking they both look like this
and for VRBO since I finally got my first booking here I can see that the calendar entity does see the upcoming reservation

but no matter what I do the other entities will not become available. I’ve dug through the logs to try and find anything that explains why, but there is nothing in the logs specific to vrbo except 1 item where it couldn’t reach www.vrbo.com but I also see that occasionally for airbnb and booking as well. But since my aribnb booking works flawless.
For VRBO the ical link defaults to http not https so I tried to use that but the configurator says the URL must be https and it looks like doing a curl on the https works just fine so no big deal there. Maybe I just overlooked something in the docs about how to do multiple sites with 1 listing. Ugh, thanks for your help if you chime in before I get this resolved :slight_smile:

So a couple of questions:

  1. Are you driving keymaster slots with this these?
  2. what version are you using?

The latest version of the integration will set the sensors and mapping sensor to unavailable if you are driving keymaster slots and the startup events do not properly fire. Those should properly map into your environment as long as you have your packages directory properly configured (defaults to the same base location that keymaster uses).

Oh, and I should add. Yes, this works perfectly well with multiple instances of the integration installed.

I have 3 separate properties that I monitor from my home HA without driving keymaster slots.

My residence has 3 rooms on Airbnb, each of those rooms has it’s own smart lock. So, for the front lock, I’ve got 3 instances installed that drive a subset of lock slots and then 3 more of the same calendars that drive lock slots on the specific doors.

So, my HA instance is currently running 9 copies of the integration :wink:

Hey there @tykeal yes I am driving keymaster slots because well KM rocks the casba. Looks like I"m on version 0.7.5 according to HACS
My config shows
packages: !include_dir_named packages/
Keymaster is working just fine and so is the airbnb rental control. Its just the others that have some issues. Is there a way to manually fire those startup events?