@thingsboard/n8n-nodes-thingsboard 1.0.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/LICENSE.md +19 -0
- package/README.md +409 -0
- package/dist/credentials/ThingsBoardApi.credentials.d.ts +7 -0
- package/dist/credentials/ThingsBoardApi.credentials.js +36 -0
- package/dist/credentials/ThingsBoardApi.credentials.js.map +1 -0
- package/dist/nodes/thingsboard/ThingsBoard.node.d.ts +5 -0
- package/dist/nodes/thingsboard/ThingsBoard.node.js +1748 -0
- package/dist/nodes/thingsboard/ThingsBoard.node.js.map +1 -0
- package/dist/nodes/thingsboard/ThingsBoard.node.json +36 -0
- package/dist/nodes/thingsboard/resources/AlarmResource.d.ts +10 -0
- package/dist/nodes/thingsboard/resources/AlarmResource.js +127 -0
- package/dist/nodes/thingsboard/resources/AlarmResource.js.map +1 -0
- package/dist/nodes/thingsboard/resources/AssetResource.d.ts +12 -0
- package/dist/nodes/thingsboard/resources/AssetResource.js +131 -0
- package/dist/nodes/thingsboard/resources/AssetResource.js.map +1 -0
- package/dist/nodes/thingsboard/resources/CustomerResource.d.ts +11 -0
- package/dist/nodes/thingsboard/resources/CustomerResource.js +95 -0
- package/dist/nodes/thingsboard/resources/CustomerResource.js.map +1 -0
- package/dist/nodes/thingsboard/resources/DashboardResource.d.ts +10 -0
- package/dist/nodes/thingsboard/resources/DashboardResource.js +109 -0
- package/dist/nodes/thingsboard/resources/DashboardResource.js.map +1 -0
- package/dist/nodes/thingsboard/resources/DeviceResource.d.ts +12 -0
- package/dist/nodes/thingsboard/resources/DeviceResource.js +137 -0
- package/dist/nodes/thingsboard/resources/DeviceResource.js.map +1 -0
- package/dist/nodes/thingsboard/resources/EntityGroupResource.d.ts +9 -0
- package/dist/nodes/thingsboard/resources/EntityGroupResource.js +71 -0
- package/dist/nodes/thingsboard/resources/EntityGroupResource.js.map +1 -0
- package/dist/nodes/thingsboard/resources/RelationResource.d.ts +11 -0
- package/dist/nodes/thingsboard/resources/RelationResource.js +144 -0
- package/dist/nodes/thingsboard/resources/RelationResource.js.map +1 -0
- package/dist/nodes/thingsboard/resources/TelemetryResource.d.ts +17 -0
- package/dist/nodes/thingsboard/resources/TelemetryResource.js +252 -0
- package/dist/nodes/thingsboard/resources/TelemetryResource.js.map +1 -0
- package/dist/nodes/thingsboard/thingsboard-black.svg +10 -0
- package/dist/nodes/thingsboard/thingsboard-white.svg +10 -0
- package/dist/nodes/thingsboard/thingsboard.svg +10 -0
- package/dist/nodes/thingsboard/utils/helpers.d.ts +10 -0
- package/dist/nodes/thingsboard/utils/helpers.js +95 -0
- package/dist/nodes/thingsboard/utils/helpers.js.map +1 -0
- package/dist/nodes/thingsboard/utils/requestHandler.d.ts +11 -0
- package/dist/nodes/thingsboard/utils/requestHandler.js +116 -0
- package/dist/nodes/thingsboard/utils/requestHandler.js.map +1 -0
- package/dist/nodes/thingsboard/utils/resourceRegistry.d.ts +5 -0
- package/dist/nodes/thingsboard/utils/resourceRegistry.js +32 -0
- package/dist/nodes/thingsboard/utils/resourceRegistry.js.map +1 -0
- package/dist/nodes/thingsboard/utils/types.d.ts +42 -0
- package/dist/nodes/thingsboard/utils/types.js +3 -0
- package/dist/nodes/thingsboard/utils/types.js.map +1 -0
- package/dist/package.json +77 -0
- package/dist/tsconfig.tsbuildinfo +1 -0
- package/package.json +77 -0
package/LICENSE.md
ADDED
|
@@ -0,0 +1,19 @@
|
|
|
1
|
+
Copyright 2022 n8n
|
|
2
|
+
|
|
3
|
+
Permission is hereby granted, free of charge, to any person obtaining a copy of
|
|
4
|
+
this software and associated documentation files (the "Software"), to deal in
|
|
5
|
+
the Software without restriction, including without limitation the rights to
|
|
6
|
+
use, copy, modify, merge, publish, distribute, sublicense, and/or sell copies
|
|
7
|
+
of the Software, and to permit persons to whom the Software is furnished to do
|
|
8
|
+
so, subject to the following conditions:
|
|
9
|
+
|
|
10
|
+
The above copyright notice and this permission notice shall be included in all
|
|
11
|
+
copies or substantial portions of the Software.
|
|
12
|
+
|
|
13
|
+
THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
|
|
14
|
+
IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
|
|
15
|
+
FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
|
|
16
|
+
AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
|
|
17
|
+
LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
|
|
18
|
+
OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
|
|
19
|
+
SOFTWARE.
|
package/README.md
ADDED
|
@@ -0,0 +1,409 @@
|
|
|
1
|
+
# ThingsBoard n8n Node
|
|
2
|
+
|
|
3
|
+

|
|
4
|
+
|
|
5
|
+
[n8n](https://n8n.io/) is a workflow automation platform that combines traditional business process automation with AI capabilities.
|
|
6
|
+
|
|
7
|
+
The **ThingsBoard n8n Node** provides deep and native integration between n8n and the ThingsBoard IoT Platform, enabling you to manage IoT infrastructure directly from n8n workflows.
|
|
8
|
+
|
|
9
|
+
## ✨ Features
|
|
10
|
+
|
|
11
|
+
- **Manage IoT devices, assets, and customers** directly from n8n workflows
|
|
12
|
+
- **Access and manipulate telemetry data** in real-time with attribute and time-series operations
|
|
13
|
+
- **Monitor alarms** and create automated responses based on alarm severity and type
|
|
14
|
+
- **Navigate entity relationships** to understand your IoT infrastructure topology
|
|
15
|
+
- **Build AI-powered IoT automation** using n8n AI Agents with natural language commands
|
|
16
|
+
- **Automate complex IoT workflows** with 61 operations across 8 resources (51 operations for Community Edition)
|
|
17
|
+
|
|
18
|
+
## 📖 Documentation
|
|
19
|
+
|
|
20
|
+
For detailed documentation including usage examples, workflow patterns, and API reference, visit:
|
|
21
|
+
|
|
22
|
+
**[ThingsBoard n8n Node Documentation](https://thingsboard.io/docs/samples/analytics/n8n-node/)**
|
|
23
|
+
|
|
24
|
+
## 🚀 Quick Start
|
|
25
|
+
|
|
26
|
+
### Installation
|
|
27
|
+
|
|
28
|
+
```bash
|
|
29
|
+
npm install @thingsboard/n8n-nodes-thingsboard
|
|
30
|
+
```
|
|
31
|
+
|
|
32
|
+
### Configuration
|
|
33
|
+
|
|
34
|
+
1. Get your ThingsBoard credentials (URL, username, password)
|
|
35
|
+
2. In n8n, add ThingsBoard credentials:
|
|
36
|
+
- **Base URL**: `https://demo.thingsboard.io`, `https://thingsboard.cloud` or your instance URL
|
|
37
|
+
- **Username**: Your ThingsBoard login
|
|
38
|
+
- **Password**: Your ThingsBoard password
|
|
39
|
+
3. Add the ThingsBoard node to your workflow
|
|
40
|
+
4. Select a resource (Device, Asset, etc.) and operation
|
|
41
|
+
|
|
42
|
+
### Usage
|
|
43
|
+
|
|
44
|
+
The ThingsBoard node supports multiple usage patterns to fit your automation needs:
|
|
45
|
+
|
|
46
|
+
**🤖 AI Agent Tool** - Use as a tool for AI Agents to enable conversational IoT control
|
|
47
|
+
*Example*: "Show me all devices" → Agent calls ThingsBoard → Natural language response
|
|
48
|
+
|
|
49
|
+
**💡 Direct Operations** - Configure operations with fixed values in the node interface
|
|
50
|
+
*Example*: Save specific attributes to device `abc-123` on a schedule
|
|
51
|
+
|
|
52
|
+
**🔄 Dynamic Operations** - Pass data from previous nodes using expressions
|
|
53
|
+
*Example*: Process alarm webhook → Extract entity ID → Get attributes → Send notification
|
|
54
|
+
|
|
55
|
+
See [Usage Examples](#-usage-examples) below for detailed walkthroughs with screenshots.
|
|
56
|
+
|
|
57
|
+
**Operation Modes**: For create operations (Device, Asset, Dashboard), you can choose:
|
|
58
|
+
- **Params Mode**: Use simple form fields (name, type, label, customer ID)
|
|
59
|
+
- **JSON Mode**: Paste a complete ThingsBoard entity JSON object
|
|
60
|
+
|
|
61
|
+
## 📦 Installation Methods
|
|
62
|
+
|
|
63
|
+
### Method 1: GUI Installation (Recommended for Self-Hosted)
|
|
64
|
+
|
|
65
|
+
For self-hosted n8n instances, you can install directly via the web interface:
|
|
66
|
+
|
|
67
|
+
1. Open n8n in your browser
|
|
68
|
+
2. Navigate to **Settings** → **Community Nodes**
|
|
69
|
+
3. Click **Install a community node**
|
|
70
|
+
4. Enter package name: `@thingsboard/n8n-nodes-thingsboard`
|
|
71
|
+
5. Click **Install**
|
|
72
|
+
6. Wait for installation to complete
|
|
73
|
+
7. Refresh your browser
|
|
74
|
+
|
|
75
|
+
**Note**: This method requires owner/admin permissions and is only available for self-hosted n8n (not n8n Cloud).
|
|
76
|
+
|
|
77
|
+
### Method 2: Manual Installation (npm)
|
|
78
|
+
|
|
79
|
+
For local n8n installations, install the node via npm:
|
|
80
|
+
|
|
81
|
+
```bash
|
|
82
|
+
# Create and navigate to the nodes directory
|
|
83
|
+
mkdir -p ~/.n8n/nodes
|
|
84
|
+
cd ~/.n8n/nodes
|
|
85
|
+
|
|
86
|
+
# Install the ThingsBoard node
|
|
87
|
+
npm install @thingsboard/n8n-nodes-thingsboard
|
|
88
|
+
```
|
|
89
|
+
|
|
90
|
+
After installation, restart n8n:
|
|
91
|
+
|
|
92
|
+
```bash
|
|
93
|
+
# If running n8n directly
|
|
94
|
+
n8n start
|
|
95
|
+
```
|
|
96
|
+
|
|
97
|
+
**AI Agent Tool Usage**: If you plan to use the ThingsBoard node as a tool for AI Agents, set these environment variables before starting n8n:
|
|
98
|
+
|
|
99
|
+
```bash
|
|
100
|
+
export N8N_COMMUNITY_PACKAGES_ENABLED=true
|
|
101
|
+
export N8N_COMMUNITY_PACKAGES_ALLOW_TOOL_USAGE=true
|
|
102
|
+
n8n start
|
|
103
|
+
```
|
|
104
|
+
|
|
105
|
+
### Method 3: Docker Installation
|
|
106
|
+
|
|
107
|
+
**Step 1**: Create a directory for n8n and navigate to it:
|
|
108
|
+
|
|
109
|
+
```bash
|
|
110
|
+
mkdir n8n
|
|
111
|
+
cd n8n
|
|
112
|
+
```
|
|
113
|
+
|
|
114
|
+
**Step 2**: Create a `docker-compose.yml` file in this directory:
|
|
115
|
+
|
|
116
|
+
```yaml
|
|
117
|
+
services:
|
|
118
|
+
n8n:
|
|
119
|
+
image: n8nio/n8n:latest
|
|
120
|
+
ports:
|
|
121
|
+
- "5678:5678"
|
|
122
|
+
environment:
|
|
123
|
+
- N8N_BASIC_AUTH_ACTIVE=true
|
|
124
|
+
- N8N_BASIC_AUTH_USER=admin
|
|
125
|
+
- N8N_BASIC_AUTH_PASSWORD=password
|
|
126
|
+
# Uncomment the lines below to use ThingsBoard node as AI Agent tool
|
|
127
|
+
# - N8N_COMMUNITY_PACKAGES_ENABLED=true
|
|
128
|
+
# - N8N_COMMUNITY_PACKAGES_ALLOW_TOOL_USAGE=true
|
|
129
|
+
volumes:
|
|
130
|
+
- n8n_data:/home/node/.n8n
|
|
131
|
+
|
|
132
|
+
volumes:
|
|
133
|
+
n8n_data:
|
|
134
|
+
driver: local
|
|
135
|
+
```
|
|
136
|
+
|
|
137
|
+
**Step 3**: Start the services:
|
|
138
|
+
|
|
139
|
+
```bash
|
|
140
|
+
docker-compose up -d
|
|
141
|
+
```
|
|
142
|
+
|
|
143
|
+
**Step 4**: After n8n starts, install the ThingsBoard node using the **GUI method** (Method 1):
|
|
144
|
+
1. Open n8n in your browser (`http://localhost:5678`)
|
|
145
|
+
2. Navigate to **Settings** → **Community Nodes**
|
|
146
|
+
3. Install `@thingsboard/n8n-nodes-thingsboard`
|
|
147
|
+
4. Refresh your browser
|
|
148
|
+
|
|
149
|
+
### Method 4: n8n Cloud
|
|
150
|
+
|
|
151
|
+
The ThingsBoard node requires verification to be available on n8n Cloud. n8n Cloud supports a select group of verified community nodes included in their official catalog.
|
|
152
|
+
|
|
153
|
+
**Current Status**: Until the node is verified and included in the Cloud-available catalog, use self-hosted n8n (local or Docker) with any installation method above.
|
|
154
|
+
|
|
155
|
+
## 🔧 Verify Installation
|
|
156
|
+
|
|
157
|
+
After installation and restart:
|
|
158
|
+
|
|
159
|
+
1. Open n8n in your browser (typically `http://localhost:5678`)
|
|
160
|
+
2. Create a new workflow
|
|
161
|
+
3. Click the **+** button to add a node
|
|
162
|
+
4. Search for **"ThingsBoard"** in the node picker
|
|
163
|
+
5. The **ThingsBoard** node should appear in the search results
|
|
164
|
+
|
|
165
|
+
If you don't see the node:
|
|
166
|
+
- Verify the npm installation completed without errors
|
|
167
|
+
- Ensure you restarted n8n after installation (for Method 2)
|
|
168
|
+
- Check n8n logs for any loading errors
|
|
169
|
+
|
|
170
|
+
## 🔑 Setting Up Credentials
|
|
171
|
+
|
|
172
|
+
Before using the ThingsBoard node, configure your connection credentials:
|
|
173
|
+
|
|
174
|
+
1. In n8n, navigate to **Credentials** → **New Credential**
|
|
175
|
+
2. Search for **"ThingsBoard API"**
|
|
176
|
+
3. Fill in the required fields:
|
|
177
|
+
|
|
178
|
+
| Field | Description | Example |
|
|
179
|
+
|-------|-------------|---------|
|
|
180
|
+
| **Base URL** | ThingsBoard instance URL (without trailing slash) | `https://demo.thingsboard.io` or `https://thingsboard.cloud` |
|
|
181
|
+
| **Username** | Your ThingsBoard account email | `tenant@thingsboard.org` |
|
|
182
|
+
| **Password** | Your ThingsBoard account password | `tenant` |
|
|
183
|
+
|
|
184
|
+
4. Click **Save** to store the credentials
|
|
185
|
+
|
|
186
|
+
The credentials are encrypted and stored securely by n8n. You can reuse the same credentials across multiple ThingsBoard nodes in different workflows.
|
|
187
|
+
|
|
188
|
+
## 📋 Supported Operations
|
|
189
|
+
|
|
190
|
+
### Device (8 operations)
|
|
191
|
+
- ✅ Create Device (Params/JSON mode)
|
|
192
|
+
- ✅ Delete Device
|
|
193
|
+
- ✅ Get Device by ID
|
|
194
|
+
- ✅ Get Device by Name
|
|
195
|
+
- ✅ Get Tenant Devices
|
|
196
|
+
- ✅ Get Customer Devices
|
|
197
|
+
- ✅ Get Devices by Entity Group (PE only)
|
|
198
|
+
- ✅ Get User Devices (PE only)
|
|
199
|
+
|
|
200
|
+
### Asset (7 operations)
|
|
201
|
+
- ✅ Create Asset (Params/JSON mode)
|
|
202
|
+
- ✅ Delete Asset
|
|
203
|
+
- ✅ Get Asset by ID
|
|
204
|
+
- ✅ Get Asset by Name
|
|
205
|
+
- ✅ Get Tenant Assets
|
|
206
|
+
- ✅ Get Customer Assets
|
|
207
|
+
- ✅ Get Assets by Entity Group (PE only)
|
|
208
|
+
- ✅ Get User Assets (PE only)
|
|
209
|
+
|
|
210
|
+
### Customer (7 operations)
|
|
211
|
+
- ✅ Create Customer (Params/JSON mode)
|
|
212
|
+
- ✅ Delete Customer
|
|
213
|
+
- ✅ Get Customer by ID
|
|
214
|
+
- ✅ Get Customer by Title
|
|
215
|
+
- ✅ Get Customers
|
|
216
|
+
- ✅ Get Customers by Entity Group (PE only)
|
|
217
|
+
- ✅ Get User Customers (PE only)
|
|
218
|
+
|
|
219
|
+
### Dashboard (5 operations)
|
|
220
|
+
- ✅ Create Dashboard (JSON mode)
|
|
221
|
+
- ✅ Delete Dashboard
|
|
222
|
+
- ✅ Get Dashboard by ID
|
|
223
|
+
- ✅ Get Dashboards
|
|
224
|
+
- ✅ Get Customer Dashboards
|
|
225
|
+
|
|
226
|
+
### Telemetry (14 operations)
|
|
227
|
+
- ✅ Get Attributes
|
|
228
|
+
- ✅ Get Attribute Keys
|
|
229
|
+
- ✅ Get Attribute Keys (by Scope)
|
|
230
|
+
- ✅ Get Latest Timeseries
|
|
231
|
+
- ✅ Get Timeseries (Time Range)
|
|
232
|
+
- ✅ Get Timeseries Keys
|
|
233
|
+
- ✅ Save Entity Attributes
|
|
234
|
+
- ✅ Save Device Attributes
|
|
235
|
+
- ✅ Save Entity Telemetry
|
|
236
|
+
- ✅ Save Entity Telemetry with TTL
|
|
237
|
+
- ✅ Delete Entity Attributes
|
|
238
|
+
- ✅ Delete Device Attributes
|
|
239
|
+
- ✅ Delete Entity Timeseries
|
|
240
|
+
|
|
241
|
+
### Alarm (6 operations)
|
|
242
|
+
- ✅ Get All Alarms
|
|
243
|
+
- ✅ Get Alarm by ID
|
|
244
|
+
- ✅ Get Alarm Info by ID
|
|
245
|
+
- ✅ Get Alarms by Originator
|
|
246
|
+
- ✅ Get Highest Severity Alarm
|
|
247
|
+
- ✅ Get Alarm Types
|
|
248
|
+
|
|
249
|
+
### Relation (7 operations)
|
|
250
|
+
- ✅ Get Relation
|
|
251
|
+
- ✅ Find by From
|
|
252
|
+
- ✅ Find by From with Relation Type
|
|
253
|
+
- ✅ Find by To
|
|
254
|
+
- ✅ Find by To with Relation Type
|
|
255
|
+
- ✅ Find Info by From
|
|
256
|
+
- ✅ Find Info by To
|
|
257
|
+
|
|
258
|
+
### Entity Group (5 operations - PE only)
|
|
259
|
+
- ✅ Get Entity Group by ID
|
|
260
|
+
- ✅ Get Entity Groups by Type
|
|
261
|
+
- ✅ Get Entity Groups by Owner and Type
|
|
262
|
+
- ✅ Get Entity Group by Owner/Name/Type
|
|
263
|
+
- ✅ Get Entity Groups for Entity
|
|
264
|
+
|
|
265
|
+
**Total: 61 operations across 8 resources**
|
|
266
|
+
|
|
267
|
+
## 🛠️ Development
|
|
268
|
+
|
|
269
|
+
### Quick Start
|
|
270
|
+
|
|
271
|
+
```bash
|
|
272
|
+
# Clone the repository
|
|
273
|
+
git clone https://github.com/thingsboard/thingsboard-n8n-node.git
|
|
274
|
+
cd thingsboard-n8n-node
|
|
275
|
+
|
|
276
|
+
# Install dependencies
|
|
277
|
+
npm install
|
|
278
|
+
|
|
279
|
+
# Build the project
|
|
280
|
+
npm run build
|
|
281
|
+
|
|
282
|
+
# Run in development mode (watch)
|
|
283
|
+
npm run dev
|
|
284
|
+
```
|
|
285
|
+
|
|
286
|
+
### Testing Locally
|
|
287
|
+
|
|
288
|
+
```bash
|
|
289
|
+
# Link the package
|
|
290
|
+
npm link
|
|
291
|
+
|
|
292
|
+
# In your n8n directory
|
|
293
|
+
npm link @thingsboard/n8n-nodes-thingsboard
|
|
294
|
+
|
|
295
|
+
# Start n8n
|
|
296
|
+
n8n start
|
|
297
|
+
```
|
|
298
|
+
|
|
299
|
+
## 💡 Usage Examples
|
|
300
|
+
|
|
301
|
+
### Example 1: 🤖 AI Agent Tool - Conversational IoT Control
|
|
302
|
+
|
|
303
|
+
Use the ThingsBoard node as a **tool for AI Agents** to enable intelligent, natural language IoT automation.
|
|
304
|
+
|
|
305
|
+

|
|
306
|
+
|
|
307
|
+
#### How it works
|
|
308
|
+
|
|
309
|
+
1. User sends a chat message: *"What devices do I have and what's their status?"*
|
|
310
|
+
2. AI Agent (powered by Google Gemini or OpenAI GPT-4) has access to ThingsBoard tools
|
|
311
|
+
3. Agent autonomously calls:
|
|
312
|
+
- `Get devices in ThingsBoard` → Retrieves device list
|
|
313
|
+
- `Get timeseries in ThingsBoard` → Fetches latest telemetry
|
|
314
|
+
4. Agent responds in natural language with the actual data
|
|
315
|
+
|
|
316
|
+
#### Natural language commands
|
|
317
|
+
|
|
318
|
+
- *"Show me the temperature of my living room sensor"*
|
|
319
|
+
- *"Which devices are offline right now?"*
|
|
320
|
+
- *"Update the threshold on device X to 30 degrees"*
|
|
321
|
+
- *"Send me an alert if any temperature exceeds 25°C"*
|
|
322
|
+
|
|
323
|
+
The AI agent understands context and calls the appropriate ThingsBoard operations automatically!
|
|
324
|
+
|
|
325
|
+
---
|
|
326
|
+
|
|
327
|
+
### Example 2: 💡 Direct Operations - Fixed Values
|
|
328
|
+
|
|
329
|
+
Configure operations with **hardcoded values** directly in the node interface. Perfect for scheduled tasks and testing.
|
|
330
|
+
|
|
331
|
+

|
|
332
|
+
|
|
333
|
+
#### Use Case
|
|
334
|
+
|
|
335
|
+
Save configuration attributes to a specific device on a schedule
|
|
336
|
+
|
|
337
|
+
#### Configuration
|
|
338
|
+
|
|
339
|
+
- **Resource**: Telemetry
|
|
340
|
+
- **Operation**: Save Entity Attributes
|
|
341
|
+
- **Entity Type**: DEVICE
|
|
342
|
+
- **Entity ID**: `2d2c8cc0-d75a-11f0-9e9b-db8ef79a21ad` *(hardcoded)*
|
|
343
|
+
- **Scope**: SERVER_SCOPE
|
|
344
|
+
- **Attributes JSON**: Direct JSON input
|
|
345
|
+
|
|
346
|
+
```json
|
|
347
|
+
{
|
|
348
|
+
"stringKey": "value1",
|
|
349
|
+
"booleanKey": true,
|
|
350
|
+
"doubleKey": 42.0,
|
|
351
|
+
"longKey": 73,
|
|
352
|
+
"jsonKey": {
|
|
353
|
+
"someNumber": 42,
|
|
354
|
+
"someArray": [1, 2, 3],
|
|
355
|
+
"someNestedObject": {"key": "value"}
|
|
356
|
+
}
|
|
357
|
+
}
|
|
358
|
+
```
|
|
359
|
+
|
|
360
|
+
#### Typical Use Cases
|
|
361
|
+
|
|
362
|
+
- Daily configuration updates on a schedule
|
|
363
|
+
- Testing API operations during development
|
|
364
|
+
- One-time bulk data migrations
|
|
365
|
+
- Periodic attribute updates with fixed values
|
|
366
|
+
|
|
367
|
+
---
|
|
368
|
+
|
|
369
|
+
### Example 3: 🔄 Dynamic Operations - Flow-Based Automation
|
|
370
|
+
|
|
371
|
+
Pass data from previous nodes using **expressions** to create dynamic, data-driven workflows.
|
|
372
|
+
|
|
373
|
+

|
|
374
|
+
|
|
375
|
+

|
|
376
|
+
|
|
377
|
+

|
|
378
|
+
|
|
379
|
+
This example demonstrates how to build a dynamic workflow: receive a JSON, drag and drop an element from previous JSON result to make it dynamic.
|
|
380
|
+
|
|
381
|
+
For a complete step-by-step guide with detailed screenshots, see the [full documentation](https://thingsboard.io/docs/samples/analytics/n8n-node/).
|
|
382
|
+
|
|
383
|
+
## 📚 API Reference
|
|
384
|
+
|
|
385
|
+
The ThingsBoard n8n node is built on top of the ThingsBoard REST API. For detailed information about API endpoints, request/response formats, and additional parameters, refer to the [ThingsBoard REST API documentation](https://thingsboard.io/docs/reference/rest-api/).
|
|
386
|
+
|
|
387
|
+
## 🔗 Links
|
|
388
|
+
|
|
389
|
+
- **npm Package**: [@thingsboard/n8n-nodes-thingsboard](https://www.npmjs.com/package/@thingsboard/n8n-nodes-thingsboard)
|
|
390
|
+
- **GitHub Repository**: [thingsboard/thingsboard-n8n-node](https://github.com/thingsboard/thingsboard-n8n-node)
|
|
391
|
+
- **n8n Documentation**: [docs.n8n.io](https://docs.n8n.io/)
|
|
392
|
+
- **n8n Community**: [community.n8n.io](https://community.n8n.io/)
|
|
393
|
+
- **ThingsBoard REST API**: [REST API Reference](https://thingsboard.io/docs/reference/rest-api/)
|
|
394
|
+
|
|
395
|
+
## 🫶 Support
|
|
396
|
+
|
|
397
|
+
If you encounter issues or have questions about the ThingsBoard n8n node:
|
|
398
|
+
|
|
399
|
+
- **GitHub Issues**: [Report bugs or request features](https://github.com/thingsboard/thingsboard-n8n-node/issues)
|
|
400
|
+
- **ThingsBoard Community**: [Get help from the community](https://thingsboard.io/community/)
|
|
401
|
+
- **n8n Community**: [n8n community](https://community.n8n.io/)
|
|
402
|
+
|
|
403
|
+
## 📄 License
|
|
404
|
+
|
|
405
|
+
MIT License - see the [LICENSE file](https://github.com/thingsboard/thingsboard-n8n-node/blob/master/LICENSE.md) for details.
|
|
406
|
+
|
|
407
|
+
---
|
|
408
|
+
|
|
409
|
+
[n8n](https://n8n.io/) is a [fair-code licensed](https://docs.n8n.io/reference/license/) workflow automation platform.
|
|
@@ -0,0 +1,36 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
+
exports.ThingsBoardApi = void 0;
|
|
4
|
+
class ThingsBoardApi {
|
|
5
|
+
constructor() {
|
|
6
|
+
this.name = 'thingsBoardApi';
|
|
7
|
+
this.displayName = 'ThingsBoard API';
|
|
8
|
+
this.documentationUrl = 'https://example.com/docs/auth';
|
|
9
|
+
this.properties = [
|
|
10
|
+
{
|
|
11
|
+
displayName: 'Base URL',
|
|
12
|
+
name: 'baseUrl',
|
|
13
|
+
type: 'string',
|
|
14
|
+
default: 'https://demo.thingsboard.io/',
|
|
15
|
+
required: true,
|
|
16
|
+
},
|
|
17
|
+
{
|
|
18
|
+
displayName: 'Username',
|
|
19
|
+
name: 'username',
|
|
20
|
+
type: 'string',
|
|
21
|
+
default: '',
|
|
22
|
+
required: true,
|
|
23
|
+
},
|
|
24
|
+
{
|
|
25
|
+
displayName: 'Password',
|
|
26
|
+
name: 'password',
|
|
27
|
+
type: 'string',
|
|
28
|
+
typeOptions: { password: true },
|
|
29
|
+
default: '',
|
|
30
|
+
required: true,
|
|
31
|
+
},
|
|
32
|
+
];
|
|
33
|
+
}
|
|
34
|
+
}
|
|
35
|
+
exports.ThingsBoardApi = ThingsBoardApi;
|
|
36
|
+
//# sourceMappingURL=ThingsBoardApi.credentials.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"ThingsBoardApi.credentials.js","sourceRoot":"","sources":["../../credentials/ThingsBoardApi.credentials.ts"],"names":[],"mappings":";;;AAEA,MAAa,cAAc;IAA3B;QACC,SAAI,GAAG,gBAAgB,CAAC;QACxB,gBAAW,GAAG,iBAAiB,CAAC;QAChC,qBAAgB,GAAG,+BAA+B,CAAC;QACnD,eAAU,GAAsB;YAC/B;gBACC,WAAW,EAAE,UAAU;gBACvB,IAAI,EAAE,SAAS;gBACf,IAAI,EAAE,QAAQ;gBACd,OAAO,EAAE,8BAA8B;gBACvC,QAAQ,EAAE,IAAI;aACd;YACD;gBACC,WAAW,EAAE,UAAU;gBACvB,IAAI,EAAE,UAAU;gBAChB,IAAI,EAAE,QAAQ;gBACd,OAAO,EAAE,EAAE;gBACX,QAAQ,EAAE,IAAI;aACd;YACD;gBACC,WAAW,EAAE,UAAU;gBACvB,IAAI,EAAE,UAAU;gBAChB,IAAI,EAAE,QAAQ;gBACd,WAAW,EAAE,EAAE,QAAQ,EAAE,IAAI,EAAE;gBAC/B,OAAO,EAAE,EAAE;gBACX,QAAQ,EAAE,IAAI;aACd;SACD,CAAC;IACH,CAAC;CAAA;AA5BD,wCA4BC"}
|