Bookings
Access this System's Event data, via the Calendar Driver
Type: Logic Driver
Dependencies: PlaceOS Calendar Driver
Source: https://github.com/PlaceOS/drivers/blob/master/drivers/place/bookings.cr
Functions
Fetches a room's Events and exposes them along with the current state of the room's calendar.
Provides check-in, auto cancel and decline functions.
Provides status for Booking panel app, kiosk and workplace app (explore/map page) for live room availability data
Common Configurations
Basic Free / Busy
Settings for basic free busy status, where the room indicates a pending meeting 5minutes before a meeting starts.
Manual Check-in
The Booking panel app will end the meeting early if no one checks in manually.
The booking panel itself performs the meeting end, this prevents meetings from being ended if the panel is offline.
Sensor Based Check-in
Utilises a sensor to check-in the meeting (requires the 'Check-In Helper' module in the system)
Settings
calendar_id
String
nil
The email address of the room the module is in
calendar_time_zone
String
Australia/Sydney
Currently has no impact
book_now_default_title
String
Ad Hoc booking
Title of booking if unchanged
disable_book_now
Boolean
false
disable_end_meeting
Boolean
false
Exposes a disable_end_meeting status variable such that frontends like PlaceOS template Bookings can detect it and enable/disable it's auto event cancellation functionality (frontend will exec end_meeting causing the current event to be truncated to the current time, freeing up the room (in case of no shows).
pending_period
UInt32
5
Number of minutes AFTER the Booking start time until status changes from pending to free
pending_before
UInt32
5
Number of minutes BEFORE the Booking start time until the status changes from free to pending
cache_polling_period
UInt32
5
cache_days
UInt32
30
sensor_stale_minutes
Int32
8
Consider sensor data older than this unreliable
change_event_sync_delay
UInt32
5
As graph API is eventually consistent we want to delay syncing for a moment
control_ui
String
https://if.panel/to_be_used_for_control
catering_ui
String
https://if.panel/to_be_used_for_catering
include_cancelled_bookings
Boolean
false
hide_qr_code
Boolean
false
custom_qr_url
String
https://domain.com/path
custom_qr_color
String
black
The colour of the QR codes the module generates
room_image
String
https://domain.com/room_image.svg
This image is displayed along with the capacity when the room is not bookable
sensor_mac
String
device-mac
hide_meeting_details
Boolean
false
hide_meeting_title
Boolean
false
Status Variables
bookable
bookable
true if the room can be directly booked by end users without going through an admin
Schema/Type
Boolean
room_name
room_name
The name of the room
Schema/Type
String
room_capacity
room_capacity
Max number of people that can be booked into a meeting in the room
Schema/Type
Int
default_title
default_title
Title of meetings if none is set
Schema/Type
String
disable_book_now
disable_book_now
Schema/Type
Boolean
disable_end_meeting
disable_end_meeting
Exposes a disable_end_meeting status variable such that frontends like PlaceOS template Bookings can detect it and enable/disable it's auto event cancellation functionality (frontend will exec end_meeting causing the current event to be truncated to the current time, freeing up the room (in case of no shows).
Schema/Type
Boolean
pending_period
pending_period
Number of minutes AFTER the Booking start time until status changes from pending to free
Schema/Type
UInt32
pending_before
pending_before
Number of minutes BEFORE the Booking start time until the status changes from free to pending
Schema/Type
UInt32
control_ui
control_ui
Schema/Type
String
catering_ui
catering_ui
Schema/Type
String
show_qr_code
show_qr_code
Schema/Type
Boolean
connected
connected
Schema/Type
Boolean
booked
booked
true when there is a current (start time < current time < end time)
Schema/Type
Boolean
current_pending
current_pending
true from the event start time until pending_period mins after the event start time OR until checkin / start_meeting is executed.
Schema/Type#
Boolean
next_pending
next_pending
true from pending_before mins before an event start time until the event start time OR until checkin / start_meeting is executed.
Schema/Type
Boolean
pending
pending
true when either current_pending or next_pending is true
Schema/Type
Boolean
in_use
in_use
true when booked AND NOT pending (means that the current event has been checked in via checkin OR start_meeting functions)
Schema/Type
Boolean
status
status
Describes the current status of the room
Schema/Type
free, pending, busy
bookings
bookings
Contains an array of Events that occur in this System's mailbox (see system.email
property) between the start of the current day (in the timezone of the core service) and the cache_days
setting.
Schema/Type
See also: https://github.com/PlaceOS/calendar/blob/master/src/models/event.cr
Examples
1. No events
Commands
calendar_id
calendar_id
Displays the calendar ID - This means the ID of the room, which is the email address assigned to the room in BackOffice, as each room has its own calendar.
Parameters
None
Response Schema
Example Responses
1. If successful:
start_meeting
start_meeting
Starts a booked current or future meeting in the current room, to prevent automatic cancellation.
Parameters
meeting_start_time
true
Int64
Nil
The time of the meeting you wish to start, in Unix time
Response Schema
Example Responses
1. If successful:
checkin
checkin
Starts the current meeting in the current room to prevent automatic cancellation.
Parameters
None
Response Schema
Example Responses
1. If successful:
end_meeting
end_meeting
Ends the meeting in the current room which has the start time entered.
Parameters
meeting_start_time
true
Int64
N/A
The start time of the meeting the user wishes to cancel in seconds (Unix time)
notify
false
Boolean
false
If set to true, this will notify the other meeting participants
comment
false
String
nil
This will be added to the notification
Response Schema
Example Responses
1.
book_now
book_now
Books and starts a meeting in the current system which starts immediately and lasts an certain length of time in seconds as specified by the user.
Parameters
period_in_seconds
true
Int64
N/A
The length of the meeting the user is booking in seconds
title
false
String
nil
The name of the meeting
owner
false
String
nil
The email of the host of the meeting as registered in BackOffice. Does not work if this is filled in with a host that does not exist. Works if left empty.
Response Schema
Example Responses
1. If the owner does not exist:
2. If neither optional field is filled out:
3. If the room is already booked:
poll_events
poll_events
Query neighbouring calendar driver for Events that occur in this System's mailbox (see system.email
property) between the start of the current day (in the timezone of the core service) and the cache_days
setting. Updates the state with this information, rather than returning it as a response.
Parameters
None
Response Schema
Example Responses
1. If successful:
locate_user
locate_user
Used by location services and area management drivers to locate a given user within the building. Not useful as a command on its own, only used by the location drivers. Nothing to do with the specific system the module is in, the location services use this command to poll each room for a specific user. If they are not present in the current room, it returns an empty array. Neither the username or email is required but at least one should be used for the command to be useful. The username is often the same as the username but in some cases is not, which is why there are two fields.
Parameters
false
String
nil
The email of the user to search for
username
false
String
nil
If no username matches, it will search for emails that begin with the username
Response Schema
Example Responses
1. If user is not in the room OR the user AND email do not exist:
macs_assigned_to
macs_assigned_to
Uses locate_user
to find the MAC addresses assigned to users matching the email and username. Neither the username or email is required but at least one should be used for the command to be useful. Used by the location services and area management drivers and is not useful on its own.
Parameters
false
String
nil
Searches for the MAC address of the user with email entered
username
false
String
nil
Searches for the MAC address of the user with username entered. Will search for emails that begin with the username if none are found
Response Schema
Example Responses
1. If user is not in the room OR does not exist:
check_ownership_of
check_ownership_of
Searches for a user by their MAC address. It will show the user the MAC address is assigned to as well as the meeting they are in. Used by location services and area management drivers and is not useful on its own.
Parameters
mac_address
true
String
N/A
The MAC address to search for
Response Schema
Example Responses
1. If the MAC address belongs to a user:
2.
device_locations
device_locations
Searches for all devices in a specific zone by zone ID or location name. Used by location services and area management drivers, not useful on its own.
Parameters
zone_id
true
String
N/A
Zone ID of device search
location
false
String
nil
name of location
Response Schema
Example Responses
1.
is_stale?
is_stale?
Checks if the information it has from room sensor data is old or up-to-date. Returns true if the information is old. Used by location services and area management drivers, not useful on its own.
Parameters
timestamp
true
Boolean
N/A
The timestamp it receives from the location drivers to check if its info is old or not - Unix time
Response Schema
Example Responses
1.
2.
Last updated