Let $\Omega = \{ \omega_i \}$ be a countable set, and consider some probability space $(\omega, \mathcal F, P)$ with $p_i := P(\{ w_i \})$. Let $X : \Omega \to \mathbb R$ be a random variable, then it's expected value is $$ E(X) := \sum_i X(\omega_i) \cdot p_i. $$ Now it is possible to define the conditional expectation $E(X | Y)$ of $X$ dependend on a second random variable, on Wikipedia it is written that
[...] the conditional expectation of $X$ given the event $Y = y$ is a function of $y$ over the range of $Y$ [...]
This is the conditional expectation with respect (conditioned) to another random variable $Y$. But as is also written on wikipedia, we can condition on a sub-$\sigma$-algebra, see Wikipedia too.
The conditional expectation w.r.t. a random variable is a function on the range of $Y$, i.e. $E(X | Y) : Y(\Omega) \to \mathbb R$, the condittional expectation w.r.t. a sub-$\sigma$-algebra $\mathcal H \subseteq \mathcal F$ is a function $E(X | \mathcal H) : \Omega \to \mathbb R$, so has another domain.
Now my question, as they both capture in some sense the same concept, how to convert between them? On the german Wikipedia I found an explanation, there it is said (in a very free translation)
... to get from $E(X|Y)$ to $E(X|\mathcal H)$ set $\mathcal H := \sigma(Y)$, then $E(X|\sigma(Y))(\omega) = E(X | \{ \omega' : Y(\omega') = Y(\omega) \} = E(X|Y=y)$ with $y = Y(\omega)$ and $E(X|Y=y) = E(X|\sigma(Y))(\omega)$ for some $\omega$ with $y = Y(\omega)$. For the other conversion given $E(X|\mathcal H)$ let $Y$ be the family $(1_{B})_{B\in \mathcal H}$.
The conversion from $E(X|\mathcal H)$ to the form $E(X|Y)$ for some random variable $Y$ I do not understand, how could $Y$ be a family of indicator functions as said above (I made the part I do not understand bold)? Can someone please explain, thank you!