Template issue with Helper

Hello, I want to see the actual power consumption of devices in my house. For that I have created 1) a Helper Group (Apparaten met verbruiksstekker) that holds all relevant devices 2) a Template that selects only the Devices that have a value and it works fine in the Developer Tool and 3) a Helper Template which should do the exact same thing but allows me to put it on a Dashboard. See screenprints. This Helper gives the value of “Niet beschikbaar” (Not available). Why is the Template on Dev Tool working and why doesn’t it work on a Helper? I have searched around but can’t find what the problem nor a solution. Any help welcome.

Just curious, your code is different between screenshots. int vs int(0)

It’s also best if you post your code using the community standards

You are providing the entire code for a YAML created template sensor in the field where only a template is expected

You only should provide the actual template, which is te part with the curly brackets:
{{expand('sensor.apparaten_met_vebruiksstekker') | selectattr('state', 'ne', 'unavailable') | map(attribute='state') | map('int') | sum }}

Thanks for your response. You’re correct the code should have been the same. The (0) was in error.
I also found something on code sharing and a screenshot is not considered a good idea however I wanted to show the different results I got; on Dev Tools it worked, on the Helper it did not.
The response from @TheFes solved the problem (together with removing the (0)).

That made the difference and it now works. Thanks for your reply!