Introduction

This Library has been made for developers that wish to create their own Homey App, and possibly publish it to the App Store.

Read this Library as a tutorial, and use the API Reference for a systematic overview of methods and events.

What is a Homey app, exactly?

A Homey app is JavaScript code, images etc. that extend Homey to:

app.js

	module.exports.init = function(){

	// run your code here
	console.log("Hello world!");

}

Important facts

  1. Homey apps are written in JavaScript. Their runtime is Node.js (server-side javascript)
  2. For security reasons, Homey apps are sandboxed and restricted in what they can do. Native code can not be executed.
  3. Homey Apps can be published to the Homey App Store. Published apps must be open-source, and hosted in a Git repository. Publishing apps without disclosing the source is possible by contacting info@athom.com

App contents

File structure:

  • com.athom.hello Your app's folder, in reverse domain name notation
    • app.js required Your main file. Should contain a Class named App with at least a function init()
    • app.json required This file contains all metadata of your app. See the example to the right
    • api.js If you want to access your app externally, define your API endpoints here
    • README.md App Store required A markdown file with info about your app. The contents will be displayed on the App Store
    • assets This is where all your assets (e.g. images, icons) are stored.
      • icon.svg This icon will be used throughout Homey required
      • images This is where all your app store images are stored.
        • large.jpg App Store required A 500px × 350px image for display on the App Store
        • small.jpg App Store required A 250px × 175px image for display on the App Store
    • drivers Any drivers should be stored here
      • bulb The driver ID, the same as in app.json
        • driver.js The driver file. For more info, see drivers.
        • assets The driver assets
          • icon.svg A driver-specific icon. When not present, the app icon will be used.
          • images This is where all your app store images are stored.
            • large.jpg App Store required A 500px × 500px image for display on the App Store
            • small.jpg App Store required A 75px × 75px image for display on the App Store
    • locales Any strings that should be translated should be stored here
      • en.json
      • nl.json
    • settings This folder will be accessible through Homey's settings manager
      • index.html

app.json

		{
    "id": "com.athom.hello",
    "version": "1.0.0",
    "compatibility": ">=1.2.3",
    "name": {
        "en": "Hello World!",
        "nl": "Hallo wereld!"
    },
    "description": {
        "en": "This is an example app for Homey",
        "nl": "Dit is een voorbeeld app voor Homey"
    },
    "permissions": [
        "homey:manager:speech-output"
    ],
    "speech": [
        {
            "id": "hello",
            "importance": 0.6,
            "synonyms": {
                "en": [ "hello", "hi", "hey" ]
            }
        }
    ]
}