Is it possible to split decimal number?

Hello,

I am using a lot the TTS (Nabu Casa @ Greek) and the sensor temperature is not called properly.
The TTS engine cannot read commas.
For example a sensor with 14.9 Celsius, when TTS, the engine will say “fourteen nine Celsius” instead of “fourteen point 9 Celsius”.

So I was thinking if is possible to split the number to the integer and decimal part?

I have the following sensor:

Is it possible to split the number to integer and decimal part ??

I can get the int part by the following

{% set int_number = states('sensor.attic_left_room_temperature') | int(0) %}

{{ int_number }}

But how to get the decimal part???

e.g. sensor1 = 14, sensor2 = 5

So when TTS the engine will say " Today’s temperature is {{ sensor1 }} comma {{ sensor2 }} Celsius"

Is it possible please?

{{ states('sensor.attic_left_room_temperature') | replace("."," comma ") }}

But honestly I think the main reason is the TTS engine assuming the wrong language / locale.

first of all thank you.
The language is defined correctly! Please have a look if you like but it’s all greek … :slight_smile:

  - service: tts.cloud_say
    data:
      entity_id: |
        {{ states('input_select.set_fireos_for_tts') }}
      message: >
        Το νερό έχει ζεσταθεί.{{'\n'}}Η θερμοκρασία νερού είναι {{
        states('sensor.boiler_hot_water') }} βαθμούς Κελσίου!
      language: el-GR

Once you get integer part of the value subtract it from the original value and you will get decimal part.
Multiple by 10 to get integer from decimal.

I have similar issue, managed to work out TTS to speak Serbian,
but on the end of sentence (temperature sensor reading) it says for instance ninth instead nine on Serbian.

here is the service call

service: tts.google_translate_say
data:
  cache: true
  entity_id: media_player.vlc_telnet
  language: sr
  message: Temperatura je trenutno {{states('sensor.temperatura_sever') | round(1) | replace("."," koma ") }}.

Any idea why TTS engine does this