Beem Energy Solar Power

Hi,
I want to monitor my Beem Energy Solar panels in HA.
Run into this artical:

But when i try to create a template with this code i get this error: UndefinedError: ‘value_json’ is undefined !
Is there somebody who runs in the same error and has a fix, or is there somebody who has a working configuration and can help me a bit?

Thank you very much.
Lennart