Rename devices in MQTT messages?

Hi there,

we are deploying devices at different locations (not known upfront when we register the devices, sometimes moved from time to time etc). Therefore our devices are registered as device01, device02 etc
Would be great if we could rename them to the actual location so that the mqtt stream we feed into influxdb already contains an indication about the location.

what I’m looking for is either to modify the deviceID / deviceName entry in the MQTT message, or to add a custom field “location” into it, value would be set according to the deviceID.

is this feasible ? can a custom field be added through the custom payload decoder code ?

or is such a name conversion rather something to be performed in the backend, i.e. after receiving the MQTT message and before feeding it into infludb ?

many thanks