Different rates for Barcelona city and rest of Catalonia/Cataluña as of October 1st, in accordance with Royal Decree 141/217 of September 19th. Higher rates for those establishments that offer gambling facilities. Info from the Generalitat in English
Amounts to pay
Exemptions for those that stay in tourist accommodation for health reasons (interventions through the public health system that need to be certified by medical professionals) as well as their companions, and if you have to make use of tourist accommodation because of ´fuerza mayor´within the Catalonian region, like natural catastrophes or acts of violence.
Those under 17 don´t have to pay either. They must either certify their age by passport or ID card. For those under 14 parents can certify their age, signing a ´declaración responsable´.
If you make use of tourist accommodation as part of a subsidised social government programme, like IMSERSO you also don´t have to pay the tourist tax.