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

Interestingly the reservation number shows up as the name for the AirBnB clients, the name shows up for the VRBO customers.
Is this by design?

Thanks

Craig

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.