Templating works in Dev Tools but not in Button-Card configuration

Hi all,

after trying hard to get a service-call (that runs in DEV-Tools) running in UI i am thankful for some help.

This service-call runs fine in DEV-Tools:
2023-09-25_09h51_04

But (after trying several options in UI) i always get “…expected int for…”

Custom Button Card is based on Javascript, not Jinja.

max_charge: |
  [[[ return states['input_number.TYPE_IN_THE_REST'].state; ]]]
1 Like

Also keep in mind that the frontend typically doesn’t support any templating. This includes templating for tap actions.

Thanks @pedolsky,
after trying your suggestion i got the same error. But this was because of the missing “| int”
I implemented parseInt() and now it works.

max_charge: |
  [[[ return parseInt(states["input_number.e3dc_ladeleistung"].state); ]]]