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

Yes, it’s by design. AirBnB doesn’t provide the guest name in the calendar details while VRBO does. The most unique “name” is pulled from the calendar for sensors.

Please note that using a different timezone in RC from the actual system TZ with the lock management portion is not a supported configuration. It’s fine if you’re using it on a “management” instance for information / driving of automations that don’t need to happen at the property, but I do not test, nor do I know exactly what will happen, if you try setting the TZ different on an instance that is trying to control a lock itself as Keymaster doesn’t directly support timezones.

FYI VRBO does support https itself on the calendars. For some reason everyone that has provided me a link to their VRBO it’s been an http link. Just add change it to https and things will work correctly.

You do not need to disable the SSL check at all.

Disabling the “ignore events that are not standard” means that you’ll get events that are blocking events but not actual reservations in your event sensors. That option is because I had several people say they wanted those events to show up.

I have only used this with Guesty before and it provided the AirBnB names so I was not aware of this. AirBnb must provide that info over the API but not the calendar export. I will be switching this one to Guesty art some point so that should take care of the problem.

Thanks Again

Craig

Hey all! I’m not sure what could be going wrong with this setup. I successfully set up two other Home Assistant installations using Keymaster and Rental Control with no issue. However, this third one I’m trying to set up, I’m getting nothing but issues. I feel like I must be doing something stupid, so any help anyone could provide would be greatly appreciated.

points of note:

  • the calendar is parsed correctly and shows the correct dates/codes
  • I don’t see anything in the debug logs compared to the working installs that pops out as an issue
  • Keymaster is working completely normally. Any manually added codes work just fine, both for adding and removing
  • The event sensors in Rental Control perpetually show as “Unavailable”
  • If I unselect the actual lock in RC, then the sensors show up normally, but if I then switch it back to the lock, they still don’t get programmed in Keymaster
  • I saw a similar issue in Sept 2022, where they said it ended up being something blocked in pfsense. I use pfsense as well, but set up the first one behind the same pfsense firewall, and had zero issues. I currently have my personal HA with keymaster & RC set up behind pfsense as well, with all pfsense installations pretty similar.
  • Regarding pfsense, I specifically whitelisted ALL traffic to and from the IP of this particular HA installation, and still no luck.
  • As a “last resort” so far, I completely wiped out the HA installation and set it up from scratch with literally nothing other than what’s required for RC/keymaster to function, and still no luck.

Screenshots from this setup, into one larger file:


Here it is full-size too: all hosted at ImgBB — ImgBB

Thanks in advance if you can point out what I’ve done wrong :slight_smile:

If you don’t have your logger configured, then I would suggest you make the following changes to your configuration.yaml file first:

logger: !include logger.yaml

Then add a logger.yaml file that looks like this:

default: warning

Just do that, this will then allow you to turn on and off logging of components via the UI using the developer tools. So, to turn up the logging to debug level for Rental Control you would do the following:

  • Navigate to Developer Tools
  • Select Services
  • Select Logger: Set level
  • In the data section add:
custom_components.rental_control: debug

Your logs should now be filling with a lot of debug spew from the component. When you’re done with that logging change debug to info in your data section and will revert to its more normal logging.

I had already done debug logging via an earlier post of yours:

Here’s a pastebin of the log: 2023-06-30 07:09:07.096 WARNING (SyncWorker_0) [homeassistant.loader] We found a - Pastebin.com

And a bit more of the same: 2023-06-30 07:09:07.096 WARNING (SyncWorker_0) [homeassistant.loader] We found a - Pastebin.com

First: Why do you have the calendar refresh set to 0? That seems overly aggressive, yes, I’m aware that I wrote the system to support that, but my experience has been that you shouldn’t need less than a refresh of every 2 minutes.

In my reading through the debug that’s the thing that stands out the most to me. I see that the sensors aren’t picking up because the calendar system is saying it’s not ready and I think it’s because the refresh of the calendar is happening so frequently. This is just my guess based on the logs though.

I had only done that while experimenting with it while not working. It did the exact same thing (though not as often) when set to the default 2 minutes. Happy to change it and get the logs again, but it was exactly the same minus the frequency. It was still showing that the calendar wasn’t ready.

Edit: here’s the logs again. I went ahead and set it to 5min and it’s still showing “calendar not ready, skipping mapping update”. Still, though, it does pull the calendar, and I can see it in HA’s Calendar tab.

Edit again; My account is new, so I’m not able to respond to the comment below, unfortunately, so here’s my response :slight_smile:

Yes, it’s new (it was happening the same way previously, which is why I wiped it out again as a test).

The config/packages directory exists, as do the Keymaster and Rental Control subfolders.
Screenshots: HA hosted at ImgBB — ImgBB

Thanks!

You said this is a new HA setup? Does the config/packages directory exist? It’s needed for both Keymaster as well as Rental Control. When the integration is configured to manage a lock then the calendar will not become ready if the automations from the integration are not properly installed and loaded. They will automatically get installed into the config/packages directory as long as you leave the default for the configuration files alone.

In particular there is a startup integration that needs to fire. It will automatically fire when HA is restarted and it also fires when a rental_control_refresh event is fired which happens automatically when you reconfigure / install the integration. That particular automation sends data about what keymaster has configured back into rental control which informs the mapper where it’s allowed to direct codes.

1 Like

@tykeal you’re going to quickly realize that I am not very good at this,

I want to create an Automation Condition that checks to see if a guest is checking out today. I’ll use that condition to do other stuff. Can you help me with writing that condition? I’m not good at many things, including dealing with attributes.

Edit---------------------------------------------------------------------------

I was able to do this:

  • platform: template
    sensors:
    next_airbnb_guest_leave_date:
    friendly_name: “Next Airbnb Guest Leave Date”
    entity_id: sensor.rental_control_airbnb_event_0
    value_template: “{{ state_attr(‘sensor.rental_control_airbnb_event_0’, ‘end’) }}”

    next_vrbo_guest_leave_date:
    friendly_name: “Next VRBO Guest Leave Date”
    entity_id: sensor.rental_control_carriage_house_event_0
    value_template: “{{ state_attr(‘sensor.rental_control_carriage_house_event_0’, ‘end’) }}”

Now I’m trying to create a condition that checks if either one of these dates is today

Eric

The start and end attributes are datetime objects. If you want to reduce the date to just the the day of leaving then something like this:

value_template: "{{ as_timestamp(state_attr(‘sensor.rental_control_airbnb_event_0’, ‘end’)) | timestamp_custom("%Y-%m-%d") | as_timestamp() }}"

This will end up providing you a unix date object (not datetime) which is effectively the day @ 00:00 (midnight)

If you’re trying to write an automation that uses that to do stuff for “today” then have it trigger on your sensor changing and then do the evaluation of if it needs to do anything in a choose object or in the condition. The reason being you can’t have now() be used in a trigger but you can use it in the conditions or actions section.

To do a comparison in your conditions you could do something like (totally untested):

{% if ( as_timestamp(now()) | timestamp_custom("%Y-%m-%d") ) == states("sensor.next_airbnb_guest_leave_date") %}true{% else %}false{% endif %}

Thank you so very much

Hey @tykeal, sorry that I couldn’t post a response earlier. I was still “new” as far as this was concerned, so I had to edit my reply above to update.

For as another update, I’ve moved this HA setup into service, along with one lock I’m trying out (just in case my internet connection / firewall was somehow blocking something or causing a problem).

It still wasn’t working in the new location, so I deleted the Keymaster & Rental Control setups and started again.

Keymaster is still working completely normally, and Rental Control is still doing the same thing as before. If you check out the screenshot in my edited last message, you can see that the proper directories exist.

As far as the rental_control_refresh, I see the “Rental Control - Update (name of setup) - startup” that fires upon startup, and I see the event type: “rental_control_refresh”, so that seems to be working/correct, except that it’s not actually working.

I’m happy to give you access to the installation if you’d like to check it out.

@gabestover DM me details. I don’t know if I’ll be able to solve it for you either, but I can take a look. I’m not really seeing anything in the logs that give me an idea as to what’s going on though.

Thanks - just sent you details!

@gabestover ok, so I figured out the problem. The primary issue was that you had named your Rental Control a pure numeric. The automations that feed the data from Keymaster back into RC were having a problem with this. Version 0.9.1 has been released with a fix for this. You will need to do the following:

  • update your integration
  • restart HA
  • do one of the following:
    1. Make a minor modification to your configuration and hit save so that the files are regenerated
    2. Remove your current configuration and re-add it so that the files are regenerated

Thanks so much for figuring out this was due to only having numbers in the name!

Unfortunately, the 0.9.1 update still didn’t work for me, using the same “numbers-only” name as before.

I ended up changing the lock name itself, and the names in Keymaster and Rental Control to start with a word, and everything is now working perfectly.

@gabestover

If you re-read my message above, you’ll see that I said you needed to either make a change to your configuration to get it to rebuild the files or remove and re-add it to force it to rebuild the files.

Either one of those would do it, just upgrading to 0.9.1 would not have. That being said, changing from a numeric only name also will fix it that’s essentially the first option, but also gets around the bug.

Sorry, I didn’t make it clear - I did all of what you had said, and it still didn’t work for me with those instructions. After updating, I rebooted. Then, I first tried making a change to get it to rebuild, and that didn’t work. Then, I removed and re-set up the config, and that still didn’t work.

After that, I renamed the lock, and re set up Keymaster & Rental Control, all just with single word names for everything like “test”, and that worked pefectly.

From there, I renamed the lock itself to something including numbers - but not only numbers - and did the same with Keymaster and Rental Control, and that worked perfectly as well.

Maybe there’s a similar bug with Keymaster and only-numbers that needs fixed as well - I definitely have no idea about that.

But, at this point, everything is working perfectly for me, so I’m happy! :slight_smile:

Thanks again for all of your help and assistance!!