-
Notifications
You must be signed in to change notification settings - Fork 3
/
fullexample.yaml
148 lines (117 loc) · 4.91 KB
/
fullexample.yaml
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
# There are three levels where settings can be specified:
# global level (inside the settings section), template level, and thing level
settings:
# output defines where the generated .things and .items are saved
# When specified in multiple levels,
# the more specific setting will take effect in this order of preference: thing, template, global level
# templates provide specific details of the various templates used by things in this file
# this is the default output when not specified
output: default-output
# a default template can be specified here that will apply to all things without a specific template
# template: default-template
# global headers applied to all generated files
header: |+
// This file was automatically generated by openhab-items-generator
// Do not manually change this file
# note that not all templates need to be specified here. By default, templates will be loaded from
# "templates/<templatename>.tpl".
# this section allows customising the template file path and/or the output of the generated
# file for things using the template.
templates:
# Group all light items/things into a separate output
tradfri-light:
# The default template file is "templates/<templatename>.tpl" so it is not necessary to specify it
# template-file: templates/tradfri-light.tpl
output: lights-output
tasmota-light:
# template-file: templates/tasmota-light.tpl
output: lights-output
tasmota-switch:
output: lights-output
multi-channel-light:
output: lights-output
default-template:
output: default-output
# a list of possible output files.
# It can be referred by each thing, the template, or the global output settings
outputs:
# "default-output" is not a special name. It becomes the "default" when assigned to the global "output:" setting above
default-output:
things-file: ../things/generated.things
items-file: ../items/generated.items
items-file-header: |+
Group gExhaustFans
Group gLightButtons
Group gNightLightTriggers
Group gLightTriggers
Group gDoorBell
Group gMotionAlert
Group gHumidity
Group:Number:MAX gIndoorHumidity (gHumidity)
Group gExhaustFanHumidity (gHumidity) // to be linked with an exhaustfan
lights-output:
things-file: ../things/lights.things
items-file: ../items/lights.items
items-file-header: |+
Group gOutsideLights
Group gInsideLights
Group gTasmotaState
Group gPresenceSimulators // Things to turn on / off to simulate presence in the house
# Anything other than "settings" is considered a thing to generate
# Special properties:
# template (mandatory, if no global default template is defined): refers to
# the 'templates' section in the settings to be used for generating the thing
# output (optional): refers to the 'outputs' section in the settings to control
# the files where the generated code will be saved
# Automatic / generated variables:
# For convenience, several variables are created for each thing automatically
# They can be used within the template without having to add them explicitly,
# but they can be overridden in the thing's section
# name
# This is the same as the yaml entry name, e.g. MasterBathroom_Light
# name_parts (array)
# An array from splitting the name by underscore
# e.g. name: MasterBathroom_Light -> name_parts[0]: MasterBathroom, name_parts[1]: Light
# label
# generated by splitting the CamelCase of the thing's name
# e.g. name: MasterBathroom_Light -> label: "Master Bathroom Light"
# thingid
# generated by converting the thing's name to lower case and replacing "_" with "-"
# e.g. name: MasterBathroom_Light -> thingid: masterbathroom-light
# room
# generated by taking the first part of the thing's name before the underscore
# and splitting the camel case into separate words]
# e.g. name: MasterBathroom_Light -> room: "Master Bathroom"
MasterBathRoom_Light:
template: tradfri-light
groups:
- gPresenceSimulators
- gInsideLights
metadata:
- ga: Light
MasterBathRoom_Switch1:
template: tasmota-switch
switches:
- name: MasterBathRoom_Light_Switch
label: Master Bath Room Light Switch
groups:
- gRule_Always_On
- name: MasterBathRoom_ExhaustFan_Power
label: Master Bath Room Exhaust Fan
groups:
- gInsideLights
- gExhaustFans
metadata:
- ga: Fan
buttons:
- name: MasterBathRoom_Light_Button
label: Master Bath Room Switch Button
groups:
- gLightButtons
MasterBedRoom_Light:
template: tasmota-light
features:
- color
- ct
groups:
- gInsideLights