Change unit_of_measurement of sensor.openwrt_router_b_sent from B to GB

I have an OpenWrt router and HASS integrated with UPnP/IGD , The upnp integration collect network statistics from router such as bytes in/out and packets in/out.

But the entity sensor.openwrt_router_b_sent use B as unit_of_measurement so the number is too long, how can I change it from B to GB?


My HASS version is Home Assistant OS 6.1, core-2021.7.4


Create a template sensor that uses this sensor and calculates the desired values → Template - Home Assistant

1 Like

Thank you very much!

What about handling the fact that this value seem to be wrapping constantly?
Any hint on a template sensor that compensates for this?
I have tried to make something out of the examples in SNMP bandwidth monitor using statistics and a utility meter but not got it working

My first post in that link contains an update (“UPDATE (2022-02-20)”) that deals with the wrap-around.