How do I use a template to figure out a percentage?

I’m using the Fido component ( https://home-assistant.io/components/sensor.fido/ ) to display my cell phone account information such as data remaining, data used, etc.

I’d like to configure a template that shows me the percentage of data used based on the values for data used and data limit.

For example: ‘sensor.fido_PHONENUMBER_data_limit’ shows my data limit while ‘sensor.fido_PHONENUMBER_data_used’ shows the total data I’ve used.

How would I create a template that takes these two values to show me a percentage used?

{{states.sensor.fido_PHONENUMBER_data_used.state/states.sensor.fido_PHONENUMBER_data_limit.state*100}}

2 Likes