-
-
Notifications
You must be signed in to change notification settings - Fork 0
/
config.schema.json
169 lines (166 loc) · 6.32 KB
/
config.schema.json
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
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
{
"pluginAlias": "HomebridgeHomeWizardEnergySocket",
"pluginType": "platform",
"singular": true,
"headerDisplay": "Please [read the README](https://github.com/jvandenaardweg/homebridge-homewizard-energy-socket#readme) of the plugin for more information and instructions on how to configure it.",
"schema": {
"type": "object",
"properties": {
"name": {
"title": "Bridge name",
"type": "string",
"required": true,
"placeholder": "HomeWizard Energy Socket",
"description": "You'll see this name when you add the bridge in your Home app and also in the logs within Homebridge.",
"default": "HomeWizard Energy Socket"
},
"energySockets": {
"type": "array",
"items": {
"type": "object",
"properties": {
"name": {
"type": "string",
"title": "Name",
"placeholder": "What is plugged in?",
"required": true
},
"ip": {
"type": "string",
"title": "IP Address",
"placeholder": "192.168.0.10",
"format": "ipv4",
"required": true
},
"outletInUse": {
"type": "object",
"properties": {
"isActive": {
"title": "Use Outlet in Use?",
"type": "boolean",
"required": false,
"default": false,
"description": "When enabled, the \"Outlet In Use\" characteristic will be shown as \"Yes\" if the device plugged in the Energy Socket is consuming a certain amount of power. You can trigger automations based on this characteristic. <a href='https://github.com/jvandenaardweg/homebridge-homewizard-energy-socket/wiki/About-the-Outlet-In-Use-characteristic' target='_blank'>Learn more about it in the Wiki</a>."
},
"threshold": {
"title": "Threshold (watts)",
"placeholder": "Power usage in watts",
"type": "number",
"required": true,
"default": 5,
"minimum": 0.1,
"maximum": 3680,
"description": "When the power consumption is higher than this threshold, the \"Outlet In Use\" characteristic will be shown as \"Yes\" in the Home app. Otherwise it shows \"No\". Defaults to 5 watt.",
"condition": {
"functionBody": "return model.energySockets[arrayIndices].outletInUse.isActive === true;"
}
},
"thresholdDuration": {
"title": "Duration (seconds)",
"placeholder": "Duration in seconds",
"type": "number",
"required": true,
"default": 10,
"minimum": 0,
"maximum": 86400,
"description": "Defaults to 10 seconds.",
"condition": {
"functionBody": "return model.energySockets[arrayIndices].outletInUse.isActive === true;"
}
},
"verboseLogging": {
"title": "Verbose logging",
"type": "boolean",
"required": false,
"description": "Enable to see more verbose logging for the power consumption of this Energy Socket. Useful for determining the right threshold. Default: false",
"default": false
}
}
}
}
}
}
}
},
"layout": [
{
"type": "flex",
"flex-flow": "row wrap",
"orderable": false,
"items": [
{
"key": "name",
"type": "name"
}
]
},
{
"type": "fieldset",
"title": "Energy Sockets",
"description": "<strong>This config option is optional.</strong> Only use this if you want to bypass automatic discovery or use only the Energy Sockets you define here. When no Energy Sockets are defined here, the plugin will automatically discover and use all Energy Sockets on your network.",
"expandable": true,
"orderable": false,
"items": [
{
"title": "Energy Socket",
"key": "energySockets",
"type": "array",
"notitle": true,
"orderable": false,
"items": [
{
"type": "flex",
"flex-flow": "row wrap",
"items": [
{
"type": "flex",
"flex-flow": "row wrap",
"items": [
{
"key": "energySockets[].name"
},
{
"key": "energySockets[].ip"
}
]
},
{
"type": "div",
"items": [
{
"key": "energySockets[].outletInUse.isActive"
}
]
},
{
"type": "flex",
"flex-flow": "row wrap",
"condition": {
"functionBody": "return model.energySockets[arrayIndices].outletInUse.isActive === true;"
},
"items": [
{
"key": "energySockets[].outletInUse.threshold",
"description": ""
},
{
"key": "energySockets[].outletInUse.thresholdDuration",
"description": ""
},
{
"type": "help",
"helpvalue": "<p class='help-block'>When the power consumption <strong>rises above</strong> the <strong>threshold</strong> for the <strong>duration</strong>, the \"Outlet In Use\" characteristic will be set to \"Yes\" in the Home app. If it falls below the <strong>threshold</strong> for the <strong>duration</strong> it will be set to \"No\".</p>"
},
{
"key": "energySockets[].outletInUse.verboseLogging"
}
]
}
]
}
]
}
]
}
]
}