home assistant gives me a value that is 1.540 relative to the price of diesel. you can convert this value to 1,540.
of course this value is a variable. alexa gives me a value like one thousand five hundred and forty euros while it should be pronounced as one point five hundred and forty euros. thanks
this is the variable
The price of diesel is {{states (“sensor.distributore_eni_diesel_speciale_self_service”)}} €
Try this:
{{states(“sensor.distributore_eni_diesel_speciale_self_service”)|regex_replace(find='.', replace=',', ignorecase=False)}}
now it does not provide the value. says only €
Double-check your usage of quotes - single-quote, double-quote, correct quotes.
Double check your syntax with the template editor.
Otherwise this might also work:
{{ (states(“sensor.distributore_eni_diesel_speciale_self_service”) | int) / 1000 }}
the value now is 0.001 ???
the original value is 1.541
thi is correct
{{ states(“sensor.distributore_eni_diesel_speciale_self_service”)|replace(’.’, ‘,’) }}
1 Like