I’ve put it in the template editor and it worked, the value of the pot is displayed! Already a victory for me! 
But I still get the same error as before:
Message malformed: expected float for dictionary value @ data['brightness_pct]
I think I have to convert the variable type form string to float. But I don’t know how to do that.
Thank you very much! 