Change the . to , in a state

So I wanted my Google to anounce the electricity price when asked.

I have a sensor for the price:

strømpris

Only problem is that with it being a “.” instead of a “,” - google announces it as one thousand nine hundred and thirty four, instead of the correct “one point nine three four”

Is there a workaround for this?

Weird, as If I send the following message to my google hub:

message: '{{states(''sensor.electric_tariff_standing'')}}'

It reads out “zero point two four seven” etc, so correctly speaks the value, so not sure why yours is not.

However you could try the following and see what happens:
(Replacing the sensor for yours of course )

message: '{{states(''sensor.electric_tariff_standing'').replace(''.'',''point'')}}'

Might be the language as mine is in norwegian?

I tried this, but it only ends up saying “unknown”.

service: tts.cloud_say
data:
  message: '{{states(''sensor.electricity_price_vardane_214'').replace(''.'',''point'')}}'
  entity_id: media_player.home_mini_gang

Honesty, not sure then. Both of my above examples work for me and both result in the same correct reading by google :man_shrugging:

I got it working by switching to

service: tts.google_translate_say

Maybe tts.cloud_say thats not liking it

Well so far - not so good.

service: tts.google_translate_say
data:
  message: 'Prisen er nå {{states(''sensor.strom_pris'').replace(''.'',''kroner og'')}} øre.'
  entity_id: media_player.nest_hub_stue
  language: 'no'

Now it says “two point one hundred and three kroner” for the number 2.103.

I tried shorting it down to two decimals with this:

- platform: template
  sensors:
    strom_pris:
      value_template: "{{ '%.2f'%(states('sensor.electricity_price_vardane_214') | float) }}"
      friendly_name: 'Strømpris'
      unit_of_measurement: 'kr'

But that turned it into 2.1 and not 2.10, which translates google to saying 1 cent (øre) and not 10 cents (øre).

Why does allways something I think is easy - turn out so difficult :stuck_out_tongue: