Change sensor type to a string and then parse the string.