homebridge-homeassistant-garagedoor 1.1.2 → 1.1.4

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.
Files changed (3) hide show
  1. package/README.md +141 -18
  2. package/index.js +4 -0
  3. package/package.json +1 -1
package/README.md CHANGED
@@ -1,30 +1,153 @@
1
- # Homebridge Home Assistant Garage Door
1
+ Features
2
+ ✅ Native Garage Door in Home app + Siri
2
3
 
3
- Control **Home Assistant switches** as **Garage Door accessories** in HomeKit.
4
+ Config UI X form (no JSON editing)
4
5
 
5
- ## Quick Start
6
+ Bidirectional sync (Home app ↔ Home Assistant)
6
7
 
8
+ ✅ Auto-close after OPEN (3s)
9
+
10
+ ✅ Real-time polling (30s default)
11
+
12
+ ✅ Error 400 fixed (no redundant requests)
13
+
14
+ 📦 Installation
15
+ bash
16
+ npm install -g homebridge-homeassistant-garagedoor
17
+ ⚙️ Configuration (Config UI X)
18
+ text
19
+ Plugins → HA Garage Door → ADD NEW (+)
20
+
21
+ ✅ Name: Puerta1 HA
22
+ ✅ HA URL: http://192.168.68.239:8123
23
+ ✅ HA Token: eyJhbGciOiJIUzI1NiIs... (Long-Lived Access Token)
24
+ ✅ Entity ID: switch.Puerta1
25
+ ✅ Poll Interval: 30 (seconds)
26
+ [SAVE] ✓
27
+ 🔑 Home Assistant Long-Lived Access Token
28
+ HA → User Profile (👤 bottom-left)
29
+
30
+ Long-Lived Access Tokens → Create Token
31
+
32
+ Name: Homebridge Garage Door
33
+
34
+ Copy token → Paste in Config UI X
35
+
36
+ Token expires: Never (unless revoked)
37
+
38
+ 📱 Home App Behavior
39
+ text
40
+ ✅ Initial: CERRADA
41
+ ✅ Tap → OPEN (3s) → Auto CLOSE
42
+ ✅ Siri: "Open/close Puerta1 HA"
43
+ ✅ Status: Real-time sync via polling
44
+ 🛠️ Manual config.json
45
+ json
7
46
  {
8
- "accessory": "HomeAssistantGarageDoor",
9
- "name": "Garage Door",
10
- "haUrl": "http://192.168.68.239:8123",
11
- "haToken": "your_long_lived_token",
12
- "entityId": "switch.Puerta1"
47
+ "accessory": "HomeAssistantGarageDoor",
48
+ "name": "Puerta1 HA",
49
+ "haUrl": "http://192.168.68.239:8123",
50
+ "haToken": "eyJhbGciOiJIUzI1NiIs...",
51
+ "entityId": "switch.Puerta1",
52
+ "pollInterval": 30
13
53
  }
14
-
54
+ 🔍 Logs
15
55
  text
56
+ [Puerta1 HA] Initialized - HA: http://192.168.68.239:8123 (switch.Puerta1)
57
+ [Puerta1 HA] Target state: OPEN
58
+ [Puerta1 HA] HA turn_on → 200: []
59
+ [Puerta1 HA] Auto-close en 3s...
60
+ [Puerta1 HA] Target state: CLOSED
61
+ [Puerta1 HA] HA turn_off → 200: []
62
+ [Puerta1 HA] Poll: CLOSED (off)
63
+ 🚀 Development
64
+ bash
65
+ cd ~/github/homebridge-homeassistant-garagedoor
66
+ npm version patch
67
+ git add .
68
+ git commit -m "vX.X.X: Update"
69
+ git push
70
+ npm publish --access public
71
+ ESPAÑOL
72
+ 🚪 homebridge-homeassistant-garagedoor
73
+ Plugin Homebridge para controlar switches de Home Assistant como puertas de garaje nativas en HomeKit.
16
74
 
17
- ## Features
18
- - Converts HA `switch` HomeKit `GarageDoorOpener`
19
- - ✅ Always starts **CLOSED** (safe default)
20
- - ✅ Uses HA REST API (`switch.turn_on/off`)
21
- - ✅ Full Config UI X support
22
- - ✅ Works with Docker/Homebridge
75
+ Características
76
+ Puerta de garaje nativa en app Home + Siri
23
77
 
24
- ## Installation
25
- npm install -g homebridge-homeassistant-garagedoor
78
+ Config UI X con formulario automático
26
79
 
80
+ ✅ Sincronización bidireccional (Home ↔ HA)
81
+
82
+ ✅ Auto-cierre tras OPEN (3 segundos)
83
+
84
+ ✅ Polling en tiempo real (30s por defecto)
85
+
86
+ ✅ Error 400 solucionado (sin peticiones redundantes)
87
+
88
+ 📦 Instalación
89
+ bash
90
+ npm install -g homebridge-homeassistant-garagedoor
91
+ ⚙️ Configuración (Config UI X)
27
92
  text
93
+ Plugins → HA Garage Door → NUEVO (+)
94
+
95
+ ✅ Nombre: Puerta1 HA
96
+ ✅ URL HA: http://192.168.68.239:8123
97
+ ✅ Token HA: eyJhbGciOiJIUzI1NiIs... (Long-Lived Access Token)
98
+ ✅ Entity ID: switch.Puerta1
99
+ ✅ Intervalo Poll: 30 (segundos)
100
+ [GUARDAR] ✓
101
+ 🔑 Token Long-Lived Home Assistant
102
+ HA → Perfil Usuario (👤 abajo-izquierda)
103
+
104
+ Long-Lived Access Tokens → Crear Token
28
105
 
29
- [Full docs](https://github.com/yago/homebridge-homeassistant-garagedoor)
106
+ Nombre: Homebridge Puerta Garaje
107
+
108
+ Copiar token → Pegar en Config UI X
109
+
110
+ Token caduca: Nunca (salvo revocación manual)
111
+
112
+ 📱 Comportamiento App Home
113
+ text
114
+ ✅ Inicio: CERRADA
115
+ ✅ Toca → ABRE (3s) → Auto CIERRA
116
+ ✅ Siri: "Abre/cierra Puerta1 HA"
117
+ ✅ Estado: Sincronización en tiempo real
118
+ 🛠️ config.json manual
119
+ json
120
+ {
121
+ "accessory": "HomeAssistantGarageDoor",
122
+ "name": "Puerta1 HA",
123
+ "haUrl": "http://192.168.68.239:8123",
124
+ "haToken": "eyJhbGciOiJIUzI1NiIs...",
125
+ "entityId": "switch.Puerta1",
126
+ "pollInterval": 30
127
+ }
128
+ 🔍 Logs esperados
129
+ text
130
+ [Puerta1 HA] Initialized - HA: http://192.168.68.239:8123 (switch.Puerta1)
131
+ [Puerta1 HA] Target state: OPEN
132
+ [Puerta1 HA] HA turn_on → 200: []
133
+ [Puerta1 HA] Auto-close en 3s...
134
+ [Puerta1 HA] Target state: CLOSED
135
+ [Puerta1 HA] HA turn_off → 200: []
136
+ [Puerta1 HA] Poll: CLOSED (off)
137
+ 📈 Versiones
138
+ v1.1.3 Auto-close tras OPEN (3s)
139
+ v1.1.2 FIX "Cerrando" → CLOSED
140
+ v1.1.1 UI X alias alignment
141
+ v1.1.0 Config UI X schema inline
142
+ v1.0.9 Full config.schema.json
143
+ 🤝 Contributing
144
+ bash
145
+ git clone https://github.com/torresyago/homebridge-homeassistant-garagedoor.git
146
+ cd homebridge-homeassistant-garagedoor
147
+ npm install
148
+ npm run build # si existe
149
+ 📄 License
150
+ MIT License - see LICENSE
30
151
 
152
+ ⭐ Star this repo if useful!
153
+ ¡Dale estrella si te sirve! 🚪✨
package/index.js CHANGED
@@ -97,6 +97,10 @@ class HomeAssistantGarageDoor {
97
97
  this.log(`[${this.name}] Target state: ${newState}`);
98
98
  this.targetState = newState;
99
99
  this.sendHACommand(newState);
100
+ this.service.setCharacteristic(this.Characteristic.CurrentDoorState,
101
+ newState === 'OPEN' ?
102
+ this.Characteristic.CurrentDoorState.OPEN :
103
+ this.Characteristic.CurrentDoorState.CLOSED);
100
104
  callback();
101
105
  });
102
106
 
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "homebridge-homeassistant-garagedoor",
3
- "version": "1.1.2",
3
+ "version": "1.1.4",
4
4
  "displayName": "HA Garage Door",
5
5
  "description": "Homebridge plugin to control Home Assistant switches as Garage Doors",
6
6
  "main": "index.js",