Help with availability template, am i going nuts?

I am trying to follow a guide to filter out rediculous energy spikes due to KWH dropping to zero at intermittent intervals before returning to the actual number, I set up a helper with an availability template to go unavailable should the value not be greater than zero, however, this template returns unavailable despite testing the template showing it returns true.

availability: {{ states(‘sensor.shellyplugusg4_48f6eece18c0_energy’) | float > 0 }}

when i remove this template, the helper shows the 4,000KWH as expected which is being pulled from

{{ states(‘sensor.shellyplugusg4_48f6eece18c0_energy’) | float }}

what am i doing wrong? can anyone help me set this up correctly? (only the shelly plug gen 4 is causing the spikes randomly or when it reboots and would like to filter out the spikes through the helper method i found on the forums)

note: i am trying to set this up from the UI

Templating Rule #1

Scratch that, just saw the note…

In the UI, you don’t keep the availability:… make sure it looks like the following in the Helper config flow:

ok, lemme try that
edit: THANKS that worked, those element tags always throw me off weather they are needed in the UI or not from case to case

One other thing… The template you pasted is using “pretty” quotes in the states function. These are often picked up from copy/pasting from improperly formatted text.

Make sure you use normal/plain quotes.

#These are pretty quotes
{{ states(‘sensor.shellyplugusg4_48f6eece18c0_energy’) | float(0) > 0 }}
#These are plain quotes
{{ states('sensor.shellyplugusg4_48f6eece18c0_energy') | float(0) > 0 }}

not sure when or how they end up fancy quotes, but i always re-type the quotes manually when pasting them into HA to avoid the quote disaster

They usually creep in when copying unformatted text from the forum.