Does a JS profile transformation inherit units?

Almost there!

I have now reprogrammed my (ESP-based) sensor by deleting the battery voltage unit in the source code.

I also had to clean mosquitto DB according to this tutorial

In mosquitto, I read

openhabian@openhabHost:~ $ mosquitto_sub  -v   -t homie/esp_gateway/kidsBedroomTH/battery/#
homie/esp_gateway/kidsBedroomTH/battery/$name Battery
homie/esp_gateway/kidsBedroomTH/battery/$datatype float
homie/esp_gateway/kidsBedroomTH/battery 4.08

I am now able to link this channel to the existing equipment and getting voltage (w/o unit) and battery level (in %) right.

Thanks!
Max