Search and you will find this question asked a bunch with no way of doing what you want. Example: Change labels of child device programatically?
With that said see this for a work around: https://github.com/vseven/SmartThings_VSeven/blob/master/devicetypes/vseven/enhanced-konnected-contact-sensor.src/enhanced-konnected-contact-sensor.groovy