diff --git a/include/sensorutils.hpp b/include/sensorutils.hpp
index 30fee66..4cb4c29 100644
--- a/include/sensorutils.hpp
+++ b/include/sensorutils.hpp
@@ -17,7 +17,6 @@
 #pragma once
 #include <cmath>
 #include <iostream>
-#include <ipmid/api.hpp>
 #include <phosphor-logging/log.hpp>
 
 namespace ipmi
@@ -132,7 +131,7 @@
         bExp -= 1;
     }
 
-    mValue = static_cast<int16_t>(mDouble) & maxInt10;
+    mValue = static_cast<int16_t>(std::round(mDouble)) & maxInt10;
     bValue = static_cast<int16_t>(bDouble) & maxInt10;
 
     return true;
diff --git a/src/sensorcommands.cpp b/src/sensorcommands.cpp
index abc5609..50a640a 100644
--- a/src/sensorcommands.cpp
+++ b/src/sensorcommands.cpp
@@ -143,22 +143,66 @@
         }
     });
 
-static void
-    getSensorMaxMin(const std::map<std::string, DbusVariant> &sensorPropertyMap,
-                    double &max, double &min)
+static void getSensorMaxMin(const SensorMap &sensorMap, double &max,
+                            double &min)
 {
-    auto maxMap = sensorPropertyMap.find("MaxValue");
-    auto minMap = sensorPropertyMap.find("MinValue");
     max = 127;
     min = -128;
 
-    if (maxMap != sensorPropertyMap.end())
+    auto sensorObject = sensorMap.find("xyz.openbmc_project.Sensor.Value");
+    auto critical =
+        sensorMap.find("xyz.openbmc_project.Sensor.Threshold.Critical");
+    auto warning =
+        sensorMap.find("xyz.openbmc_project.Sensor.Threshold.Warning");
+
+    if (sensorObject != sensorMap.end())
     {
-        max = variant_ns::visit(VariantToDoubleVisitor(), maxMap->second);
+        auto maxMap = sensorObject->second.find("MaxValue");
+        auto minMap = sensorObject->second.find("MinValue");
+
+        if (maxMap != sensorObject->second.end())
+        {
+            max = variant_ns::visit(VariantToDoubleVisitor(), maxMap->second);
+        }
+        if (minMap != sensorObject->second.end())
+        {
+            min = variant_ns::visit(VariantToDoubleVisitor(), minMap->second);
+        }
     }
-    if (minMap != sensorPropertyMap.end())
+    if (critical != sensorMap.end())
     {
-        min = variant_ns::visit(VariantToDoubleVisitor(), minMap->second);
+        auto lower = critical->second.find("CriticalLow");
+        auto upper = critical->second.find("CriticalHigh");
+        if (lower != critical->second.end())
+        {
+            double value =
+                variant_ns::visit(VariantToDoubleVisitor(), lower->second);
+            min = std::min(value, min);
+        }
+        if (upper != critical->second.end())
+        {
+            double value =
+                variant_ns::visit(VariantToDoubleVisitor(), upper->second);
+            max = std::max(value, max);
+        }
+    }
+    if (warning != sensorMap.end())
+    {
+
+        auto lower = warning->second.find("WarningLow");
+        auto upper = warning->second.find("WarningHigh");
+        if (lower != warning->second.end())
+        {
+            double value =
+                variant_ns::visit(VariantToDoubleVisitor(), lower->second);
+            min = std::min(value, min);
+        }
+        if (upper != warning->second.end())
+        {
+            double value =
+                variant_ns::visit(VariantToDoubleVisitor(), upper->second);
+            max = std::max(value, max);
+        }
     }
 }
 
@@ -322,7 +366,7 @@
 
     double max;
     double min;
-    getSensorMaxMin(sensorObject->second, max, min);
+    getSensorMaxMin(sensorMap, max, min);
 
     int16_t mValue = 0;
     int16_t bValue = 0;
@@ -446,15 +490,9 @@
         return IPMI_CC_RESPONSE_ERROR;
     }
 
-    auto sensorObject = sensorMap.find("xyz.openbmc_project.Sensor.Value");
-
-    if (sensorObject == sensorMap.end())
-    {
-        return IPMI_CC_RESPONSE_ERROR;
-    }
     double max = 0;
     double min = 0;
-    getSensorMaxMin(sensorObject->second, max, min);
+    getSensorMaxMin(sensorMap, max, min);
 
     int16_t mValue = 0;
     int16_t bValue = 0;
@@ -584,7 +622,7 @@
 
         double max;
         double min;
-        getSensorMaxMin(sensorPair->second, max, min);
+        getSensorMaxMin(sensorMap, max, min);
 
         int16_t mValue = 0;
         int16_t bValue = 0;
diff --git a/tests/test_sensorcommands.cpp b/tests/test_sensorcommands.cpp
index 4e6be85..a0ca740 100644
--- a/tests/test_sensorcommands.cpp
+++ b/tests/test_sensorcommands.cpp
@@ -62,7 +62,7 @@
     if (result)
     {
         EXPECT_EQ(bSigned, false);
-        EXPECT_EQ(mValue, floor(16000.0 / 0xFF));
+        EXPECT_EQ(mValue, floor((16000.0 / 0xFF) + 0.5));
         EXPECT_EQ(rExp, 0);
         EXPECT_EQ(bValue, 0);
         EXPECT_EQ(bExp, 0);
@@ -128,6 +128,24 @@
     expected = 5 / (mValue * std::pow(10, rExp));
     EXPECT_NEAR(scaledVal, expected, expected * 0.01);
 
+    // reading = max example
+    maxValue = 277;
+    minValue = 0;
+
+    result = ipmi::getSensorAttributes(maxValue, minValue, mValue, rExp, bValue,
+                                       bExp, bSigned);
+    EXPECT_EQ(result, true);
+    if (result)
+    {
+        EXPECT_EQ(bSigned, false);
+    }
+
+    scaledVal = ipmi::scaleIPMIValueFromDouble(maxValue, mValue, rExp, bValue,
+                                               bExp, bSigned);
+
+    expected = 0xFF;
+    EXPECT_NEAR(scaledVal, expected, expected * 0.01);
+
     // 0, 0 failure
     maxValue = 0;
     minValue = 0;
