iobroker.bmw 3.0.1 → 4.0.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/README.md +188 -13
- package/admin/jsonConfig.json +587 -0
- package/io-package.json +68 -32
- package/main.js +737 -1113
- package/package.json +5 -4
- package/admin/index_m.html +0 -181
package/README.md
CHANGED
|
@@ -26,37 +26,212 @@
|
|
|
26
26
|
|
|
27
27
|
# BMW Adapter for ioBroker
|
|
28
28
|
|
|
29
|
-
This adapter
|
|
29
|
+
This adapter integrates BMW vehicles into ioBroker using the new BMW CarData API with OAuth2 authentication and real-time MQTT streaming. It provides comprehensive vehicle data monitoring for all BMW models linked to your BMW account.
|
|
30
30
|
|
|
31
31
|
## Features
|
|
32
32
|
|
|
33
|
-
-
|
|
34
|
-
-
|
|
33
|
+
- **OAuth2 Device Flow Authentication** - Secure authentication without storing credentials
|
|
34
|
+
- **Real-time MQTT Streaming** - Instant updates when vehicle data changes
|
|
35
|
+
- **Comprehensive Data Coverage** - Access to all CarData API endpoints including:
|
|
36
|
+
- Basic vehicle information
|
|
37
|
+
- Charging history and sessions
|
|
38
|
+
- Trip data and efficiency metrics
|
|
39
|
+
- Service demands and vehicle status
|
|
40
|
+
- Location and navigation data
|
|
41
|
+
- **API Quota Management** - Intelligent handling of 50 API calls per 24-hour limit
|
|
42
|
+
- **Automatic State Cleanup** - Removes old vehicle data when vehicles are no longer available
|
|
35
43
|
|
|
36
|
-
##
|
|
44
|
+
## ⚠️ Breaking Changes in v4.0
|
|
37
45
|
|
|
38
|
-
|
|
39
|
-
|
|
40
|
-
|
|
41
|
-
|
|
42
|
-
|
|
43
|
-
|
|
46
|
+
**REMOVED:**
|
|
47
|
+
|
|
48
|
+
- Username/password login (replaced with OAuth2)
|
|
49
|
+
- All remote controls (lock/unlock, climate, charging) - CarData API is read-only
|
|
50
|
+
- Second user support
|
|
51
|
+
- CAPTCHA requirements
|
|
52
|
+
|
|
53
|
+
**ADDED:**
|
|
54
|
+
|
|
55
|
+
- OAuth2 Device Flow authentication
|
|
56
|
+
- Real-time MQTT streaming
|
|
57
|
+
- 50 API calls per 24h quota management
|
|
58
|
+
- Comprehensive data from all CarData endpoints
|
|
59
|
+
|
|
60
|
+
## Setup Instructions
|
|
61
|
+
|
|
62
|
+
### 1. BMW ConnectedDrive Portal Setup
|
|
63
|
+
|
|
64
|
+
1. Visit the BMW ConnectedDrive portal: **https://www.bmw.de/de-de/mybmw/vehicle-overview**
|
|
65
|
+
2. Navigate to the **CarData** section
|
|
66
|
+
3. Generate a new **Client ID**
|
|
67
|
+
4. **Subscribe to both services:**
|
|
68
|
+
- CarData API
|
|
69
|
+
- CarData Streaming
|
|
70
|
+
**CRITICAL**: Click one service and wait 20seconds if you see a error message click again
|
|
71
|
+
|
|
72
|
+
### 2. ⚠️ CRITICAL: Data Descriptors Configuration
|
|
73
|
+
|
|
74
|
+
**YOU MUST MANUALLY SELECT ALL 244 DATA POINTS**
|
|
75
|
+
|
|
76
|
+
After creating your Client ID:
|
|
77
|
+
|
|
78
|
+
1. Go to **CarData > Data Descriptors**
|
|
79
|
+
2. **Select ALL categories** (Vehicle Status, Charging, Trip Data, etc.)
|
|
80
|
+
3. **Manually check ALL 244 individual data points**
|
|
81
|
+
4. Save your configuration
|
|
82
|
+
|
|
83
|
+
**Without selecting all data points, MQTT streaming will not provide complete data!**
|
|
84
|
+
|
|
85
|
+
### 3. Adapter Configuration
|
|
86
|
+
|
|
87
|
+
1. Enter your **Client ID** in the adapter settings
|
|
88
|
+
2. Enter your **CarData Streaming Username** (found in BMW portal under CarData > Streaming section)
|
|
89
|
+
3. Select your vehicle **brand** (BMW, Mini, Toyota Supra)
|
|
90
|
+
4. Set **update interval** (minimum 10 minutes due to API quota)
|
|
91
|
+
5. **Configure API Endpoints** - Select which data to fetch:
|
|
92
|
+
- **Basic Data** ✅ - Essential vehicle information (recommended)
|
|
93
|
+
- **Charging History** ✅ - Charging sessions and history (recommended)
|
|
94
|
+
- **Vehicle State** ✅ - Current vehicle status (recommended)
|
|
95
|
+
- **Charging Profile** - Charging preferences and profiles
|
|
96
|
+
- **Charging Sessions** - Detailed charging session data
|
|
97
|
+
- **Climate Now** - Current climate control status
|
|
98
|
+
- **Destination Information** - Navigation and destination data
|
|
99
|
+
- **Location** - GPS position and location services
|
|
100
|
+
- **Statistics** - Driving statistics and analytics
|
|
101
|
+
6. Configure **VIN ignore list** if needed
|
|
102
|
+
|
|
103
|
+
**💡 Tip:** Only enable endpoints you actually need to conserve your 50 API calls per 24-hour quota. MQTT streaming provides real-time data without using quota.
|
|
104
|
+
|
|
105
|
+
### 4. Authentication Process
|
|
106
|
+
|
|
107
|
+
1. Start the adapter
|
|
108
|
+
2. Check the logs for the OAuth2 authorization URL
|
|
109
|
+
3. Visit the URL and login with your BMW account
|
|
110
|
+
4. Authorize the application
|
|
111
|
+
5. The adapter will automatically continue after authorization
|
|
44
112
|
|
|
45
113
|
## Data Structure
|
|
46
114
|
|
|
47
|
-
Vehicle
|
|
115
|
+
Vehicle data is organized under `bmw.0.VIN.*` where `VIN` represents your Vehicle Identification Number:
|
|
116
|
+
|
|
117
|
+
### Main Folder Structure
|
|
118
|
+
|
|
119
|
+
- **`bmw.0.VIN.api.*`** - API Data (Periodic Updates)
|
|
120
|
+
|
|
121
|
+
- Data fetched via BMW CarData REST API
|
|
122
|
+
- Uses API quota (50 calls per 24 hours)
|
|
123
|
+
- Updated based on configured interval
|
|
124
|
+
- Only includes endpoints you've enabled in settings
|
|
125
|
+
|
|
126
|
+
- **`bmw.0.VIN.stream.*`** - Stream Data (Real-time MQTT)
|
|
127
|
+
- Data received via real-time MQTT streaming
|
|
128
|
+
- No API quota consumption
|
|
129
|
+
- Instant updates when vehicle data changes
|
|
130
|
+
- Includes all 244 configured data points
|
|
131
|
+
|
|
132
|
+
### Available API Endpoints (Configurable)
|
|
133
|
+
|
|
134
|
+
You can enable/disable these endpoints in adapter settings:
|
|
135
|
+
|
|
136
|
+
- `bmw.0.VIN.api.basicData.*` - Vehicle information, model, brand, series ✅ **(Default: Enabled)**
|
|
137
|
+
- `bmw.0.VIN.api.chargingHistory.*` - Charging sessions and history ✅ **(Default: Enabled)**
|
|
138
|
+
- `bmw.0.VIN.api.chargingProfile.*` - Charging preferences and profiles
|
|
139
|
+
- `bmw.0.VIN.api.chargingSessions.*` - Detailed charging session data
|
|
140
|
+
- `bmw.0.VIN.api.climateNow.*` - Climate control status
|
|
141
|
+
- `bmw.0.VIN.api.destinationInformation.*` - Navigation and destination data
|
|
142
|
+
- `bmw.0.VIN.api.location.*` - GPS position and location services
|
|
143
|
+
- `bmw.0.VIN.api.statistics.*` - Driving statistics and analytics
|
|
144
|
+
- `bmw.0.VIN.api.vehicleState.*` - Current vehicle status and conditions ✅ **(Default: Enabled)**
|
|
145
|
+
|
|
146
|
+
### Metadata
|
|
147
|
+
|
|
148
|
+
- `bmw.0.VIN.lastUpdate` - Timestamp of last data update (API or MQTT)
|
|
149
|
+
- `bmw.0.VIN.lastStreamUpdate` - Timestamp of last MQTT stream update
|
|
150
|
+
|
|
151
|
+
## Real-time Updates
|
|
152
|
+
|
|
153
|
+
The adapter receives real-time updates via MQTT streaming when:
|
|
154
|
+
|
|
155
|
+
- Vehicle status changes (doors, windows, lights)
|
|
156
|
+
- Charging status updates
|
|
157
|
+
- Location changes during driving
|
|
158
|
+
- Climate control activation
|
|
159
|
+
- Service notifications
|
|
48
160
|
|
|
49
161
|
## Remote Commands
|
|
50
162
|
|
|
51
|
-
Remote
|
|
163
|
+
⚠️ **Remote controls have been removed in v4.0** as the BMW CarData API is read-only and does not support vehicle commands. For remote control functionality, you would need to use BMW's official mobile app.
|
|
164
|
+
|
|
165
|
+
## Troubleshooting
|
|
166
|
+
|
|
167
|
+
### Authentication Issues (400 Bad Request)
|
|
168
|
+
|
|
169
|
+
If you encounter authentication errors:
|
|
170
|
+
|
|
171
|
+
1. Verify CarData API is activated for your Client ID
|
|
172
|
+
2. Ensure CarData Streaming is enabled
|
|
173
|
+
3. Check that all 244 data points are selected
|
|
174
|
+
4. Consider regenerating your Client ID
|
|
175
|
+
|
|
176
|
+
### No MQTT Data
|
|
52
177
|
|
|
53
|
-
|
|
178
|
+
If you're not receiving real-time updates:
|
|
179
|
+
|
|
180
|
+
1. Verify CarData Streaming is subscribed and active
|
|
181
|
+
2. Ensure all data descriptors (244 points) are selected
|
|
182
|
+
3. Check that your vehicle supports CarData streaming
|
|
183
|
+
4. Restart the adapter after descriptor configuration changes
|
|
184
|
+
|
|
185
|
+
### API Quota Exceeded
|
|
186
|
+
|
|
187
|
+
The adapter manages the 50 API calls per 24-hour limit automatically:
|
|
188
|
+
|
|
189
|
+
- **Disable unnecessary API endpoints** in adapter settings to reduce quota usage
|
|
190
|
+
- Increase update interval if you hit quota limits frequently
|
|
191
|
+
- MQTT streaming doesn't count against API quota and provides real-time data
|
|
192
|
+
- Each enabled API endpoint uses one quota call per update interval
|
|
193
|
+
|
|
194
|
+
### Missing Data in API Folder
|
|
195
|
+
|
|
196
|
+
If you're not seeing expected data in `VIN.api.*`:
|
|
197
|
+
|
|
198
|
+
1. Check if the corresponding endpoint is enabled in adapter settings
|
|
199
|
+
2. Verify you haven't exceeded API quota (check adapter logs)
|
|
200
|
+
3. Some endpoints may not be available for all vehicle types
|
|
201
|
+
4. Check adapter logs for specific endpoint errors (404, 403, etc.)
|
|
202
|
+
|
|
203
|
+
### Understanding Data Sources
|
|
204
|
+
|
|
205
|
+
- **`VIN.api.*`** - Updated periodically based on interval and enabled endpoints
|
|
206
|
+
- **`VIN.stream.*`** - Updated in real-time via MQTT when vehicle data changes
|
|
207
|
+
- **`VIN.lastUpdate`** - Timestamp of most recent data update (API or MQTT)
|
|
208
|
+
- **`VIN.lastStreamUpdate`** - Timestamp of most recent MQTT stream update
|
|
54
209
|
|
|
55
210
|
## Source
|
|
56
211
|
|
|
57
212
|
This adapter is available at: [https://github.com/TA2k/ioBroker.bmw](https://github.com/TA2k/ioBroker.bmw)
|
|
58
213
|
|
|
59
214
|
## Changelog
|
|
215
|
+
|
|
216
|
+
### 4.0.1 (2025-10-01)
|
|
217
|
+
|
|
218
|
+
- **BREAKING:** Complete migration to BMW CarData API with OAuth2 Device Flow authentication
|
|
219
|
+
- **BREAKING:** Removed username/password authentication (deprecated by BMW)
|
|
220
|
+
- **BREAKING:** Removed all remote control functionality (CarData API is read-only)
|
|
221
|
+
- **BREAKING:** Removed second user support and CAPTCHA requirements
|
|
222
|
+
- **NEW:** Real-time MQTT streaming for instant vehicle data updates
|
|
223
|
+
- **NEW:** OAuth2 Device Code Flow authentication with PKCE
|
|
224
|
+
- **NEW:** API quota management system (50 calls per 24 hours)
|
|
225
|
+
- **NEW:** Configurable API endpoint selection to manage quota usage
|
|
226
|
+
- **NEW:** Organized folder structure: api/ for periodic updates, stream/ for real-time data
|
|
227
|
+
- **NEW:** Enhanced state management with proper object creation
|
|
228
|
+
- **NEW:** Modern JSON-based configuration interface (jsonConfig.json)
|
|
229
|
+
- **NEW:** Comprehensive setup documentation with BMW portal integration
|
|
230
|
+
- **FIXED:** MQTT message processing logic for correct data validation
|
|
231
|
+
- **FIXED:** State creation issues preventing "no existing object" errors
|
|
232
|
+
- **IMPROVED:** Removed unused dependencies (cookie handling, legacy auth)
|
|
233
|
+
- **IMPROVED:** Enhanced error handling with specific guidance for common issues
|
|
234
|
+
|
|
60
235
|
### 3.0.1 (2025-09-27)
|
|
61
236
|
|
|
62
237
|
- (hombach) change to recommended stable admin 7.6.17 (#159)
|