Hey, someone might have a tipp for me? I try to measure my upload, therfore the firtzbox component provides me with an attribute which I templated into a sensor.
FYI, by using the state_attr() function, and the int() filter with a default value, if the state is ever None, or something completely unexpected, you won’t get an error, but rather simply the value zero. Also, your template wouldn’t work too well with numbers that were above or below kB range (e.g., zero, which would return “0 Bytes”), so I took the liberty of dealing with that, too.
You might also want to check out the Filter Sensor if you haven’t already.
Thanks I’ll give it a try. Looks good and works as expected . Regarding the root cause, I have no idea how to debug this since the value is coming directly from the fritzbox.
What I didn’t understand yet, how does this code work? Is everything prefixed with the {% interpreted as python code? I have a hard time finding the proper documentation for this…
Nevermind, if finally found the reference to Jinja2. Thanks again for pointing me there.