Bathroom thermostats for heating mats and cables available in stores can have different degrees of protection provided by the housing. It is very common to find devices marked IP21. This means that the thermostat is resistant to dust and falling vertical drops of water. This level of protection of the housing is insufficient.
Read Electrical protection zones in the bathroom.

A good way to do this may be to attach an additional gasket, which will increase the protection of the device from water. In this way, the device can be considered equivalent to an IP44 bathroom thermostat. However, if it is not possible to increase the safety of the device, you should refrain from installing this type of thermostat in the bathroom. It is better to purchase a model that is factory-protected against splashing water from any direction, that is, marked as IP44. Only this type of device is allowed to be installed in bathrooms – so that they do not pose a threat to the life and health of the people inside.
Increasing the protection of the thermostat

To protect the thermostat from splashes of water, use a special gasket designed for this purpose. It is made of a special material that prevents water from entering the electrical system. The gasket is installed between the bathroom wall and the temperature control device.
In this way, you will thoroughly seal the connection of the device to the network, as well as protect the connections from water running off the walls. An example of this type of seal is nVent RAYCHEM R-SENZ-ACC-IP44GASKET. After its installation, the nVent RAYCHEM SENZ WIFI thermostat can be safely installed inside the bathroom without posing a danger to users.