Let $E_i$, $i \in I$ be a set of compact objects such that $\bigoplus_{i \in I} E_i$ generates $\mathcal{D}$. We may and do assume that the set of objects $\{E_i\}$ is preserved under shifts. Consider pairs $(i, a)$ where $i \in I$ and $a \in H(E_i)$ and set $$ X_1 = \bigoplus\nolimits_{(i, a)} E_i $$ Since $H(X_1) = \prod_{(i, a)} H(E_i)$ we see that $(a)_{(i, a)}$ defines an element $a_1 \in H(X_1)$. Set $H_1 = \Hom_\mathcal{D}(- , X_1)$. By Yoneda's lemma (Categories, Lemma \ref{categories-lemma-yoneda}) the element $a_1$ defines a natural transformation $H_1 \to H$. \medskip\noindent We are going to inductively construct $X_n$ and transformations $a_n : H_n \to H$ where $H_n = \Hom_\mathcal{D}(-, X_n)$. Namely, we apply the procedure above to the functor $\Ker(H_n \to H)$ to get an object $$ K_{n + 1} = \bigoplus\nolimits_{(i, k),\ k \in \Ker(H_n(E_i) \to H(E_i))} E_i $$ and a transformation $\Hom_\mathcal{D}(-, K_{n + 1}) \to \Ker(H_n \to H)$. By Yoneda's lemma the composition $\Hom_\mathcal{D}(-, K_{n + 1}) \to H_n$ gives a morphism $K_{n + 1} \to X_n$. We choose a distinguished triangle $$ K_{n + 1} \to X_n \to X_{n + 1} \to K_{n + 1}[1] $$ in $\mathcal{D}$. The element $a_n \in H(X_n)$ maps to zero in $H(K_{n + 1})$ by construction. Since $H$ is cohomological we can lift it to an element $a_{n + 1} \in H(X_{n + 1})$. \medskip\noindent We claim that $X = \text{hocolim} X_n$ represents $H$. Applying $H$ to the defining distinguished triangle $$ \bigoplus X_n \to \bigoplus X_n \to X \to \bigoplus X_n[1] $$ we obtain an exact sequence $$ \prod H(X_n) \leftarrow  \prod H(X_n) \leftarrow  H(X) $$ Thus there exists an element $a \in H(X)$ mapping to $(a_n)$ in $\prod H(X_n)$. Hence a natural transformation $\Hom_\mathcal{D}(- , X) \to H$ such that $$ \Hom_\mathcal{D}(-, X_1) \to \Hom_\mathcal{D}(-, X_2) \to \Hom_\mathcal{D}(-, X_3) \to \ldots \to \Hom_\mathcal{D}(-, X) \to H $$ commutes. For each $i$ the map $\Hom_\mathcal{D}(E_i, X) \to H(E_i)$ is surjective, by construction of $X_1$. On the other hand, by construction of $X_n \to X_{n + 1}$ the kernel of $\Hom_\mathcal{D}(E_i, X_n) \to H(E_i)$ is killed by the map $\Hom_\mathcal{D}(E_i, X_n) \to \Hom_\mathcal{D}(E_i, X_{n + 1})$. Since $$ \Hom_\mathcal{D}(E_i, X) = \colim \Hom_\mathcal{D}(E_i, X_n) $$ by Lemma \ref{lemma-commutes-with-countable-sums} we see that $\Hom_\mathcal{D}(E_i, X) \to H(E_i)$ is injective. \medskip\noindent To finish the proof, consider the subcategory $$ \mathcal{D}' = \{Y \in \Ob(\mathcal{D}) \mid \Hom_\mathcal{D}(Y[n], X) \to H(Y[n]) \text{ is an isomorphism for all }n\} $$ As $\Hom_\mathcal{D}(-, X) \to H$ is a transformation between cohomological functors, the subcategory $\mathcal{D}'$ is a strictly full, saturated, triangulated subcategory of $\mathcal{D}$ (details omitted; see proof of Lemma \ref{lemma-homological-functor-kernel}). Moreover, as both $H$ and $\Hom_\mathcal{D}(-, X)$ transform direct sums into products, we see that direct sums of objects of $\mathcal{D}'$ are in $\mathcal{D}'$. Thus derived colimits of objects of $\mathcal{D}'$ are in $\mathcal{D}'$. Since $\{E_i\}$ is preserved under shifts, we see that $E_i$ is an object of $\mathcal{D}'$ for all $i$. It follows from Lemma \ref{lemma-write-as-colimit} that $\mathcal{D}' = \mathcal{D}$ and the proof is complete.