Homey Compose
Homey Compose makes developing Homey Apps easier by splitting up the App Manifest into multiple smaller manifests.

File structure

The file structure when using compose looks as follows. This is an overview of all files that can be used with Homey Compose.
1
com.athom.example/
2
β”œβ”€ .homeycompose/
3
β”‚ β”œβ”€ app.json
4
β”‚ β”œβ”€ capabilities/
5
β”‚ β”‚ └─ <id>.json
6
β”‚ β”œβ”€ screensavers/
7
β”‚ β”‚ └─ <id>.json
8
β”‚ β”œβ”€ signals/
9
β”‚ β”‚ β”œβ”€ 433/
10
β”‚ β”‚ β”‚ └─ <id>.json
11
β”‚ β”‚ β”œβ”€ 868/
12
β”‚ β”‚ β”‚ └─ <id>.json
13
β”‚ β”‚ └─ ir/
14
β”‚ β”‚ └─ <id>.json
15
β”‚ β”œβ”€ flow/
16
β”‚ β”‚ β”œβ”€ triggers/
17
β”‚ β”‚ β”‚ └─ <id>.json
18
β”‚ β”‚ β”œβ”€ conditions/
19
β”‚ β”‚ β”‚ └─ <id>.json
20
β”‚ β”‚ └─ actions/
21
β”‚ β”‚ └─ <id>.json
22
β”‚ β”œβ”€ discovery/
23
β”‚ β”‚ └─ <id>.json
24
β”‚ β”œβ”€ drivers/
25
β”‚ β”‚ β”œβ”€ templates/
26
β”‚ β”‚ β”‚ └─ <template_id>.json
27
β”‚ β”‚ β”œβ”€ settings/
28
β”‚ β”‚ β”‚ └─ <setting_id>.json
29
β”‚ β”‚ └─ flow/
30
β”‚ β”‚ β”œβ”€ triggers/
31
β”‚ β”‚ β”‚ └─ <id>.json
32
β”‚ β”‚ β”œβ”€ conditions/
33
β”‚ β”‚ β”‚ └─ <id>.json
34
β”‚ β”‚ └─ actions/
35
β”‚ β”‚ └─ <id>.json
36
β”‚ └─ locales/
37
β”‚ β”œβ”€ <locale>.json
38
β”‚ └─ <locale.foo>.json
39
└─ drivers/
40
└─ <driver_id>/
41
β”œβ”€ driver.compose.json
42
β”œβ”€ driver.flow.compose.json
43
└─ driver.settings.compose.json
Copied!

Templating

Compose also allows for creating driver and setting templates to share common properties, for example RF signals, assets, etc. You can create a driver template by placing the shared properties in .homeycompose/drivers/templates/<template_id>.json. Then extend from the template in your driver compose file by placing the template id the $extends property in driver.compose.json. Compose will copy all properties from the template to the final file. Should you want to overwrite a property, you can do so by placing it in your driver.compose.json.
/.homeycompose/drivers/templates/defaults.json
1
{
2
"images": {
3
"large": "{{driverAssetsPath}}/images/large.png",
4
"small": "{{driverAssetsPath}}/images/small.png"
5
},
6
"icon": "{{driverAssetsPath}}/icon.svg",
7
"capabilities": [],
8
"class": "other"
9
}
Copied!
/drivers/my_driver/driver.compose.json
1
{
2
"name": {
3
"en": "My Driver",
4
"nl": "Mijn Driver"
5
},
6
"$extends": ["defaults"]
7
}
Copied!
By using this template, you only have to place the values that are uniqiue to a driver in the driver.compose.json file. All other required properties are copied over from the template.
Last modified 8mo ago
Copy link