For many years I had the coffee machine drain connected to just above the sink trap using a 2.5m length of hose (red line). The hose went through a hole in the bench top and followed a very shallow (5º) run behind the dishwasher to the sink cupboard - the shallowness of this run repeatedly blocked this hose by the small amounts of coffee grounds over time settling out. This was at times a nightmare to unblock and I even had to occasionally use compressed air to unblock the drain hose.
Attachment 536552
When I got my new coffee machine I connected the drain to a 1.5m long 20 mm Black poly which dropped through the same hole in the bench top, and then vertically down through a kitchen cupboard and wooden floor n (purple line), into the basement under the kitchen. Here there is a 20 mm black poly right angle bend connected in turn to a 2.5m length of black poly that slopes at an angle of about 30º down to and connects to the sink waste line under the kitchen. With this degree of vertical drop the grounds are easily carried to waste even by the small amounts of drain water output by the coffee machine.
I realize none of this is probably "legal" but it works, no blockages and no discernible smell.