|
Bogdan Timofte
authored
2 weeks ago
|
1
|
# Node-RED Custom Nodes
|
|
|
2
|
|
|
|
3
|
## Repository layout
|
|
|
4
|
|
|
|
5
|
Adaptoarele sunt grupate in folderul `adapters/`, separat de celelalte noduri custom din workspace.
|
|
|
6
|
|
|
|
7
|
Nodurile care nu sunt adaptoare raman la radacina, de exemplu:
|
|
|
8
|
|
|
|
9
|
- `msg-status`
|
|
|
10
|
- `presence-detector`
|
|
|
11
|
|
|
|
12
|
In interiorul `adapters/`, adaptoarele sunt organizate pe tip de device, nu pe model.
|
|
|
13
|
|
|
|
14
|
Structura standard pentru un device type este:
|
|
|
15
|
|
|
|
16
|
- `adapters/<device-type>/homebus-adapter`
|
|
|
17
|
- `adapters/<device-type>/homekit-adapter`
|
|
|
18
|
- `adapters/<device-type>/energy-adapter` atunci cand exista telemetrie energetica dedicata
|
|
|
19
|
- `adapters/<device-type>/models` pentru documentatie sau note per model
|
|
|
20
|
|
|
|
21
|
Exemple curente:
|
|
|
22
|
|
|
|
23
|
- `adapters/smart-socket/...`
|
|
|
24
|
- `adapters/contact-sensor/...`
|
|
|
25
|
- `adapters/water-leak-sensor/...`
|
|
|
26
|
- `adapters/smoke-detector/...`
|
|
|
27
|
- `adapters/presence-sensor/...`
|
|
|
28
|
|
|
|
29
|
Scopul acestei structuri este sa permitem mai multe modele Zigbee sub acelasi tip de device, fara sa mai multiplicam layout-ul proiectului la nivel de folder radacina.
|
|
|
30
|
|
|
|
31
|
## Deploy targets
|
|
|
32
|
|
|
|
33
|
SSH target-urile folosite pentru deploy din acest workspace sunt:
|
|
|
34
|
|
|
|
35
|
- `testing`: `node-red@192.168.2.104`
|
|
|
36
|
- `production`: `node-red@192.168.2.101`
|
|
|
37
|
- `legacy`: `pi@192.168.2.133`
|
|
|
38
|
|
|
|
39
|
Verificate prin SSH la data de `2026-03-11`.
|
|
|
40
|
|
|
|
41
|
## Service control
|
|
|
42
|
|
|
|
43
|
Pe `testing` și `production`, user-ul `node-red` poate controla direct serviciul Node-RED, fără `sudo`:
|
|
|
44
|
|
|
|
45
|
```bash
|
|
|
46
|
systemctl restart node-red
|
|
|
47
|
systemctl is-active node-red
|
|
|
48
|
```
|
|
|
49
|
|
|
|
50
|
Numele unității de serviciu este:
|
|
|
51
|
|
|
|
52
|
```bash
|
|
|
53
|
node-red.service
|
|
|
54
|
```
|
|
|
55
|
|
|
|
56
|
## Notes
|
|
|
57
|
|
|
|
58
|
- `deploy.sh` folosește implicit target-ul de `testing`.
|
|
|
59
|
- `deploy.sh` accepta cai relative de forma `adapters/device-type/adapter`, de exemplu `adapters/smart-socket/homebus-adapter`.
|
|
|
60
|
- Pentru hosturile `testing` și `production`, user-ul SSH folosit efectiv este `node-red`.
|
|
|
61
|
- După deploy pe `testing` și `production`, restart-ul standard este `systemctl restart node-red`.
|
|
|
62
|
- Hostul `legacy` rămâne accesat cu user-ul `pi`.
|
|
|
63
|
- `legacy` este în curs de dezafectare.
|
|
|
64
|
- Nu se face deploy pe `legacy` decât în situații speciale.
|
|
|
65
|
|
|
|
66
|
## Current verification
|
|
|
67
|
|
|
|
68
|
Verificat la data de `2026-03-11`:
|
|
|
69
|
|
|
|
70
|
- `testing` `192.168.2.104`: restart-ul `node-red` funcționează direct ca user `node-red`
|
|
|
71
|
- `production` `192.168.2.101`: restart-ul `node-red` funcționează direct ca user `node-red`
|
|
|
72
|
- `production` rulează `node-red-contrib-z2m-zg-204zv-homebus@0.0.20`
|
|
|
73
|
|
|
|
74
|
## Additional documentation
|
|
|
75
|
|
|
|
76
|
Documentația detaliată pentru adaptoarele HomeKit și integrarea cu `node-red-contrib-homekit-bridged` este în:
|
|
|
77
|
|
|
|
78
|
- [.doc/homekit-adapter-development-guide.md](/Users/bogdan/Documents/Workspaces/Home/NodeRed/myNodes/.doc/homekit-adapter-development-guide.md)
|