Difference between revisions of "Apps Code"

From Hubitat Documentation
Jump to: navigation, search
(Add ALT text)
(Replaced content with " <big>'''We're moving!''' Please visit http://docs2.hubitat.com for the latest documentation.</big> <big>This document is available at: http://docs2.hubitat.com/en/user-i...")
(Tag: Replaced)
 
Line 1: Line 1:
{{Top}}
 
  
<big>The Hubitat community has developed some great apps to help you automate your devices in new, cool ways.</big>
+
<big>'''We're moving!''' Please visit http://docs2.hubitat.com for the latest documentation.</big>
  
'''NOTE:''' Third-party code is not offically supported by Hubitat. Support may (or may not) be provided by the developer.
+
<big>This document is available at: http://docs2.hubitat.com/en/user-interface/developer/apps-code</big>
 
 
===<big>Installing custom apps</big>===
 
 
 
#<big>The developer of the app will normally post a link to their app code. Follow their directions to get to the source code.</big>
 
#<big>Often, developers will use GitHub to host code. When copying the code, select the '''Raw''' button so that you are getting the plain-text form of the code, with no HTML formatting.</big>[[File:GitHub raw button v2.png|none|thumb|600x600px|link=https://docs.hubitat.com/images/5/5c/GitHub_raw_button_v2.png |alt=Screenshot of "Raw" button on GitHub, located towards the top right]]
 
#<big>'''Select All''' the raw code, and then '''Copy''' the code.</big>
 
#<big>From the home page of your hub, select '''Apps Code''' in the side bar. ''NOTE: If you do not see '''Apps Code''', expand the '''Developer Tools''' section to expose Apps Code and other developer/code links.''</big>
 
#<big>Select the '''+New App''' button in the upper right corner of the Apps Code page.</big>[[File:New User App dialogue 2.0.png|none|thumb|600x600px|link=https://docs.hubitat.com/images/6/61/New_User_App_dialogue_2.0.png |alt=Screenshot of "New App" button on Apps Code page]]
 
#<big>In the blank text field, paste the code. Alternatively, you can select the '''Import''' button and past a URL to the developers code in raw text format.</big>[[File:Import user app code URL 2.0.png|none|thumb|600x600px|link=https://docs.hubitat.com/images/7/79/Import_user_app_code_URL_2.0.png |alt=Screenshot of "Import" button in Apps Code code section (type or paste URL containing raw/plain-text code)]]
 
#<big>Select the '''Save''' button in the top right. When '''modified''' goes away, your app is saved.</big>[[File:User app code unsaved 2.0.png|none|thumb|600x600px|link=https://docs.hubitat.com/images/5/5c/User_app_code_unsaved_2.0.png |alt=Screenshot: Select "Save" button after copying/pasting, importing, or modifying code (red "modified" indicator will also be displayed)]]
 
 
 
<big>You may experience an error in this step. If you do, your app will not save and it will not work. Please contact the developer of the app in the Hubitat Community forum (or troubleshoot the code yourself if is your own). It is usually best if you take a screen shot of the error to help them diagnose the problem. Once the code is fixed, come back and try again.</big>
 
 
 
'''<big>Enabling OAuth</big>'''
 
 
 
<big>Not all user apps will require OAuth (Open Authorization). Consult the app developers documentation for instruction. If it does require enabling OAuth, follow the steps below.</big>
 
 
 
#<big>After saving your user app code, select the '''Enable OAuth''' button and then '''Update''' to automatically generate the keys</big>.[[File:Enable OAuth 2.0.png|none|thumb|600x600px|link=https://docs.hubitat.com/images/d/d4/Enable_OAuth_2.0.png |alt=Screenshot: "Enable OAuth in App" button]][[File:OAuth initial dialogue 2.0.png|none|thumb|600x600px|link=https://docs.hubitat.com/images/6/63/OAuth_initial_dialogue_2.0.png |alt=Screenshot: "Update" button in OAuth dialog (to generate  keys)]]
 
 
 
*<big>If your client secret key becomes compromised, you may refresh it to protect the OAuth2 endpoint security.</big>
 
**<big>To refresh the client secret, open your user app code, select OAuth and check to box for '''Refresh Client Secret''', the select '''Update'''. If integrating with a third-party system, you may need to update the keys/URL in that system after doing this (consult documentation for that system if needed).</big>[[File:OAuth refresh client secret 2.0.png|none|thumb|600x600px|link=https://docs.hubitat.com/images/2/26/OAuth_refresh_client_secret_2.0.png |alt=Screenshot of "Refresh client secret" checkbox (to generate new keys)]]
 
 
 
'''<big>Loading Your User Developed App</big>'''
 
 
 
<big>Once your app has successfully saved, you will need to load it to your hub before you can use it.</big>
 
 
 
#<big>Select '''Apps''' from the sidebar.</big>
 
#<big>Select the '''+Add User App''' button.</big>[[File:Install Saved User App 2.0.png|none|thumb|600x600px|link=https://docs.hubitat.com/images/2/2a/Install_Saved_User_App_2.0.png |alt=Screnshot of "Add User App" button on Apps page]]
 
#<big>Find your ''User App'' in the list and select it to instantly add it.</big>[[File:Install user app list 2.0.png|none|thumb|600x600px|link=https://docs.hubitat.com/images/c/c7/Install_user_app_list_2.0.png|alt=Screenshot of user app list, showing apps available for installation]]
 
 
 
<big>That's it! You're all set to create automations with your new app. (</big><big>Don't forget to thank the developer in the community forum for their hard work</big><big>!)</big>
 

Latest revision as of 03:49, 25 September 2022

We're moving! Please visit http://docs2.hubitat.com for the latest documentation.

This document is available at: http://docs2.hubitat.com/en/user-interface/developer/apps-code