Create DeviceHub Device + Tags
3 min
create devicehub device + tags ui trigger devicehub > add device > (configure) > add tag this is the most common chain customers struggle with each sub step feeds data into the next step table step api name method endpoint / graphql operation input output / what to capture 1 list of drivers post {{edgeurl}}/devicehub/v2 > listdrivers no input required driverid , name per protocol (modbus tcp, opc ua, etc ) 2 get driver template by driverid post {{edgeurl}}/devicehub/v2 > getdriver {id "\<driverid from step 1>"} deviceproperties required fields/tabs for device config 3 create new device post {{edgeurl}}/devicehub/v2 > createdevice driver id + device properties from step 2 deviceid 4 get driver supported registers post {{edgeurl}}/devicehub/v2 > getdriver with supportedregisters {id "\<driverid>"} supportedregisters\[] name , readonly , registerproperties valid register types and value types for this driver 5 create tag post {{edgeurl}}/devicehub/v2 > createregisters deviceid (step 3) + register type (step 4) + tag properties tag id, tag is live why step 4 is critical each driver supports a different set of register types (e g modbus tcp supports holding register , input register , coil , discrete input ) calling createregisters with an unsupported type returns a validation error always check supportedregisters before building the createregisters payload optional pre validation use validateupdateregisters (graphql query) to dry run a tag payload before actually calling createregisters the query returns errors\[] without committing anything see also devicehub data model # browse bulk tag discovery # for auto discovering tags instead of creating them manually devicehub reference #