smart-home-engine 0.14.0 → 0.16.0
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/README.md +14 -10
- package/dist/web/assets/index-Cqfuxa_i.js +220 -0
- package/dist/web/assets/index-DcqBg4oJ.css +1 -0
- package/dist/web/assets/{monaco-langs-DZ6hB11b.js → monaco-langs-Decdf6BV.js} +1 -1
- package/dist/web/assets/{tsMode-BcZhguVQ.js → tsMode-B7q_C6Fy.js} +1 -1
- package/dist/web/index.html +3 -3
- package/package.json +1 -1
- package/src/index.js +94 -76
- package/src/matter/controller.js +107 -17
- package/src/web/ai-api.js +65 -26
- package/src/web/ai-context.js +15 -38
- package/src/web/ai-tools.js +160 -13
- package/src/web/deps-api.js +32 -1
- package/src/web/matter-api.js +2 -2
- package/src/web/prompts/scripts-base.md +7 -0
- package/src/web/prompts/she-api-ref.md +17 -0
- package/src/web/scripts-api.js +0 -1
- package/src/web/server.js +3 -1
- package/src/web/shedb-api.js +1 -1
- package/src/web/shedb.js +2 -6
- package/dist/web/assets/index-BcOZhXqD.css +0 -1
- package/dist/web/assets/index-oMmhHXuR.js +0 -220
package/README.md
CHANGED
|
@@ -3,18 +3,21 @@
|
|
|
3
3
|
[![License][mit-badge]][mit-url]
|
|
4
4
|
|
|
5
5
|
> [!WARNING]
|
|
6
|
-
> **This project is under heavy development
|
|
6
|
+
> **This project is under heavy development.** The API is changing frequently and there are no stability guarantees yet.
|
|
7
7
|
|
|
8
8
|
Your home, your rules - written in plain JavaScript.
|
|
9
9
|
|
|
10
10
|
**she** is a Node.js daemon that loads your `.js` scripts into a sandboxed VM and wires them up to MQTT, Matter, and everything else your smart home throws at them. No cloud, no lock-in, no YAML sprawl, no opinionated bloated schemata. Just scripts that do exactly what you (if you want: with the help of the integrated AI assisstant) tell them.
|
|
11
11
|
|
|
12
|
-
- **Scripts** — Monaco-based Script IDE, AI assistant, git integration, autocompletion,
|
|
12
|
+
- **Scripts** — Monaco-based Script IDE, AI assistant, git integration, autocompletion, hot-reload without process restart
|
|
13
13
|
- **MQTT** — subscribe, publish, react to state changes with wildcards, conditions, and delays
|
|
14
|
-
- **Matter** —
|
|
15
|
-
- **sheDB** —
|
|
14
|
+
- **Matter** — control Matter devices directly from your scripts
|
|
15
|
+
- **sheDB** — lightweight document store with map/reduce views, right in the daemon
|
|
16
16
|
- **Scheduler** — cron expressions and solar events (`sunrise`, `sunset`, …) in one call
|
|
17
|
-
- **
|
|
17
|
+
- **Script HTTP routes** — scripts can register their own REST endpoints under `/api/<scriptName>/`
|
|
18
|
+
- **`require()`** — load npm packages from `~/.she/node_modules/` or relative files inside scripts
|
|
19
|
+
- Supports **InfluxDB**, **Elasticsearch** and **Redis** — convenience methods for time series, full text indexing, shared states across multiple she instances
|
|
20
|
+
- **Web UI** — script editor, package manager, MQTT browser, Matter device manager, sheDB frontend, log viewer
|
|
18
21
|
|
|
19
22
|
## Motivation
|
|
20
23
|
|
|
@@ -40,6 +43,7 @@ The goal is simple: a smart home that remains understandable years later. No mig
|
|
|
40
43
|
| [HTTP API](doc/http-api.md) | REST endpoints and WebSocket |
|
|
41
44
|
| [sheDB](doc/db/README.md) | Embedded document store — script API, views, examples |
|
|
42
45
|
| [Examples](doc/examples.md) | Real-world script patterns |
|
|
46
|
+
| [Screenshots](doc/screenshots.md) | Web UI screenshots |
|
|
43
47
|
|
|
44
48
|
## Quick look
|
|
45
49
|
|
|
@@ -47,13 +51,13 @@ The goal is simple: a smart home that remains understandable years later. No mig
|
|
|
47
51
|
// lights.js
|
|
48
52
|
|
|
49
53
|
// Follow a motion sensor
|
|
50
|
-
she.mqtt.sub('home
|
|
51
|
-
she.mqtt.set('home
|
|
54
|
+
she.mqtt.sub('home/hall/motion', { change: true }, (topic, val) => {
|
|
55
|
+
she.mqtt.set('home/hall/light', val);
|
|
52
56
|
});
|
|
53
57
|
|
|
54
58
|
// Solar schedule — no hardcoded times
|
|
55
|
-
she.schedule('sunset', () => she.mqtt.set('home
|
|
56
|
-
she.schedule('sunrise', () => she.mqtt.set('home
|
|
59
|
+
she.schedule('sunset', () => she.mqtt.set('home/lights/outdoor', 1));
|
|
60
|
+
she.schedule('sunrise', () => she.mqtt.set('home/lights/outdoor', 0));
|
|
57
61
|
|
|
58
62
|
// Keep device metadata in sheDB
|
|
59
63
|
she.db.set('hall/motion', { name: 'Hall PIR', location: 'hall' });
|
|
@@ -66,7 +70,7 @@ npm install -g smart-home-engine
|
|
|
66
70
|
she
|
|
67
71
|
```
|
|
68
72
|
|
|
69
|
-
Then open **http://localhost:8080** and start
|
|
73
|
+
Then open **http://localhost:8080** and start creating scripts
|
|
70
74
|
|
|
71
75
|
## License
|
|
72
76
|
|