--- 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)功能,讓我們在新增設備時,可套用事先預設的設備設定檔。 ::: ![](https://i.imgur.com/LX7FJoY.png) 官方文件(TB 3.2.2): https://thingsboard.io/docs/user-guide/device-profiles/ 以下截圖皆為TB 3.3版本 Create new device profile --- 1. **Device profile details** ![](https://i.imgur.com/7nTg81p.png) 2. **Transport Configuration** (optional) * Transport type: **Default** ![](https://i.imgur.com/4GNEAjv.png) * Transport type: **MQTT** (device payload: JSON | Protobuf) ![](https://i.imgur.com/q1H5VvG.png) * Transport type: **CoAP** (device type: Default | ~~Efento NB-IoT~~ / device payload: JSON | Protobuf) ![](https://i.imgur.com/Wf2nPpl.png) * Transport type: **LWM2M** > LWM2M Model ![](https://i.imgur.com/ckPUHvu.png) > Servers: Servers | Bootstrap Server | LwM2M Server ![](https://i.imgur.com/bu54TPg.png) ![](https://i.imgur.com/2IUeCeL.png) ![](https://i.imgur.com/EYRPGVk.png) ![](https://i.imgur.com/FW46bfE.png) ![](https://i.imgur.com/Y33ipzV.png) ![](https://i.imgur.com/t3Q6yli.png) ```{ "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) ![](https://i.imgur.com/r6IRj0Y.png) 3. **Alarm rules**(optional) ![](https://i.imgur.com/VLMuTgp.png) 4. **Device provisioning** * Provision strategy * [ ] Disabled * [ ] Allow to create new devices * [ ] Check for pre-provisioned devices) ![](https://i.imgur.com/chF9WtP.png) Import device profile --- * Device profile file: 我們需要準備一個template檔 ![](https://i.imgur.com/DIQTXBb.png) Resource(s) --- * [Facebook ThingsBoard Taiwan Group](https://facebook.com/groups/thingsboard)