Is it possible to render smoke into the Z-Dpth pass? I did a setup following the advices found here but it renders only the domain as geometry no smoke.
You cannot get a Z-depth of a volumetric shader. You would have to somehow turn the volume into a mesh - and get a depth of those polygons.
An idea would be to give the smoke a color based on distance from camera - you can shade the volume almost solid with high density scatter shader - but that relies on external lighting. With emission shader the volume behaves additively resulting in incorrect depth-values (it's brighter than mesh at same depth). So there's no way to get the smoke's Z-depth other than meshifying it.
Yey! It seems I did it. You don't get precise z-depth, but at least you get depth gradient, which can be mapped to needed values after. I did it for a camera being inside volume. Otherwise you probably need to create additional outside volume to act as depth attenuation mist.
Emission+absorbtion create a non-additive "white".
Mix inputs original volume density (clouds smoke etc.)
Add absorption (this should probably be assigned to an external volume that includes everything visible), density adjusts depth of "z".
If you wish to keep it all in one scene, the last node is switch between original shader/z.
This of course is a workaround, so it might seem complicated for some, in which case I won't be able to guide step by step for every possible scenario. However it worked for me.