RSSI wifi conversion to percentages

I use wifi and would like to convert RSSI to meaningful percentages. I was considering a MAP conversion. Could something like this be done within RSSI wifi?
My idea for RSSI to a percentage:

map(value, -90, -20, 0, 100); // (value, fromLow, fromHigh, toLow, toHigh)

if the function RSSI() returns an integer you can do this
if RSSI() returns not an integer the value must be casted to an integer.

best regards Stefan

If you use the WiFi.RSSI() function as described in

https://www.arduino.cc/en/Reference/WiFiRSSI

it returns a long value

   // print the received signal strength:
  long rssi = WiFi.RSSI();

The function map() is defined according to

https://www.arduino.cc/reference/en/language/functions/math/map/

as follows

image

If this is done that way and the input might become lesser as fromLow or higher as fromHigh, values below 0% or above 100% would occur. If this might happen and is not intended, you could limit the input data before you hand them over to map() (or adjust the limits in map() alternatively).

Regards
ec2021

Percentage of what?

RSSI are absolute values typically reported in dBm, which means dB relative to 1mW.

Do you want percentage of a dBm value on a logarithmic dB scale or conversion to a linear mW scale? And, again, percentage of what maximum value?

A valid question with regard to meaningful in the first post

I skipped this word and just interpreted the task as to convert a certain part of the dBm scale to a scale between 100% and 0%. That could be useful to display the RSSI values with a graph bar where you stick to the scaling of dBm as they are.

That would not change the sense/impact of dBm data, so: Is there any other intention of creating "meaningful" data here than just convert them into a 100% scale?