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

Please note that when you configure Rental Control to manage a lock there are 3 parameters that matter the most:

  1. If it is configured to use a lock then the the next two parameters are used and must be inside the range of “slots” defined in your Keymaster configuration for the lock
  2. Starting lock slot for management (this is the first Keymaster slot that will be managed)
  3. Number of event sensors to create (starting slot + this number -1 == the last Keymaster slot that will be managed)

The error you were getting is indicative of you trying to have RC try to manage slots that are not defined in Keymaster.

My general recommendation is that Keymaster be configured with no less than 10 slots as a minimum. The first 5 can be used for static code assignments (yourself and others that may need regular property access) then you would configure RC to start at 6 with 5 sensors which would mean it would manage Keymaster slots 6 - 10.

1 Like

Thx for the explanation! Very kind of you!

Done! Working! Thank you so much, I really appreciate you time and assistance!

Now with Rental control and Keymaster together, I can see how to change the time for early check-in and late check-out, the functionality now looks like RLA.

Thanks.

I just started using the rental control google calendar to test the following setting in automatisations:

  1. Google Entry Start AND motion detection lead to power up thermostatic radiator vales

id: ‘1700173259179’
alias: Test Google Heizung An
description: ‘’
trigger:

  • platform: calendar
    event: start
    offset: ‘0:0:0’
    entity_id: calendar.rental_control_google_test
    id: Google Cal
  • type: motion
    platform: device
    device_id: 96206bd60c3e8abc60976d9036c85799
    entity_id: b1401f6c595465b623d6dbcaae551e47
    domain: binary_sensor
    id: Motion
    condition:
    action:
  • if:
    • condition: and
      conditions:
      • condition: trigger
        id:
        • Google Cal
      • condition: trigger
        id:
        • Motion
          then:
    • device_id: 3d8bc473f54884201705ba3b2cffca4f
      domain: climate
      entity_id: bd9b8c7b07f441bad0080f3ab54fccca
      type: set_hvac_mode
      hvac_mode: auto
    • device_id: d2216a9ad727562d9659f2487d7f8b73
      domain: climate
      entity_id: f72fe86a77bfd10e4598e0a50849a977
      type: set_hvac_mode
      hvac_mode: auto
    • device_id: b6e34510a723dc7e7a6c9fb5bef63e70
      domain: climate
      entity_id: 95c109dd86a2b28b75a7786abc485ff9
      type: set_hvac_mode
      hvac_mode: auto
    • device_id: 67fdd53842d9353d7bc93ab3648b146f
      domain: climate
      entity_id: f5a647e5b5b2d723666a9830a2d1560c
      type: set_hvac_mode
      hvac_mode: auto
    • device_id: 9ba82b5747c8e06fb062dae20a473591
      domain: climate
      entity_id: 9555348e1cf25a7796926d51eeea7ed6
      type: set_hvac_mode
      hvac_mode: heat
      mode: single
  1. Google Entry End leads to thermostatic radiator vales being shut down
    thermostatic radiator vales

alias: Google Test aus
description: “”
trigger:

  • platform: calendar
    event: end
    offset: “-0:0:0”
    entity_id: calendar.rental_control_google_test
    id: Google Cal
    condition:
    action:
  • if:
    • condition: trigger
      id:
      • Google Cal
        then:
    • type: turn_on
      device_id: 3d8bc473f54884201705ba3b2cffca4f
      entity_id: 91586f4c72aad2d91470bf4df5fab621
      domain: switch
    • type: turn_on
      device_id: d2216a9ad727562d9659f2487d7f8b73
      entity_id: 3edf8549bbe6f402b73f5a936b6a30d1
      domain: switch
    • type: turn_on
      device_id: b6e34510a723dc7e7a6c9fb5bef63e70
      entity_id: 76b88381c4d76a492a0f4fe827e342ee
      domain: switch
    • type: turn_on
      device_id: 67fdd53842d9353d7bc93ab3648b146f
      entity_id: 983067e5b42e7bd35665db667b764d50
      domain: switch
    • device_id: 9ba82b5747c8e06fb062dae20a473591
      domain: climate
      entity_id: 9555348e1cf25a7796926d51eeea7ed6
      type: set_hvac_mode
      hvac_mode: “off”
      mode: single

The first one is executed, even when the calender entry is not valid any more, the second one does not do anything. The google entry covers a few minutes, in order to be able to checkt the set up.

Could you give me any hints why this happens?

Many many thanks in advance!

Hi, I think I found the answer:
The google calendar integration is a bit special, but still great!:=)

  1. The entry should have “reservation” in the text
  2. The entry must cover at least a night, so from 3pm-5pm doesn*t do the trick
  3. The end google time is irrelevant. If you want to test if your automatisation works, you need to adjust the end timing in the rental control app where you integrated the calendar. So if you set the rental timing to be from 1500-0835, and you are looking for a check out action, then the action will take place at 0835, even though google might have had an entry only until 0810

I hope I could contribute a little bit.
Cheers

Here’s the section of the documentation that talks about the custom calendar which details everything you just mentioned :wink: I will also note that your event sensors have a wealth of attributes that you can inspect to see details related to a guest. In particular the, checkin and checkout times are in the attributes.

  • Custom calendars are supported as long as they provide a valid ICS file via an HTTPS connection.
    • Events on the calendar can be done in multiple ways, but all events will be treated as all day events (which is how all of the rental platforms provide events).
    • The event Summary (aka event title) may contiain the word Reserved. This will cause the slot name to be generated in one of two ways:
      • The word Reserved is followed by ’ - ’ and then something else, the something else will be used
      • The word Reserved is not followed by ’ - ’ then the full slot will be used
      • The Summary contains nothing else and the Details contain something that matches an Airbnb reservation identifier of [A-Z][A-Z0-9]{9} that is a capital alphabet letter followed by 9 more characters that are either capital alphabet letters or numbers, then the slot will get this
      • If the the Summary is just Reserved and there is no Airbnb code in the Description, then the event will be ignored for purposes of managing a lock code.
      • Technically any of the othe supported platform event styles for the Summary can be used and as long as the Summary conforms to it.
      • The best Summary on a manual calendar is to use your guest name. The entries do need to be unique over the sensor count worth of events or Rental Control will run into issues.
    • Additional information can be provided in the Description of the event and it will fill in the extra details in the sensor.
      • Phone numbers for use in generating door codes can be provided in one of two ways
        • A line in the Description matching this regular expression: \(?Last 4 Digits\)?:\s+(\d{4}) – This line will always take precedence for generating a door code based on last 4 digits.
        • A line in the Description matching this regular expression: Phone(?: Number)?:\s+(\+?[\d\. \-\(\)]{9,}) which will then have the “air” squeezed out of it to extract the last 4 digits in the number
      • Number of guests
        • A line in the Description that matches: Guests:\s+(\d+)$
        • Alternatively, the following lines will be added together to get the data:
          • Adults:\s+(\d+)$
          • Children:\s+(\d+)$
      • Email addresses can be extracted from the Description by matching against: Email:\s+(\S+@\S+)
      • Reservation URLS will match against the first (and hopefully only) URL in the Description

A couple of things that I would recommend:

  1. Do not use device_id for targeting anything if at all possible. They can (and have just recently with one of the recent major releases) all shift. entity_id is more stable.
  2. As you found in your next post, Rental Control doesn’t follow the actual calendar event. It expects the event to be an overnight event and the defined check-in, check-out times are used. If someone were to raise a feature request for following the actual calendar event and either proposes the fix or enough people express interest then then it could be made to follow the calendar event with a toggle.
1 Like

@tykeal When Rental Control creates the code slot entry on Key Master, is there anyway “Notifications” can be on by default?

This is not presently a feature of Rental Control. That was an explicit decision on my part when I was developing it as I personally believe that while it’s nice to get notified on the first entry by a guest, I think it’s an invasion of privacy to be getting notified on every entry of guests.

If you want notifications I would recommend doing something like what I’ve done with this blueprint which uses an input_boolean helper to track state and will send a notification to a Zulip stream on initial guest entry and then not again after that.

Yes, I was looking for the initial notification. I will try this.

Please note that that blueprint is designed to be used in conjunction with a Zulip service. That’s what I use for coordinating with my property cleaning crew and the property manager of a few of my units.

If you’re using some other notification setup, you’ll need to modify the blueprint to work for you

Hi Andrew, thank you for Rental Control, it is very usefull for me and my small Rental Business. But one Question: I don’t use the Keymaster System, i use many Nuki Door Looks. Do you think it is possible to generate also a key for Nuki (it must be 6 digits, but zero is not allowed) and i can automate to push the key to the right nuki door look? If that worked it would be a dream and extremely helpful for me

Yes, you can do that with the system. There is an option called Door code length that defaults to 4 but can be set to anything as long as it is a multiple of 2 digits with a minimum of 4. Please note that you must use either the Start/end date or Static random code generators for those codes. The sensor always generates a code, even when it is not managing a Keymaster lock, and it will be available as an attribute that you can use.

If you want to automate the push, you can trigger on state or attribute change of the sensor. Please note that Sensor 0 is always the current / most recent guest and Sensor 1 is the next guest. If you have a guest change over on the same day, then Sensor 1 becomes Sensor 0 at midnight of the first night for the guest.

You might still want to consider setting up Keymaster on a dummy lock (you can do this using the Virtual Components integration via HACS). This way you can use changes to the Keymaster slots to drive your automation to your real lock along with being able to do check-in / check-out as well as code overrides.

Got it, thanks.

Can you describe the process?
I would like to integrate with auth provider command_line… so the guest get a password to login only during the booked period.

To login to what? HA? I would strongly recommend against that… HA isn’t locked down in a way that is safe to provide guests direct access.

Now that being said, if you want to do automations based on when a guest should be checked in, then the easiest way would be to trigger based on if your calendar.rental_control_<RC_name> is on or not. If it is then you can use logic to determine if sensor.rental_control_<RC_name>_event_0 or sensor.rental_control_<RC_name>_event_1 is the correct event to pull any extra data from.

The sensors and the created calendar object are all you need for doing your automations.

For instance this blueprint is one that I use to send a notification via Zulip that a guest has entered the property for the first time. After that first entry we don’t keep getting notices when a guest uses their door code.

You could easily adapt that to do other sorts of things on the first time a guest enters.

Dear Andrew,

While Rental control is working like a champ, I was wondering if you have any idea / possibility to make it also work like a channel manager? I am looking for a solution to sync Airbnb and Booking without exchanging their icals…

Thanks for your excellent support!

I’m not certain what you’re asking for here.

If you’re wanting RC to manage multiple calendars all at one go, you can technically do this now by configuring the integration multiple times from different platforms and managing different locks.

You would, however, still need to have the various platforms properly exchanging their calendars.

Please note that Airbnb (and I would assume the other platforms, I’m not on them) do not lightly share their API with just anyone. I’m only aware of Guesty as a vendor that gets direct API access to Airbnb so that they can do some calendar management as well as get more data on bookings than the standard calendar. I as a developer am likely to never get that API access, much less find a way to make it available to the people using this on their own HA instance.

Hi, thank you so much for this tool, I’m really excited to integrate into this after Rboyapps’ RLA went down.

I’m trying to integrate with Host Tools, and using their export calendar, but do you know why this ICS is coming up with an error: URL did not provide valid calendar? It’s happening to all of Host Tools’ export calendars.

https://app.hosttools.com/ical/41587ad2b82a952f179520cda84ddbd0f66d5f3e

Here is the ICS file as plain text:

BEGIN:VCALENDAR
VERSION:2.0
PRODID:-//Host Tools//Calendar Export//EN
SOURCE;VALUE=URI:hosttools.com
CALSCALE:GREGORIAN
NAME:5.1 - The Sixties iCal
X-WR-CALNAME:5.1 - The Sixties iCal
BEGIN:VEVENT
UID:f2b4f7a9-231b-4283-9784-751e1c4c70c1
SEQUENCE:0
DTSTAMP:20240305T232849Z
DTSTART;VALUE=DATE:20240323
DTEND;VALUE=DATE:20240326
X-MICROSOFT-CDO-ALLDAYEVENT:TRUE
X-MICROSOFT-MSNCALENDAR-ALLDAYEVENT:TRUE
SUMMARY:Test Calendar
DESCRIPTION:Name: Test Calendar Phone: +44733392833 Email: randomemail1843
 [email protected] Channel: internal Listing: 5.1 - The Sixties
END:VEVENT
BEGIN:VEVENT
UID:6ad508f4-1627-4420-babc-547bddfb3c79
SEQUENCE:0
DTSTAMP:20240305T232849Z
DTSTART;VALUE=DATE:20240604
DTEND;VALUE=DATE:20241028
X-MICROSOFT-CDO-ALLDAYEVENT:TRUE
X-MICROSOFT-MSNCALENDAR-ALLDAYEVENT:TRUE
SUMMARY:Blocked
DESCRIPTION:
END:VEVENT
BEGIN:VEVENT
UID:4c1f62d3-9207-42cd-817c-caefacbdd9ee
SEQUENCE:0
DTSTAMP:20240305T232849Z
DTSTART;VALUE=DATE:20241028
DTEND;VALUE=DATE:20250331
X-MICROSOFT-CDO-ALLDAYEVENT:TRUE
X-MICROSOFT-MSNCALENDAR-ALLDAYEVENT:TRUE
SUMMARY:Blocked
DESCRIPTION:
END:VEVENT
BEGIN:VEVENT
UID:0f67251b-fd68-4d7c-8a79-c60c1e5cea53
SEQUENCE:0
DTSTAMP:20240305T232849Z
DTSTART;VALUE=DATE:20250331
DTEND;VALUE=DATE:20251027
X-MICROSOFT-CDO-ALLDAYEVENT:TRUE
X-MICROSOFT-MSNCALENDAR-ALLDAYEVENT:TRUE
SUMMARY:Blocked
DESCRIPTION:
END:VEVENT
BEGIN:VEVENT
UID:ba61e693-7e69-4cac-a0e0-f3fece44587b
SEQUENCE:0
DTSTAMP:20240305T232849Z
DTSTART;VALUE=DATE:20251027
DTEND;VALUE=DATE:20260305
X-MICROSOFT-CDO-ALLDAYEVENT:TRUE
X-MICROSOFT-MSNCALENDAR-ALLDAYEVENT:TRUE
SUMMARY:Blocked
DESCRIPTION:
END:VEVENT
END:VCALENDAR

They are exporting the calendar with the wrong Content-Type: header. The header that they’re sending is Content-Type: text/plain; charset=UTF-8 and RC requires that the the incoming URL provides the correct content type of text/calendar. This isn’t a bug in RC is a fail-safe to protect against bad data.

You should raise a bug with the platform about them sending the wrong content header.

For instance, Airbnb sends Content-Type: text/calendar;charset=utf-8 and Guesty sends Content-Type: text/calendar