Decimal numbers: point/comma mess

Unfortunately I created this post in German at first. Now here is the translation to English:

I created this sensor to report the daily PV-yield (Tagesertrag) in kWh.
The source provided by the SMA integration is in Wh.

 tagesertrag:
        unique_id: "sensor_tagesertrag"
        friendly_name: "Tagesertrag"
        unit_of_measurement: "kWh"
        value_template: "{{ (states('sensor.sn_3001234053_daily_yield') | float / 1000) }}"

When I use the sensor on the Dashboard, 54,123 kWh is shown correctly (European format) with the “,” as decimal separator.

But when I issue the value with this code …

    message: "Todays yield is {{ states('sensor.tagesertrag') | float }} Kilowatthours"
      action: notify.alexa_media_last_called

… on Alexa, it says:

“Todays yield is 54123 Kilowatthours” (54thousandonehundredtwentythree) … ignoring any decimal separator.

If I change the code to …

message: "Todays yield is {{ states('sensor.tagesertrag') | float | round(1) }} Kilowatthours"

… Alexa says:

“Todays yield is 54.1 Kilowatthours” (54 point 1)

Only if I add the replace instruction …

message: "Todays yield is {{ states('sensor.tagesertrag') | float | round(1) | replace('.', ',') }} Kilowatthours"

… it is reported correctly using a comma as separator :

“Todays yield is 54,1 Kilowatthours” (54 comma 1)

Why is the comma shown on the dashboard, then ignored and later replace by a point?
This is pretty confusing and looks inconsistent.
Or am I doing something wrong?

Hi Sir_Goodenough,

thanks … and sorry.
Usually I’m aware of this, but missed it yesterday completely. :roll_eyes:

Bacchus

DM me when you’re ready to edit it to English and I’ll unlock the topic - or start a fresh one in English.