@khalido/home 0.0.0-stage → 0.1.1
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/.env.example +25 -0
- package/CHANGELOG.md +47 -0
- package/LICENSE +21 -0
- package/README.md +77 -2
- package/dist/clock.d.ts +17 -0
- package/dist/clock.js +43 -0
- package/dist/config.d.ts +273 -0
- package/dist/config.js +392 -0
- package/dist/connector.d.ts +34 -0
- package/dist/connector.js +47 -0
- package/dist/connectors/amber/client.d.ts +61 -0
- package/dist/connectors/amber/client.js +106 -0
- package/dist/connectors/amber/index.d.ts +30 -0
- package/dist/connectors/amber/index.js +94 -0
- package/dist/connectors/cast/codec.d.ts +38 -0
- package/dist/connectors/cast/codec.js +102 -0
- package/dist/connectors/cast/index.d.ts +60 -0
- package/dist/connectors/cast/index.js +428 -0
- package/dist/connectors/cast/schemas.d.ts +167 -0
- package/dist/connectors/cast/schemas.js +87 -0
- package/dist/connectors/cast/serve.d.ts +18 -0
- package/dist/connectors/cast/serve.js +57 -0
- package/dist/connectors/cast/state.d.ts +62 -0
- package/dist/connectors/cast/state.js +133 -0
- package/dist/connectors/cast/tls.d.ts +3 -0
- package/dist/connectors/cast/tls.js +67 -0
- package/dist/connectors/cast/writes.d.ts +80 -0
- package/dist/connectors/cast/writes.js +390 -0
- package/dist/connectors/daikin/client.d.ts +65 -0
- package/dist/connectors/daikin/client.js +221 -0
- package/dist/connectors/daikin/index.d.ts +41 -0
- package/dist/connectors/daikin/index.js +108 -0
- package/dist/connectors/enphase/client.d.ts +65 -0
- package/dist/connectors/enphase/client.js +173 -0
- package/dist/connectors/enphase/index.d.ts +43 -0
- package/dist/connectors/enphase/index.js +174 -0
- package/dist/connectors/enphase/schemas.d.ts +51 -0
- package/dist/connectors/enphase/schemas.js +34 -0
- package/dist/connectors/hue/client.d.ts +48 -0
- package/dist/connectors/hue/client.js +95 -0
- package/dist/connectors/hue/events.d.ts +41 -0
- package/dist/connectors/hue/events.js +156 -0
- package/dist/connectors/hue/index.d.ts +42 -0
- package/dist/connectors/hue/index.js +205 -0
- package/dist/connectors/hue/schemas.d.ts +65 -0
- package/dist/connectors/hue/schemas.js +48 -0
- package/dist/connectors/hue/state.d.ts +43 -0
- package/dist/connectors/hue/state.js +84 -0
- package/dist/connectors/printers/client.d.ts +28 -0
- package/dist/connectors/printers/client.js +74 -0
- package/dist/connectors/printers/codec.d.ts +76 -0
- package/dist/connectors/printers/codec.js +246 -0
- package/dist/connectors/printers/found.d.ts +15 -0
- package/dist/connectors/printers/found.js +35 -0
- package/dist/connectors/printers/index.d.ts +52 -0
- package/dist/connectors/printers/index.js +282 -0
- package/dist/connectors/printers/state.d.ts +60 -0
- package/dist/connectors/printers/state.js +99 -0
- package/dist/connectors/spotify/changes.d.ts +32 -0
- package/dist/connectors/spotify/changes.js +84 -0
- package/dist/connectors/spotify/client.d.ts +199 -0
- package/dist/connectors/spotify/client.js +270 -0
- package/dist/connectors/spotify/index.d.ts +92 -0
- package/dist/connectors/spotify/index.js +754 -0
- package/dist/connectors/up/client.d.ts +183 -0
- package/dist/connectors/up/client.js +308 -0
- package/dist/connectors/up/index.d.ts +91 -0
- package/dist/connectors/up/index.js +213 -0
- package/dist/connectors/up/spend.d.ts +78 -0
- package/dist/connectors/up/spend.js +213 -0
- package/dist/connectors/up/webhook.d.ts +13 -0
- package/dist/connectors/up/webhook.js +32 -0
- package/dist/connectors/weather/blocks.d.ts +51 -0
- package/dist/connectors/weather/blocks.js +106 -0
- package/dist/connectors/weather/bom.d.ts +37 -0
- package/dist/connectors/weather/bom.js +237 -0
- package/dist/connectors/weather/ftp.d.ts +5 -0
- package/dist/connectors/weather/ftp.js +46 -0
- package/dist/connectors/weather/google.d.ts +31 -0
- package/dist/connectors/weather/google.js +364 -0
- package/dist/connectors/weather/index.d.ts +53 -0
- package/dist/connectors/weather/index.js +280 -0
- package/dist/connectors/weather/open-meteo.d.ts +15 -0
- package/dist/connectors/weather/open-meteo.js +285 -0
- package/dist/connectors/weather/rain.d.ts +19 -0
- package/dist/connectors/weather/rain.js +51 -0
- package/dist/connectors/weather/source.d.ts +149 -0
- package/dist/connectors/weather/source.js +77 -0
- package/dist/connectors/weather/sun.d.ts +48 -0
- package/dist/connectors/weather/sun.js +65 -0
- package/dist/discover.d.ts +197 -0
- package/dist/discover.js +452 -0
- package/dist/energy.d.ts +61 -0
- package/dist/energy.js +162 -0
- package/dist/finders-entry.d.ts +1 -0
- package/dist/finders-entry.js +2 -0
- package/dist/finders.d.ts +48 -0
- package/dist/finders.js +176 -0
- package/dist/health.d.ts +28 -0
- package/dist/health.js +35 -0
- package/dist/home.d.ts +81 -0
- package/dist/home.js +114 -0
- package/dist/index.d.ts +11 -0
- package/dist/index.js +11 -0
- package/dist/lane.d.ts +17 -0
- package/dist/lane.js +74 -0
- package/dist/locate.d.ts +27 -0
- package/dist/locate.js +59 -0
- package/dist/manifest.d.ts +31 -0
- package/dist/manifest.js +4 -0
- package/dist/manifests.d.ts +5 -0
- package/dist/manifests.js +23 -0
- package/dist/node-fetch.d.ts +9 -0
- package/dist/node-fetch.js +25 -0
- package/dist/poll.d.ts +10 -0
- package/dist/poll.js +33 -0
- package/docs/cast.md +133 -0
- package/docs/cli.md +41 -0
- package/docs/config.md +36 -0
- package/docs/decisions.md +150 -0
- package/docs/devices.md +128 -0
- package/docs/enphase-notes.md +24 -0
- package/docs/google.md +92 -0
- package/docs/ideas.md +69 -0
- package/docs/matter.md +55 -0
- package/docs/performance.md +12 -0
- package/docs/philosophy.md +23 -0
- package/docs/up.md +84 -0
- package/docs/using.md +65 -0
- package/docs/weather-probe.md +63 -0
- package/examples/home.jsonc +74 -0
- package/examples/home.svg +76 -0
- package/home.schema.json +474 -0
- package/llms.txt +32 -0
- package/package.json +143 -4
- package/skills/draw-home/README.md +25 -0
- package/skills/draw-home/SKILL.md +80 -0
- package/skills/use-home/SKILL.md +86 -0
- package/src/cli/cache.ts +29 -0
- package/src/cli/cast.ts +172 -0
- package/src/cli/config.ts +52 -0
- package/src/cli/context.ts +118 -0
- package/src/cli/discover.ts +182 -0
- package/src/cli/enphase.ts +62 -0
- package/src/cli/hue.ts +124 -0
- package/src/cli/locate.ts +47 -0
- package/src/cli/main.ts +182 -0
- package/src/cli/printers.ts +21 -0
- package/src/cli/probe.ts +274 -0
- package/src/cli/spotify.ts +76 -0
- package/src/cli/status.ts +228 -0
- package/src/cli/up.ts +350 -0
- package/src/clock.ts +62 -0
- package/src/config.ts +578 -0
- package/src/connector.ts +77 -0
- package/src/connectors/amber/README.md +40 -0
- package/src/connectors/amber/client.ts +157 -0
- package/src/connectors/amber/index.ts +118 -0
- package/src/connectors/cast/README.md +44 -0
- package/src/connectors/cast/codec.ts +126 -0
- package/src/connectors/cast/index.ts +552 -0
- package/src/connectors/cast/schemas.ts +101 -0
- package/src/connectors/cast/serve.ts +82 -0
- package/src/connectors/cast/state.ts +203 -0
- package/src/connectors/cast/tls.ts +100 -0
- package/src/connectors/cast/writes.ts +572 -0
- package/src/connectors/daikin/README.md +78 -0
- package/src/connectors/daikin/client.ts +295 -0
- package/src/connectors/daikin/index.ts +145 -0
- package/src/connectors/enphase/README.md +64 -0
- package/src/connectors/enphase/client.ts +244 -0
- package/src/connectors/enphase/index.ts +241 -0
- package/src/connectors/enphase/schemas.ts +45 -0
- package/src/connectors/hue/README.md +50 -0
- package/src/connectors/hue/client.ts +157 -0
- package/src/connectors/hue/events.ts +182 -0
- package/src/connectors/hue/index.ts +261 -0
- package/src/connectors/hue/schemas.ts +60 -0
- package/src/connectors/hue/state.ts +124 -0
- package/src/connectors/printers/README.md +46 -0
- package/src/connectors/printers/client.ts +114 -0
- package/src/connectors/printers/codec.ts +292 -0
- package/src/connectors/printers/found.ts +46 -0
- package/src/connectors/printers/index.ts +385 -0
- package/src/connectors/printers/state.ts +182 -0
- package/src/connectors/spotify/README.md +83 -0
- package/src/connectors/spotify/changes.ts +127 -0
- package/src/connectors/spotify/client.ts +387 -0
- package/src/connectors/spotify/index.ts +937 -0
- package/src/connectors/up/README.md +35 -0
- package/src/connectors/up/client.ts +518 -0
- package/src/connectors/up/index.ts +370 -0
- package/src/connectors/up/spend.ts +280 -0
- package/src/connectors/up/webhook.ts +62 -0
- package/src/connectors/weather/README.md +84 -0
- package/src/connectors/weather/blocks.ts +173 -0
- package/src/connectors/weather/bom.ts +344 -0
- package/src/connectors/weather/ftp.ts +48 -0
- package/src/connectors/weather/google.ts +425 -0
- package/src/connectors/weather/index.ts +396 -0
- package/src/connectors/weather/open-meteo.ts +309 -0
- package/src/connectors/weather/rain.ts +73 -0
- package/src/connectors/weather/source.ts +236 -0
- package/src/connectors/weather/sun.ts +114 -0
- package/src/discover.ts +638 -0
- package/src/energy.ts +221 -0
- package/src/finders-entry.ts +2 -0
- package/src/finders.ts +250 -0
- package/src/health.ts +74 -0
- package/src/home.ts +205 -0
- package/src/index.ts +62 -0
- package/src/lane.ts +110 -0
- package/src/locate.ts +85 -0
- package/src/manifest.ts +43 -0
- package/src/manifests.ts +27 -0
- package/src/node-fetch.ts +41 -0
- package/src/poll.ts +33 -0
package/home.schema.json
ADDED
|
@@ -0,0 +1,474 @@
|
|
|
1
|
+
{
|
|
2
|
+
"$schema": "https://json-schema.org/draft/2020-12/schema",
|
|
3
|
+
"type": "object",
|
|
4
|
+
"properties": {
|
|
5
|
+
"$schema": {
|
|
6
|
+
"type": "string"
|
|
7
|
+
},
|
|
8
|
+
"name": {
|
|
9
|
+
"type": "string"
|
|
10
|
+
},
|
|
11
|
+
"location": {
|
|
12
|
+
"type": "object",
|
|
13
|
+
"properties": {
|
|
14
|
+
"latitude": {
|
|
15
|
+
"type": "number",
|
|
16
|
+
"minimum": -90,
|
|
17
|
+
"maximum": 90
|
|
18
|
+
},
|
|
19
|
+
"longitude": {
|
|
20
|
+
"type": "number",
|
|
21
|
+
"minimum": -180,
|
|
22
|
+
"maximum": 180
|
|
23
|
+
},
|
|
24
|
+
"bomForecast": {
|
|
25
|
+
"description": "BOM précis location by name or aac, e.g. Sydney",
|
|
26
|
+
"type": "string"
|
|
27
|
+
},
|
|
28
|
+
"timezone": {
|
|
29
|
+
"description": "the home's IANA time zone, where its day starts (Enphase's and Up's today, the weather's day blocks) and the zone weather times show in; the runtime's when left out",
|
|
30
|
+
"type": "string"
|
|
31
|
+
}
|
|
32
|
+
},
|
|
33
|
+
"required": [
|
|
34
|
+
"latitude",
|
|
35
|
+
"longitude"
|
|
36
|
+
],
|
|
37
|
+
"additionalProperties": {}
|
|
38
|
+
},
|
|
39
|
+
"weather": {
|
|
40
|
+
"type": "object",
|
|
41
|
+
"properties": {
|
|
42
|
+
"sources": {
|
|
43
|
+
"description": "preference order; default open-meteo",
|
|
44
|
+
"type": "array",
|
|
45
|
+
"items": {
|
|
46
|
+
"type": "string",
|
|
47
|
+
"enum": [
|
|
48
|
+
"bom",
|
|
49
|
+
"open-meteo",
|
|
50
|
+
"google"
|
|
51
|
+
]
|
|
52
|
+
}
|
|
53
|
+
},
|
|
54
|
+
"pollMinutes": {
|
|
55
|
+
"type": "number",
|
|
56
|
+
"minimum": 1
|
|
57
|
+
},
|
|
58
|
+
"googleKey": {
|
|
59
|
+
"description": "env name holding a Maps Platform key, when sources has google",
|
|
60
|
+
"type": "string",
|
|
61
|
+
"pattern": "^[A-Z_][A-Z0-9_]*$"
|
|
62
|
+
}
|
|
63
|
+
},
|
|
64
|
+
"additionalProperties": {}
|
|
65
|
+
},
|
|
66
|
+
"rooms": {
|
|
67
|
+
"type": "array",
|
|
68
|
+
"items": {
|
|
69
|
+
"type": "object",
|
|
70
|
+
"properties": {
|
|
71
|
+
"id": {
|
|
72
|
+
"type": "string",
|
|
73
|
+
"format": "starts_with",
|
|
74
|
+
"pattern": "^room-.*"
|
|
75
|
+
},
|
|
76
|
+
"name": {
|
|
77
|
+
"type": "string"
|
|
78
|
+
},
|
|
79
|
+
"floor": {
|
|
80
|
+
"type": "string"
|
|
81
|
+
},
|
|
82
|
+
"hueRoom": {
|
|
83
|
+
"description": "the Hue room, zone or grouped_light id whose lights this room's marker shows",
|
|
84
|
+
"type": "string"
|
|
85
|
+
}
|
|
86
|
+
},
|
|
87
|
+
"required": [
|
|
88
|
+
"id",
|
|
89
|
+
"name"
|
|
90
|
+
],
|
|
91
|
+
"additionalProperties": {}
|
|
92
|
+
}
|
|
93
|
+
},
|
|
94
|
+
"devices": {
|
|
95
|
+
"type": "array",
|
|
96
|
+
"items": {
|
|
97
|
+
"oneOf": [
|
|
98
|
+
{
|
|
99
|
+
"type": "object",
|
|
100
|
+
"properties": {
|
|
101
|
+
"connector": {
|
|
102
|
+
"type": "string",
|
|
103
|
+
"const": "hue"
|
|
104
|
+
},
|
|
105
|
+
"host": {
|
|
106
|
+
"type": "string",
|
|
107
|
+
"description": "the bridge's last known address"
|
|
108
|
+
},
|
|
109
|
+
"bridgeId": {
|
|
110
|
+
"type": "string",
|
|
111
|
+
"description": "the bridge id, the CN its certificate must carry: its identity"
|
|
112
|
+
},
|
|
113
|
+
"key": {
|
|
114
|
+
"type": "string",
|
|
115
|
+
"pattern": "^[A-Z_][A-Z0-9_]*$",
|
|
116
|
+
"description": "env name holding the application key from `home pair`"
|
|
117
|
+
},
|
|
118
|
+
"ca": {
|
|
119
|
+
"type": "string",
|
|
120
|
+
"minLength": 1,
|
|
121
|
+
"description": "Signify's root CA (PEM), relative to the config file"
|
|
122
|
+
},
|
|
123
|
+
"id": {
|
|
124
|
+
"type": "string"
|
|
125
|
+
},
|
|
126
|
+
"room": {
|
|
127
|
+
"type": "string",
|
|
128
|
+
"format": "starts_with",
|
|
129
|
+
"pattern": "^room-.*"
|
|
130
|
+
},
|
|
131
|
+
"name": {
|
|
132
|
+
"type": "string"
|
|
133
|
+
}
|
|
134
|
+
},
|
|
135
|
+
"required": [
|
|
136
|
+
"connector",
|
|
137
|
+
"host",
|
|
138
|
+
"bridgeId",
|
|
139
|
+
"key",
|
|
140
|
+
"ca",
|
|
141
|
+
"id"
|
|
142
|
+
],
|
|
143
|
+
"additionalProperties": {}
|
|
144
|
+
},
|
|
145
|
+
{
|
|
146
|
+
"type": "object",
|
|
147
|
+
"properties": {
|
|
148
|
+
"connector": {
|
|
149
|
+
"type": "string",
|
|
150
|
+
"const": "daikin"
|
|
151
|
+
},
|
|
152
|
+
"host": {
|
|
153
|
+
"type": "string",
|
|
154
|
+
"description": "the unit's last known address"
|
|
155
|
+
},
|
|
156
|
+
"mac": {
|
|
157
|
+
"description": "the unit's MAC as its UDP discovery reports it: its identity",
|
|
158
|
+
"type": "string"
|
|
159
|
+
},
|
|
160
|
+
"id": {
|
|
161
|
+
"type": "string"
|
|
162
|
+
},
|
|
163
|
+
"room": {
|
|
164
|
+
"type": "string",
|
|
165
|
+
"format": "starts_with",
|
|
166
|
+
"pattern": "^room-.*"
|
|
167
|
+
},
|
|
168
|
+
"name": {
|
|
169
|
+
"type": "string"
|
|
170
|
+
}
|
|
171
|
+
},
|
|
172
|
+
"required": [
|
|
173
|
+
"connector",
|
|
174
|
+
"host",
|
|
175
|
+
"id"
|
|
176
|
+
],
|
|
177
|
+
"additionalProperties": {}
|
|
178
|
+
},
|
|
179
|
+
{
|
|
180
|
+
"type": "object",
|
|
181
|
+
"properties": {
|
|
182
|
+
"connector": {
|
|
183
|
+
"type": "string",
|
|
184
|
+
"const": "enphase"
|
|
185
|
+
},
|
|
186
|
+
"host": {
|
|
187
|
+
"type": "string",
|
|
188
|
+
"description": "the gateway's last known address"
|
|
189
|
+
},
|
|
190
|
+
"serial": {
|
|
191
|
+
"description": "the gateway's serial, as mDNS `serialnum` (and /info) report it: its identity",
|
|
192
|
+
"type": "string"
|
|
193
|
+
},
|
|
194
|
+
"token": {
|
|
195
|
+
"type": "string",
|
|
196
|
+
"minLength": 1,
|
|
197
|
+
"description": "the owner token file: JSON with a `token` field (what `home enphase login` writes), or the bare token"
|
|
198
|
+
},
|
|
199
|
+
"marker": {
|
|
200
|
+
"description": "the plan's marker where the solar array is drawn, on the roof outside any room",
|
|
201
|
+
"type": "string",
|
|
202
|
+
"format": "starts_with",
|
|
203
|
+
"pattern": "^marker-.*"
|
|
204
|
+
},
|
|
205
|
+
"capacityW": {
|
|
206
|
+
"description": "the array's rated size in watts, from the installer's paperwork; never guessed from the gateway",
|
|
207
|
+
"type": "number",
|
|
208
|
+
"exclusiveMinimum": 0
|
|
209
|
+
},
|
|
210
|
+
"id": {
|
|
211
|
+
"type": "string"
|
|
212
|
+
},
|
|
213
|
+
"room": {
|
|
214
|
+
"type": "string",
|
|
215
|
+
"format": "starts_with",
|
|
216
|
+
"pattern": "^room-.*"
|
|
217
|
+
},
|
|
218
|
+
"name": {
|
|
219
|
+
"type": "string"
|
|
220
|
+
}
|
|
221
|
+
},
|
|
222
|
+
"required": [
|
|
223
|
+
"connector",
|
|
224
|
+
"host",
|
|
225
|
+
"token",
|
|
226
|
+
"id"
|
|
227
|
+
],
|
|
228
|
+
"additionalProperties": {}
|
|
229
|
+
},
|
|
230
|
+
{
|
|
231
|
+
"type": "object",
|
|
232
|
+
"properties": {
|
|
233
|
+
"connector": {
|
|
234
|
+
"type": "string",
|
|
235
|
+
"const": "amber"
|
|
236
|
+
},
|
|
237
|
+
"key": {
|
|
238
|
+
"type": "string",
|
|
239
|
+
"pattern": "^[A-Z_][A-Z0-9_]*$",
|
|
240
|
+
"description": "env name holding the Amber API key"
|
|
241
|
+
},
|
|
242
|
+
"siteId": {
|
|
243
|
+
"description": "the site; the first active one when left out",
|
|
244
|
+
"type": "string"
|
|
245
|
+
},
|
|
246
|
+
"id": {
|
|
247
|
+
"type": "string"
|
|
248
|
+
},
|
|
249
|
+
"room": {
|
|
250
|
+
"type": "string",
|
|
251
|
+
"format": "starts_with",
|
|
252
|
+
"pattern": "^room-.*"
|
|
253
|
+
},
|
|
254
|
+
"name": {
|
|
255
|
+
"type": "string"
|
|
256
|
+
}
|
|
257
|
+
},
|
|
258
|
+
"required": [
|
|
259
|
+
"connector",
|
|
260
|
+
"key",
|
|
261
|
+
"id"
|
|
262
|
+
],
|
|
263
|
+
"additionalProperties": {}
|
|
264
|
+
},
|
|
265
|
+
{
|
|
266
|
+
"type": "object",
|
|
267
|
+
"properties": {
|
|
268
|
+
"connector": {
|
|
269
|
+
"type": "string",
|
|
270
|
+
"const": "up"
|
|
271
|
+
},
|
|
272
|
+
"key": {
|
|
273
|
+
"type": "string",
|
|
274
|
+
"pattern": "^[A-Z_][A-Z0-9_]*$",
|
|
275
|
+
"description": "env name holding the Up personal access token"
|
|
276
|
+
},
|
|
277
|
+
"account": {
|
|
278
|
+
"description": "which accounts to read, by type and ownership; every account when left out",
|
|
279
|
+
"type": "object",
|
|
280
|
+
"properties": {
|
|
281
|
+
"accountType": {
|
|
282
|
+
"type": "string",
|
|
283
|
+
"enum": [
|
|
284
|
+
"TRANSACTIONAL",
|
|
285
|
+
"SAVER",
|
|
286
|
+
"HOME_LOAN"
|
|
287
|
+
]
|
|
288
|
+
},
|
|
289
|
+
"ownershipType": {
|
|
290
|
+
"type": "string",
|
|
291
|
+
"enum": [
|
|
292
|
+
"INDIVIDUAL",
|
|
293
|
+
"JOINT"
|
|
294
|
+
]
|
|
295
|
+
}
|
|
296
|
+
}
|
|
297
|
+
},
|
|
298
|
+
"household": {
|
|
299
|
+
"description": "what counts as the household's: Up category ids (a parent takes in its children, e.g. home) and tag labels; everything when left out",
|
|
300
|
+
"type": "object",
|
|
301
|
+
"properties": {
|
|
302
|
+
"categories": {
|
|
303
|
+
"type": "array",
|
|
304
|
+
"items": {
|
|
305
|
+
"type": "string"
|
|
306
|
+
}
|
|
307
|
+
},
|
|
308
|
+
"tags": {
|
|
309
|
+
"type": "array",
|
|
310
|
+
"items": {
|
|
311
|
+
"type": "string"
|
|
312
|
+
}
|
|
313
|
+
}
|
|
314
|
+
}
|
|
315
|
+
},
|
|
316
|
+
"id": {
|
|
317
|
+
"type": "string"
|
|
318
|
+
},
|
|
319
|
+
"room": {
|
|
320
|
+
"type": "string",
|
|
321
|
+
"format": "starts_with",
|
|
322
|
+
"pattern": "^room-.*"
|
|
323
|
+
},
|
|
324
|
+
"name": {
|
|
325
|
+
"type": "string"
|
|
326
|
+
}
|
|
327
|
+
},
|
|
328
|
+
"required": [
|
|
329
|
+
"connector",
|
|
330
|
+
"key",
|
|
331
|
+
"id"
|
|
332
|
+
],
|
|
333
|
+
"additionalProperties": {}
|
|
334
|
+
},
|
|
335
|
+
{
|
|
336
|
+
"type": "object",
|
|
337
|
+
"properties": {
|
|
338
|
+
"connector": {
|
|
339
|
+
"type": "string",
|
|
340
|
+
"const": "cast"
|
|
341
|
+
},
|
|
342
|
+
"name": {
|
|
343
|
+
"type": "string",
|
|
344
|
+
"description": "the device's or group's name in the Google Home app (mDNS fn), for display; `home discover --write` fills it and refreshes it after a rename"
|
|
345
|
+
},
|
|
346
|
+
"castId": {
|
|
347
|
+
"type": "string",
|
|
348
|
+
"description": "the mDNS id, the stable identity; `home discover --write` fills it"
|
|
349
|
+
},
|
|
350
|
+
"id": {
|
|
351
|
+
"type": "string"
|
|
352
|
+
},
|
|
353
|
+
"room": {
|
|
354
|
+
"type": "string",
|
|
355
|
+
"format": "starts_with",
|
|
356
|
+
"pattern": "^room-.*"
|
|
357
|
+
}
|
|
358
|
+
},
|
|
359
|
+
"required": [
|
|
360
|
+
"connector",
|
|
361
|
+
"name",
|
|
362
|
+
"castId",
|
|
363
|
+
"id"
|
|
364
|
+
],
|
|
365
|
+
"additionalProperties": {}
|
|
366
|
+
},
|
|
367
|
+
{
|
|
368
|
+
"type": "object",
|
|
369
|
+
"properties": {
|
|
370
|
+
"connector": {
|
|
371
|
+
"type": "string",
|
|
372
|
+
"const": "printers"
|
|
373
|
+
},
|
|
374
|
+
"name": {
|
|
375
|
+
"type": "string",
|
|
376
|
+
"description": "the printer's name for display (mDNS `ty`, or its instance name); `home discover --write` fills it"
|
|
377
|
+
},
|
|
378
|
+
"uuid": {
|
|
379
|
+
"type": "string",
|
|
380
|
+
"description": "the printer's UUID from its mDNS TXT record, the stable identity; `home discover --write` fills it"
|
|
381
|
+
},
|
|
382
|
+
"host": {
|
|
383
|
+
"description": "the address it last answered at; discovery refreshes it",
|
|
384
|
+
"type": "string"
|
|
385
|
+
},
|
|
386
|
+
"port": {
|
|
387
|
+
"description": "its IPP port (631 plain, 443 TLS); discovery fills it",
|
|
388
|
+
"type": "integer",
|
|
389
|
+
"minimum": 1,
|
|
390
|
+
"maximum": 65535
|
|
391
|
+
},
|
|
392
|
+
"offlineDays": {
|
|
393
|
+
"description": "days an unreachable printer shows as offline with its last-seen time before its entry flags it as long gone; default 14",
|
|
394
|
+
"type": "number",
|
|
395
|
+
"exclusiveMinimum": 0
|
|
396
|
+
},
|
|
397
|
+
"id": {
|
|
398
|
+
"type": "string"
|
|
399
|
+
},
|
|
400
|
+
"room": {
|
|
401
|
+
"type": "string",
|
|
402
|
+
"format": "starts_with",
|
|
403
|
+
"pattern": "^room-.*"
|
|
404
|
+
}
|
|
405
|
+
},
|
|
406
|
+
"required": [
|
|
407
|
+
"connector",
|
|
408
|
+
"name",
|
|
409
|
+
"uuid",
|
|
410
|
+
"id"
|
|
411
|
+
],
|
|
412
|
+
"additionalProperties": {}
|
|
413
|
+
},
|
|
414
|
+
{
|
|
415
|
+
"type": "object",
|
|
416
|
+
"properties": {
|
|
417
|
+
"connector": {
|
|
418
|
+
"type": "string",
|
|
419
|
+
"const": "spotify"
|
|
420
|
+
},
|
|
421
|
+
"url": {
|
|
422
|
+
"description": "Soloist's WebSocket, as its --ws flag opens it; ws://127.0.0.1:9091 when left out. It has no auth: keep it on loopback",
|
|
423
|
+
"type": "string",
|
|
424
|
+
"format": "uri"
|
|
425
|
+
},
|
|
426
|
+
"maxVolume": {
|
|
427
|
+
"description": "the loudest a write may set (0–100), and where a first play that starts above it is lowered to (Soloist issue #23)",
|
|
428
|
+
"type": "integer",
|
|
429
|
+
"minimum": 0,
|
|
430
|
+
"maximum": 100
|
|
431
|
+
},
|
|
432
|
+
"repairStalls": {
|
|
433
|
+
"description": "when playback stalls while Soloist says playing (Soloist issue #5), try once per track to restart it: a seek, then pause and play, or a skip when it is stuck past the track's end. Off unless set",
|
|
434
|
+
"type": "boolean"
|
|
435
|
+
},
|
|
436
|
+
"id": {
|
|
437
|
+
"type": "string"
|
|
438
|
+
},
|
|
439
|
+
"room": {
|
|
440
|
+
"type": "string",
|
|
441
|
+
"format": "starts_with",
|
|
442
|
+
"pattern": "^room-.*"
|
|
443
|
+
},
|
|
444
|
+
"name": {
|
|
445
|
+
"type": "string"
|
|
446
|
+
}
|
|
447
|
+
},
|
|
448
|
+
"required": [
|
|
449
|
+
"connector",
|
|
450
|
+
"id"
|
|
451
|
+
],
|
|
452
|
+
"additionalProperties": {}
|
|
453
|
+
}
|
|
454
|
+
]
|
|
455
|
+
}
|
|
456
|
+
},
|
|
457
|
+
"plan": {
|
|
458
|
+
"description": "the drawing, by path relative to this file",
|
|
459
|
+
"type": "object",
|
|
460
|
+
"properties": {
|
|
461
|
+
"svg": {
|
|
462
|
+
"type": "string",
|
|
463
|
+
"minLength": 1
|
|
464
|
+
},
|
|
465
|
+
"json": {
|
|
466
|
+
"type": "string",
|
|
467
|
+
"minLength": 1
|
|
468
|
+
}
|
|
469
|
+
},
|
|
470
|
+
"additionalProperties": {}
|
|
471
|
+
}
|
|
472
|
+
},
|
|
473
|
+
"additionalProperties": {}
|
|
474
|
+
}
|
package/llms.txt
ADDED
|
@@ -0,0 +1,32 @@
|
|
|
1
|
+
# home.ts
|
|
2
|
+
|
|
3
|
+
> Small, typed home automation for TypeScript, published on npm as `@khalido/home`, with a `home` command. It starts with one home's devices: Philips Hue, a Daikin AC, Enphase solar, Google Cast, AirPrint printers and a Spotify Soloist speaker on the local network; Amber Electric prices, Up Bank spending and the weather from the cloud. Runs on Bun 1.4+ and Node 24+; the CLI needs Bun. MIT.
|
|
4
|
+
|
|
5
|
+
The library never reads the environment or a file: callers pass addresses, keys and a `fetch`. `createHome` runs integrations and keeps one typed snapshot; `loadHome` builds them from a home config that names env vars, never secrets. Every field a device reports is optional, and odd readings pass through in `anomaly` rather than being corrected. Writes go through a per-device lane: spaced, bursts merged.
|
|
6
|
+
|
|
7
|
+
## Start here
|
|
8
|
+
|
|
9
|
+
- [README](https://raw.githubusercontent.com/khalido/home.ts/main/README.md): what it is, install, the connectors
|
|
10
|
+
- [Using it from an app](https://raw.githubusercontent.com/khalido/home.ts/main/docs/using.md): createHome, loadHome, health, change events, writes, energy
|
|
11
|
+
- [The home config](https://raw.githubusercontent.com/khalido/home.ts/main/docs/config.md): devices by identity, rooms, discovery
|
|
12
|
+
- [The home command](https://raw.githubusercontent.com/khalido/home.ts/main/docs/cli.md): status, probe, discover, per-connector verbs
|
|
13
|
+
- [Agent skill: use-home](https://raw.githubusercontent.com/khalido/home.ts/main/skills/use-home/SKILL.md): reading safely, connecting, the rules for writes
|
|
14
|
+
|
|
15
|
+
## Connectors
|
|
16
|
+
|
|
17
|
+
- [hue](https://raw.githubusercontent.com/khalido/home.ts/main/src/connectors/hue/README.md): lights, rooms, scenes over the bridge's event stream
|
|
18
|
+
- [daikin](https://raw.githubusercontent.com/khalido/home.ts/main/src/connectors/daikin/README.md): the AC over its local API
|
|
19
|
+
- [enphase](https://raw.githubusercontent.com/khalido/home.ts/main/src/connectors/enphase/README.md): solar from the IQ Gateway
|
|
20
|
+
- [cast](https://raw.githubusercontent.com/khalido/home.ts/main/src/connectors/cast/README.md): Cast devices and groups, volume, announcements
|
|
21
|
+
- [printers](https://raw.githubusercontent.com/khalido/home.ts/main/src/connectors/printers/README.md): AirPrint printers over IPP
|
|
22
|
+
- [spotify](https://raw.githubusercontent.com/khalido/home.ts/main/src/connectors/spotify/README.md): a Spotify Soloist speaker: state, confirmed writes, duck and interrupt, change events, stall watch
|
|
23
|
+
- [amber](https://raw.githubusercontent.com/khalido/home.ts/main/src/connectors/amber/README.md): live electricity prices and forecast
|
|
24
|
+
- [up](https://raw.githubusercontent.com/khalido/home.ts/main/src/connectors/up/README.md): household spending by category
|
|
25
|
+
- [weather](https://raw.githubusercontent.com/khalido/home.ts/main/src/connectors/weather/README.md): BOM, Open-Meteo and Google; hourly, day blocks, rain soon
|
|
26
|
+
|
|
27
|
+
## Optional
|
|
28
|
+
|
|
29
|
+
- [Why it is shaped this way](https://raw.githubusercontent.com/khalido/home.ts/main/docs/philosophy.md)
|
|
30
|
+
- [Decisions](https://raw.githubusercontent.com/khalido/home.ts/main/docs/decisions.md): what was decided and why, newest last
|
|
31
|
+
- [Adding a connector](https://raw.githubusercontent.com/khalido/home.ts/main/AGENTS.md)
|
|
32
|
+
- [Changelog](https://raw.githubusercontent.com/khalido/home.ts/main/CHANGELOG.md)
|
package/package.json
CHANGED
|
@@ -1,6 +1,145 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@khalido/home",
|
|
3
|
-
"version": "0.
|
|
4
|
-
"
|
|
5
|
-
"
|
|
6
|
-
|
|
3
|
+
"version": "0.1.1",
|
|
4
|
+
"description": "home.ts: small, typed home automation for TypeScript: Hue, Daikin, Enphase, Google Cast, AirPrint printers and a Spotify Soloist speaker on the local network; Amber prices, Up Bank spending and the weather from the cloud.",
|
|
5
|
+
"license": "MIT",
|
|
6
|
+
"author": "Khalid Omar",
|
|
7
|
+
"repository": {
|
|
8
|
+
"type": "git",
|
|
9
|
+
"url": "git+https://github.com/khalido/home.ts.git"
|
|
10
|
+
},
|
|
11
|
+
"homepage": "https://github.com/khalido/home.ts#readme",
|
|
12
|
+
"bugs": "https://github.com/khalido/home.ts/issues",
|
|
13
|
+
"keywords": [
|
|
14
|
+
"philips-hue",
|
|
15
|
+
"hue",
|
|
16
|
+
"enphase",
|
|
17
|
+
"envoy",
|
|
18
|
+
"daikin",
|
|
19
|
+
"home-automation",
|
|
20
|
+
"bun",
|
|
21
|
+
"amber-electric",
|
|
22
|
+
"weather",
|
|
23
|
+
"chromecast",
|
|
24
|
+
"google-cast",
|
|
25
|
+
"bom",
|
|
26
|
+
"airprint",
|
|
27
|
+
"ipp",
|
|
28
|
+
"printer",
|
|
29
|
+
"spotify",
|
|
30
|
+
"spotify-connect",
|
|
31
|
+
"up-bank"
|
|
32
|
+
],
|
|
33
|
+
"engines": {
|
|
34
|
+
"bun": ">=1.4",
|
|
35
|
+
"node": ">=24"
|
|
36
|
+
},
|
|
37
|
+
"type": "module",
|
|
38
|
+
"exports": {
|
|
39
|
+
".": {
|
|
40
|
+
"types": "./dist/index.d.ts",
|
|
41
|
+
"import": "./dist/index.js"
|
|
42
|
+
},
|
|
43
|
+
"./hue": {
|
|
44
|
+
"types": "./dist/connectors/hue/index.d.ts",
|
|
45
|
+
"import": "./dist/connectors/hue/index.js"
|
|
46
|
+
},
|
|
47
|
+
"./daikin": {
|
|
48
|
+
"types": "./dist/connectors/daikin/index.d.ts",
|
|
49
|
+
"import": "./dist/connectors/daikin/index.js"
|
|
50
|
+
},
|
|
51
|
+
"./enphase": {
|
|
52
|
+
"types": "./dist/connectors/enphase/index.d.ts",
|
|
53
|
+
"import": "./dist/connectors/enphase/index.js"
|
|
54
|
+
},
|
|
55
|
+
"./amber": {
|
|
56
|
+
"types": "./dist/connectors/amber/index.d.ts",
|
|
57
|
+
"import": "./dist/connectors/amber/index.js"
|
|
58
|
+
},
|
|
59
|
+
"./up": {
|
|
60
|
+
"types": "./dist/connectors/up/index.d.ts",
|
|
61
|
+
"import": "./dist/connectors/up/index.js"
|
|
62
|
+
},
|
|
63
|
+
"./weather": {
|
|
64
|
+
"types": "./dist/connectors/weather/index.d.ts",
|
|
65
|
+
"import": "./dist/connectors/weather/index.js"
|
|
66
|
+
},
|
|
67
|
+
"./weather/ftp": {
|
|
68
|
+
"types": "./dist/connectors/weather/ftp.d.ts",
|
|
69
|
+
"import": "./dist/connectors/weather/ftp.js"
|
|
70
|
+
},
|
|
71
|
+
"./cast": {
|
|
72
|
+
"types": "./dist/connectors/cast/index.d.ts",
|
|
73
|
+
"import": "./dist/connectors/cast/index.js"
|
|
74
|
+
},
|
|
75
|
+
"./printers": {
|
|
76
|
+
"types": "./dist/connectors/printers/index.d.ts",
|
|
77
|
+
"import": "./dist/connectors/printers/index.js"
|
|
78
|
+
},
|
|
79
|
+
"./spotify": {
|
|
80
|
+
"types": "./dist/connectors/spotify/index.d.ts",
|
|
81
|
+
"import": "./dist/connectors/spotify/index.js"
|
|
82
|
+
},
|
|
83
|
+
"./cast/tls": {
|
|
84
|
+
"types": "./dist/connectors/cast/tls.d.ts",
|
|
85
|
+
"import": "./dist/connectors/cast/tls.js"
|
|
86
|
+
},
|
|
87
|
+
"./cast/serve": {
|
|
88
|
+
"types": "./dist/connectors/cast/serve.d.ts",
|
|
89
|
+
"import": "./dist/connectors/cast/serve.js"
|
|
90
|
+
},
|
|
91
|
+
"./node": {
|
|
92
|
+
"types": "./dist/node-fetch.d.ts",
|
|
93
|
+
"import": "./dist/node-fetch.js"
|
|
94
|
+
},
|
|
95
|
+
"./finders": {
|
|
96
|
+
"types": "./dist/finders-entry.d.ts",
|
|
97
|
+
"import": "./dist/finders-entry.js"
|
|
98
|
+
}
|
|
99
|
+
},
|
|
100
|
+
"bin": {
|
|
101
|
+
"home": "src/cli/main.ts"
|
|
102
|
+
},
|
|
103
|
+
"files": [
|
|
104
|
+
"CHANGELOG.md",
|
|
105
|
+
"LICENSE",
|
|
106
|
+
"README.md",
|
|
107
|
+
"llms.txt",
|
|
108
|
+
".env.example",
|
|
109
|
+
"dist",
|
|
110
|
+
"docs",
|
|
111
|
+
"!docs/handover.md",
|
|
112
|
+
"!docs/publishing.md",
|
|
113
|
+
"examples",
|
|
114
|
+
"skills",
|
|
115
|
+
"src",
|
|
116
|
+
"home.schema.json"
|
|
117
|
+
],
|
|
118
|
+
"sideEffects": false,
|
|
119
|
+
"publishConfig": {
|
|
120
|
+
"access": "public"
|
|
121
|
+
},
|
|
122
|
+
"scripts": {
|
|
123
|
+
"test": "bun test",
|
|
124
|
+
"check": "bun fmt --check && bun check --no-script && bun check --no-script -p tsconfig.build.json && bun check --no-script -p tsconfig.node.json",
|
|
125
|
+
"build": "rm -rf dist && tsc -p tsconfig.build.json && tsc -p tsconfig.node.json",
|
|
126
|
+
"bench": "bun bench/bench.ts",
|
|
127
|
+
"prepublishOnly": "bun run check && bun test && bun run build",
|
|
128
|
+
"schema": "bun scripts/schema.ts",
|
|
129
|
+
"gen": "bun scripts/gen.ts"
|
|
130
|
+
},
|
|
131
|
+
"dependencies": {
|
|
132
|
+
"basic-ftp": "^6.2.3",
|
|
133
|
+
"cac": "^7.1.0",
|
|
134
|
+
"fast-xml-parser": "^5.11.2",
|
|
135
|
+
"jsonc-parser": "^3.3.1",
|
|
136
|
+
"suncalc": "^2.1.1",
|
|
137
|
+
"undici": "^8.12.3",
|
|
138
|
+
"zod": "^4.6.7"
|
|
139
|
+
},
|
|
140
|
+
"devDependencies": {
|
|
141
|
+
"@types/bun": "^1.4.4",
|
|
142
|
+
"mitata": "^1.0.34",
|
|
143
|
+
"typescript": "^7.0.2"
|
|
144
|
+
}
|
|
145
|
+
}
|