Could you describe what does ‘publishing to ha’ mean? do you create ha entity from data in mqtt?
And related question: why do you publish through mqtt since NR can create HA entity and set its state directly.
regardless questions above you have to debug values on every stage:
in NR, using debug node
in mqtt using some mqtt browser app, for example MQTT explorer application
3 values stored in destination sensor (in dev tools tab of HA)
it will eventually show the stage where the issue is visible for the first time.
NodeRed and its debug for sure doesn’t respect HA formatting settings.
Not sure if entities page in dev tools respects fornatting or shows raw values. IMO formatting is mainly to be applied on cards.
Anyway afaik states are always stored as string. So once storing them into entity (ie sensor) they are converted to string.
Not sure where and what decides that the picked value from a sensor is a number. Maybe device class or unit ms decide about that.
can you paste settings of your entity node. you can also click on entity’s more info icon. opened window should show units and possibly reflects ha formatting