---
title: Device Profiles
tags: ThingsBoard
image: https://i.imgur.com/7nTg81p.png
disqus: hackmd
---
Device profiles
===
:::info
Since ThingsBoard 3.2, the Tenant administrator is able to configure common settings for multiple devices using Device Profiles. Each Device has one and only profile at a single point in time.
:::
:::info
早期的設備類型(Device type)已不復見,TB版本3.2開始,正名為設備設定檔(Device profiles)功能,讓我們在新增設備時,可套用事先預設的設備設定檔。
:::

官方文件(TB 3.2.2): https://thingsboard.io/docs/user-guide/device-profiles/
以下截圖皆為TB 3.3版本
Create new device profile
---
1. **Device profile details**

2. **Transport Configuration** (optional)
* Transport type: **Default**

* Transport type: **MQTT** (device payload: JSON | Protobuf)

* Transport type: **CoAP** (device type: Default | ~~Efento NB-IoT~~ / device payload: JSON | Protobuf)

* Transport type: **LWM2M**
> LWM2M Model

> Servers: Servers | Bootstrap Server | LwM2M Server






```{
"clientLwM2mSettings": {
"clientStrategy": "1",
"fwUpdateStrategy": 1,
"swUpdateStrategy": 1,
"fwUpdateRecourse": "coap://localhost:5685",
"swUpdateRecourse": "coap://localhost:5685"
},
"observeAttr": {
"observe": [],
"attribute": [],
"telemetry": [],
"keyName": {},
"attributeLwm2m": {}
},
"bootstrap": {
"servers": {
"shortId": 123,
"lifetime": 300,
"defaultMinPeriod": 1,
"notifIfDisabled": true,
"binding": "UQ"
},
"bootstrapServer": {
"host": "localhost",
"port": 5687,
"securityMode": "NO_SEC",
"serverPublicKey": "",
"clientHoldOffTime": 1,
"serverId": 111,
"bootstrapServerAccountTimeout": 0
},
"lwm2mServer": {
"host": "localhost",
"port": 5685,
"securityMode": "NO_SEC",
"serverPublicKey": "",
"clientHoldOffTime": 1,
"serverId": 123,
"bootstrapServerAccountTimeout": 0
}
}
}
```
* Transport type: **SNMP** (Scope: Telemetry | Client attributes | Shared attributes | RPC request)

3. **Alarm rules**(optional)

4. **Device provisioning**
* Provision strategy
* [ ] Disabled
* [ ] Allow to create new devices
* [ ] Check for pre-provisioned devices)

Import device profile
---
* Device profile file: 我們需要準備一個template檔

Resource(s)
---
* [Facebook ThingsBoard Taiwan Group](https://facebook.com/groups/thingsboard)