This was recently decided by the Supreme Court, which dismissed the appeal filed by CCOO against the company Galp (2019) and ruled that companies have the right to deduct from their workers' working hours the time they have spent going out for a coffee and/or smoking.
The Supreme Court has upheld the decision of the Audiencia Nacional, stating that smoking, coffee and breakfast breaks are not effective working time and, consequently, do not have to be considered as part of the working day. With the advent of the working time registration law, workers are obliged to clock in at the start and end of the working day, but this ruling sets a precedent so that companies can make it compulsory to clock in during breaks and decide whether or not they count as working time.
Even so, this is a case-by-case ruling and the union has already announced that it will appeal. We will keep an eye on future case law in case it becomes a general rule, and the coffee and smoke break are consolidated as a time not worked. In that case, the Supreme Court will have the final decision.