Add a customize include under homeassistant to your configuration.yaml file if it does not exist.
homeassistant:
customize: !include customize.yaml
Create the customize.yaml file in your /config folder and add the following inside it:
sensor.rain_total:
unit_of_measurement: 'mm'
Assuming that sensor.rain_total is actually the sensor entity_id you need to change the unit of.