Microsoft TTS not recognising negative and decimal numbers

When my weather contains negative temperatures or when they are decimal the MS TTS interprets this incorrectly, e.g.

Value: -3
Spoken: Three

Value: 4.5
Spoken: 4 [pause] 5

Does HA jinja magic have the capability to replace the - symbol with the word “minus” when it is in front of a number? Same with the decimals, could I replace 4.5 with “4 comma 5”?

Or… is there a way to make the MS TTS know that they are actual numeric values?

You could try

message: "Temperature is {{ states('sensor.temperature') | replace('.',',') | replace('-','minus') }} degrees "

Works for me.

4 Likes

Thanks for the post. It also works well in tts.cloud_say