Hubitat Google Calendar, Task and Gmail Search and Gmail Notification Device
For discussion and more information, visit the Hubitat Community [RELEASE] Google Calendar, Task, and Gmail Search and Gmail Notification Device.
-
Login to the Google Cloud Console: https://console.cloud.google.com
-
In the left navigation, click APIs & Services, Dashboard, and click Create Project on the right
-
Give your project a name and click Create
-
In the left navigation, click OAuth consent screen, Choose External and click Create
-
Set an App name, User support email, and Developer contact information and click Save and Continue
-
On Scopes, Scroll and click Save and Continue
-
On Test Users, Scroll and click Save and Continue
-
On Summary, Scroll and click Back to Dashboard
-
You should be taken back to the OAuth content screen page again, under Publishing status, Click Publish App and Confirm in the popup
-
You may see that your project is in "Needs verification" status, don't worry about that or the warning that it requires verification by Google. Since this project is for your individual use, that process isn't necessary.
-
In the left navigation, click Credentials
-
At the top, click + Create Credentials and choose OAuth client ID
-
Set Application type to Web application, set a Name, set Authorized redirect URIs to https://cloud.hubitat.com/oauth/stateredirect
-
Click Create
-
In the OAuth client created popup, copy the Client ID and Client Secret into your favorite text editor to use in the GCal Search HE app and click OK
-
Next you will enable access to the Google apps you wish Hubitat to search: Google Calendar API, Tasks API, and Gmail API. Feel free to skip a step if you don't intend for Hubitat to search one of these apps.
-
In the top blue search, enter 'calendar api' and choose Google Calendar API under Marketplace, or click here to navigate directly to this API
-
Click Enable
-
In the top blue search, enter 'tasks api' and choose Tasks API under Marketplace, or click here to navigate directly to this API
-
Click Enable
-
In the top blue search, enter 'gmail api' and choose Gmail API under Marketplace, or click here to navigate directly to this API
-
Click Enable
-
If you wish to have Gmail Notification Devices please be sure to enable the Gmail API as that is required for this feature.
-
Be sure you have your Client ID and Client Secret handy to continue setup within your HE hub. If you ever need to get them again, you can navigate to APIs & Services and then Credentials to view your OAuth credentials. Clicking the Pencil icon will expose your Client ID and Client Secret.
Note: Google Calendar Search is available via Hubitat Package Manager (HPM). If you install via HPM, skip to Step 5 below.
- Back up your hub and save a local copy before proceeding.
- Install the apps from the "Apps" folder in this repository into the "Apps Code" section of Hubitat. If you are not familiar with this process, follow the steps in How to Install Custom Apps.
- GCal Search - This app requires you to enable OAuth so please follow the instructions mentioned above. Import URL is: https://raw.githubusercontent.com/HubitatCommunity/Google_Calendar_Search/main/Apps/GCal_Search.groovy
- GCal Search Trigger - Import URL is: https://github.com/HubitatCommunity/Google_Calendar_Search/blob/main/Apps/GCal_Search_Trigger.groovy
- Install the drivers from the "Driver" folder in this repository into the "Drivers Code" section of Hubitat. If you are not familiar with this process, follow the steps in How to Install Custom Drivers.
- GCal Switch - Import URL is: https://raw.githubusercontent.com/HubitatCommunity/Google_Calendar_Search/main/Driver/GCal_Switch.groovy
- Gmail Notification Device - Import URL is: https://raw.githubusercontent.com/HubitatCommunity/Google_Calendar_Search/main/Driver/GCal_Switch.groovy
- Install an instance of app: go to Apps > Add User App, choose GCal Search
- Click Google API Authorization
- Enter the Client ID and Secret copied from Step 15 above
- Click Authenticate GCal Search
- Follow the prompts in the popup.
- When prompted that Google hasn't verified this app, click Advanced
- In the bottle left click Go to hubitat.com/Hubitat Calendar (or whatever you named your project)
- Choose which Google Apps to entitle access. This needs to match which APIs you enabled access in the Console. Click Continue
- Follow the instructions on the final page and close the popup window.
- Assuming a successful Google Authentication, a message will appear in HE letting you know and to click Next to continue setup.
- Click Next
- From here you can setup new Search Triggers by clicking New Search... and follow the instructions.
- If you have any questions or issues, please post them in the [RELEASE] Google Calendar, Task, and Gmail Search and Gmail Notification Device community thread.