This is an automated archive made by the Lemmit Bot.
The original was posted on /r/homeassistant by /u/klinquist on 2026-02-25 15:21:47+00:00.
Most of these automations have come over from Hubitat + some special glue code I wrote, but I have since migrated to HomeAssistant, and the way I've implemented things is a bit different than others, so here's how I did it.
I've got 60+ devices in the house - zigbee, zwave, lutron. I use the HomeAssistant zigbee & zwave USB dongles. I run it on a pi 5 w/ ssd. I have zwave locks.
I could use keymaster and Rental Control add-ons, but I hear that keymaster creates hundreds of entities and is overly complex, and Rental Control depends on it. So I am using the much simpler Lock Code Manager.
First, I have "House Modes" defined: Away, Arriving Soon, and Home.
I have an automation that will run scripts based on the mode change.
Arriving Soon script:
- Turn on water heater (it takes 10 hrs to warm up - hybrid heat pump water heater)
Home script:
- Turn on lights
- Turn on water heater (in case we never transitioned through Arriving Soon mode)
- Set HVAC
Away script:
- Put water heater back into vacation mode, reset HVAC temperatures, turn off lights.
Second, I have the HA Remote Calendar integration pointed to my airbnb ical. This brings my reservations into the HA calendar.
Third, I have an automation that runs at 12:01AM, 10:30AM, and 12:30PM every day.
If the script executed at 12:01AM and it's check_in_day, change mode to Arriving Soon
If the script executed at 10:30AM and it's check_in_day, change mode to Home and add lock code to slot 7 on 2 locks
If the script executed at 12:00PM and it's check_out_day, change mode to Away and remove lock code from slot 7 on 2 locks
I get the last 4 digits of the guest phone number from the calendar event.
alias: Guest/Airbnb - Calendar Orchestrator
description: Syncs Airbnb PIN to Slot 7 and manages House Mode
triggers:
- trigger: time
at: "00:01:00"
id: prep
- trigger: time
at: "10:30:00"
id: checkin
- trigger: time
at: "12:30:00"
id: checkout
actions:
- variables:
description: "{{ state_attr('calendar.airbnb', 'description') | default('') }}"
guest_pin: >
{{ description | regex_findall_index('Phone Number \(Last 4 Digits\):
(\d{4})', index=0, ignorecase=True) | default('0000') }}
is_checkin_today: >
{% set start = state_attr('calendar.airbnb', 'start_time') %} {{ start
is not none and (start | as_datetime | as_local).date() == now().date()
}}
is_checkout_today: >
{% set end = state_attr('calendar.airbnb', 'end_time') %} {{ end is not
none and (end | as_datetime | as_local).date() == now().date() }}
- choose:
- conditions:
- condition: trigger
id: prep
- condition: template
value_template: "{{ is_checkin_today }}"
sequence:
- action: input_select.select_option
target:
entity_id: input_select.house_mode
data:
option: Arriving Soon
- conditions:
- condition: trigger
id: checkin
- condition: template
value_template: "{{ is_checkin_today and guest_pin != '0000' }}"
sequence:
- action: input_select.select_option
target:
entity_id: input_select.house_mode
data:
option: Home
- action: lock_code_manager.set_user_code
data:
code_slot: 7
user_code: "{{ guest_pin }}"
target:
entity_id:
- lock.front_door
- lock.garage_back_door
- action: switch.turn_on
target:
entity_id: switch.motoretreat_locks_code_slot_7_enabled
- conditions:
- condition: trigger
id: checkout
- condition: template
value_template: "{{ is_checkout_today }}"
sequence:
- action: input_select.select_option
target:
entity_id: input_select.house_mode
data:
option: Away
- action: lock_code_manager.clear_user_code
data:
code_slot: 7
target:
entity_id:
- lock.front_door
- lock.garage_back_door
Of course, that's just my calendar control. I've got a bunch of other automations to..
- Turn off the (zigbee) water valve if any of my water sensors get wet (zigbee water sensors),
- Notify me if a smoke detector goes off (FirstAlert Zwave Smoke Detectors),
- Allow the guest to turn on the whole house fan only if a window is open (and turn the fan back off if the outside temp rises above the inside temp),
- Notify me if a vehicle enters my driveway (Dakota Alert vehicle sensor hooked to a zwave door sensor),
- Let the guest open up the garage by typing their code into a xfinity zigbee keypad outside the garage (compares action_code to the codes programmed into the front door lock).