State_with_unit: do not show uom if unavailable/unknown

Currently “state_with_unit” shows a UoM when a sensor is “unavailable”:

This is why I am not using “state_with_unit”, have to compose an output dependently on a current state.
Suggest to not add UoM if a state is “unavailable”. Probably similarly an “unknown” should be processed.

Nice FR, voted. To save anyone checking, it also behaves like this when called as a function:

Nick, no, please check this:

Sorry realised that and deleted post. Sorry for the noise.

1 Like