This is a dashing job to find users' availability in their Exchange calendar and puts it on a dashboard.
Note: I am not a rubyist. I'd certainly welcome some idiomadicy lessons in the comments.
Drop ews-availability.rb
in jobs/
(or dashing install b084fa409966f22badaf
), and add the following settings to config.ru
:
set :ews_uri, 'https://exchange.example.com/ews/Exchange.asmx'
set :ews_user, 'ews-user@example.com'
set :ews_pass, 'super-cool-password'
set :ews_email_list, ['user1@example.com','user2@example.com','user3@example.com']
Note that your user needs access to talk to Exchange via EWS and read free/busy details from specified users.
Then add 'gem 'viewpoint'
to your Gemfile and bundle
again to install it.
When you run your dashboard, the job will run every 5 minutes and publish availability for each user in the list as ews-availability-[emailaddress]
e.g. ews-availability-user1@example.com
.
I like to use the Simplemon widget I found here as the dashboard widget for the data:
<li data-row="1" data-col="4" data-sizex="1" data-sizey="1">
<div data-id="ews-availability-user1@example.com" data-view="Simplemon" data-title="Example User"></div>
</li>
The job checks back and ahead 30 minutes to see if there are any meetings in progress or coming up.
Valid statuses are:
- Currently marked busy: "BUSY"
- Becoming free within 10 minutes: "HERE SOON"
- Becoming busy within 10 minutes: "BUSY SOON"
- No meetings within threshold: "HERE"
I can see events in
/events
which means I'm getting the data, but the panels aren't updating. I may not have a proper installation of simplemon though as I copied the raw widget folder into place rather than installing the rest. (Never mind, got it working, I had the wrong widgets set it is working now. I did need to generate an app-password as I use MFA however.Additional note, EWS support is ending October 2020.