Get monthly traffic from Unifi controller / round-up issue

For my network dashboard I’m trying to get the monthly (to date) internet usage in Megabytes/Gigabytes. I tried getting something from this topic: Bandwidth monitor from unifi controller
But that gives the ‘current’ bandwidth usage. Is there an option with the USG integration to get the total traffic (not bandwidth) so that I can put that in a graph for example? As far as I can see, the integration only gives devices bandwidth sensors, not the complete wan traffic used

Also, the rounding doesn’t seem to work correct. It seems that round is not even working here:

{{ states(‘sensor.usg_wan_in_stats’) | float(0)*8/1024/1024 }} = 7.742638931274414

{{ states(‘sensor.usg_wan_in_stats’) | float(0)*8/1024/1024 | round(2) }} = 7.742638931274414

Any help appreciated :slight_smile: