I would like to hide the “x timer” (x hours in Norwegian) when x is 0, so it will only show minutes, not hours. This is the code for one of the entries:
**Best:** {{ states('sensor.bensinpris_hos_best_mandal') }}, oppdatert for {{ states('sensor.bensinpris_oppdatert_timer_hos_best_mandal') }} timer og {{ states('sensor.bensinpris_oppdatert_minutter_hos_best_mandal') }} minutter siden
But in this case it would probably be easier to just do
**Best:** {{ (states('sensor.bensinpris_hos_best_mandal') }}, oppdatert for {{ states('sensor.bensinpris_oppdatert_timer_hos_best_mandal') }} timer og {{ states('sensor.bensinpris_oppdatert_minutter_hos_best_mandal')).replace('0 timer og','') }} minutter siden
The truck is that this should replace the text you want to remove with nothing and because the 0 is included in the replace command, then other values should not be affected.