App Definition
App Definition
Overview
The app definition provides the Hubitat Elevation hub with information about an app.
If you are new to Hubitat app development, start with App Overview and return here if you need more information about
definition().
Structure
definition(
// ...
)
Parameters
Required Parameters
name: The name of the app as will be displayed in the Add User App dialog, the App Status page, and other locationsnamespace: A unique identifier for the developer (app name plus namespace combinations must be unique), typically a username typically used by that developer (often their GitHub username)author: A string identifying the developer, sometimes a real name or company name (unlike the name and namespace, this is used only for display purposes)description: A short description of the app's purpose (shown under the app name on the Add User App page)category: currently not usediconUrl: currently not used; should be set to empty stringiconX2Url: currently not used; should be set to empty string
Optional Parameters
iconX3Url: Not currently used, should be set to an empty stringinstallOnOpen:trueorfalse, defaults tofalse; will install app as soon as app is opened for first time without user needing to select DonedocumentationLink: A link to the documentation for this app (often a Community post for user apps); the "?" icon in the upper right of the app pages will link to this URLvideoLink: A link to a video recording (e.g., a how-to or other video documentation) for this app. Will be linked to from video icon in upper right of app pages.importUrl- The URL where the "raw" Groovy code for this app can be found (not currently used)oauth:trueorfalse, defines whether this app makes use of OAuth (not currently used; OAuth must be manually enabled by user regardless)parent: If this is a child app, specifies the parent app in the format"namespace:app name"singleInstance:trueorfalse; if set totrue, only a single instance of this app can be installed. The default isfalse.singleThreaded- Iftrue(default isfalse), simultaneous execution of a particular installed app instance is prevented. The hub will load app data (including state), run the called method, and save the data (including state) completely before moving on any additional calls that may have been queued in the meantime. This applies to "top level" methods only. More details: https://community.hubitat.com/t/2-2-9-singlethreaded-option-for-apps-drivers/80969
Example
definition(
name: "My First App",
namespace: "myfirstapp",
author: "John Smith",
description: "This is the first Hubitat app I've created",
category: "General",
iconUrl: "",
iconX2Url: "",
iconX3Url: ""
)