The Hubitat community has developed some great apps to help you automate your devices in new, cool ways. Once you have the code, you can add the code to your hub on the Apps Code page and then install an instance of the app itself from the Apps page.
The developer of the app will normally post a link to their app code. Follow their directions to get to the source code. You will need to copy and paste this code below, or you may copy and paste a URL containing the "raw" (i.e., text only, no formatting) source code.
To add custom app code to your hub:
Navigate to Settings and ensure the Show advanced/developer options toggle is enabled.
In the sidebar, find the For Developers section and then select Apps Code under this section. (If you do not see Apps Code, expand the For Developers section. If you do not see the For Developers section, return to the previous step to verify.)
Select the +Add App button at the top of the Apps Code page.
In the blank text field, paste the code. Alternatively, you can select the Import option under the three-dots menu (in the upper right) and type or paste a URL to the code in raw text format.
Select the Save button in the top right. When the progress spinner or the "modified" text at the top of the screen next to the app name (e.g., "New App - modified") goes away, your app is saved.
You may experience an error in the last step. If you do, your app will not save, and it will not work. Ensure you have copied and pasted the code correctly or provided the correct import URL for the raw code. If this does not help and the error message does not help you figure out the problem on your own, we suggest attempting to contact the developer of the app in the Hubitat Community forum (or wherever you obtained the code).
Code added this way is often referred to as a custom app, community app, or user app (as opposed to a built-in app). Note that any support for custom apps must come from the the developer, yourself, or other third-parties; such code is not provided or supported by Hubitat itself and is used at your own risk.
Some custom apps will require enabling a feature called OAuth (or Open Authorization). Consult the app developer's documentation for specific instructions and to find out if you need to do this.
After saving your user app code:
If your client secret key becomes compromised, you may refresh it to protect the OAuth2 endpoint security.
To refresh the client secret, open your user app code, select OAuth from the three-dots menu, and check to box for Refresh Client Secret. Then, select Update:
Note that doing this may require reconfiguration of whatever service, app, URLs, etc. that interact with this Hubitat app.
Once your app has successfully saved, you will need to install an instance of the app if you want to use it.
From the sidebar of your hub, select Apps.
Select the +Add User App button:
Find your User App in the list and select it to instantly add it.
That's it! You're all set to create glorious home automations with your new app.
Don't forget to thank the developer in the community forum for their hard work.