When I paste the state {{ '{0:,.3f}'.format( states('counter.gaszahler_h') | float * 0.001) }}
into the developer tools template editor then I get the value I expect, such as 14,026.519
But when using this entity in my dashboard, it shows as ‘Unavailable’.
When I leave the comma in place, an error is logged and the system refuses to create the sensor entity.
When I remove the comma, a warning is logged because the sensor’s device_class is gas but it’s missing unit_of_measurement with either ft³, m³, or CCF.
When I remove the comma and add unit_of_measurement: 'm³' the sensor is created and displays a numeric value.
Please consider marking my post above with the Solution tag. It will automatically place a check-mark next to the topic’s title which signals to other users that this topic has been resolved. This helps users find answers to similar questions.