• params: device (table). Note, don’t pass id into table, it’s auto-generated.
  • return: device id (string) or nil if failed to add a device.

Note: If parent_device_id is set to a child device id, then the return value would be nil and no device will be created.