diff --git a/dbusUtils.hpp b/dbusUtils.hpp
index 0495ceb..b664c48 100644
--- a/dbusUtils.hpp
+++ b/dbusUtils.hpp
@@ -1,6 +1,9 @@
 #include <phosphor-logging/elog-errors.hpp>
+#include <phosphor-logging/lg2.hpp>
 #include <xyz/openbmc_project/Common/error.hpp>
 
+const constexpr char* entityManagerBusName =
+    "xyz.openbmc_project.EntityManager";
 const char* propIntf = "org.freedesktop.DBus.Properties";
 const char* mapperBusName = "xyz.openbmc_project.ObjectMapper";
 const char* mapperPath = "/xyz/openbmc_project/object_mapper";
@@ -8,6 +11,7 @@
 
 const char* methodGetObject = "GetObject";
 const char* methodGet = "Get";
+const char* methodSet = "Set";
 
 using namespace sdbusplus::xyz::openbmc_project::Common::Error;
 
@@ -76,3 +80,26 @@
 
     return std::get<T>(value);
 }
+
+int setDbusProperty(sdbusplus::bus_t& bus, const std::string& service,
+                    const std::string& path, const std::string& intf,
+                    const std::string& property, const Value& value)
+{
+    try
+    {
+        auto method = bus.new_method_call(service.c_str(), path.c_str(),
+                                          propIntf, methodSet);
+        method.append(intf, property, value);
+        auto msg = bus.call(method);
+    }
+    catch (const sdbusplus::exception_t& e)
+    {
+        lg2::error(
+            "Faild to set dbus property. service:{SERVICE} path:{PATH} intf:{INTF} Property:{PROP},{ERRMSG}",
+            "SERVICE", service, "PATH", path, "INTF", intf, "PROP", property,
+            "ERRMSG", e);
+        return -1;
+    }
+
+    return 0;
+}
diff --git a/thresholds.hpp b/thresholds.hpp
index 2e42938..63e1884 100644
--- a/thresholds.hpp
+++ b/thresholds.hpp
@@ -53,14 +53,32 @@
 {
     static constexpr auto name = "Warning";
     using WarningObject::WarningObject;
+    /** @brief sdbusplus bus client connection. */
+    sdbusplus::bus::bus& bus;
+    std::string objPath;
+
+    /** @brief Virtual sensor path/interface in entityManagerDbus.
+     * This 3 value is used to set thresholds
+     */
+    std::string entityPath;
+    std::string entityInterfaceHigh;
+    std::string entityInterfaceLow;
+
+    /** @brief Constructor to put object onto bus at a dbus path.
+     *  @param[in] bus - Bus to attach to.
+     *  @param[in] path - Path to attach at.
+     */
+    Threshold(sdbusplus::bus::bus& bus, const char* path) :
+        WarningObject(bus, path), bus(bus), objPath(std::string(path))
+    {}
 
     auto high()
     {
-        return warningHigh();
+        return WarningObject::warningHigh();
     }
     auto low()
     {
-        return warningLow();
+        return WarningObject::warningLow();
     }
 
     template <typename... Args>
@@ -98,21 +116,82 @@
     {
         return warningLowAlarmDeasserted(std::forward<Args>(args)...);
     }
+
+    /** @brief Set value of WarningHigh */
+    virtual double warningHigh(double value)
+    {
+        // persistThreshold
+        setDbusProperty(bus, entityManagerBusName, entityPath,
+                        entityInterfaceHigh, "Value", value);
+        return WarningObject::warningHigh(value);
+    }
+
+    /** @brief Set value of WarningLow */
+    virtual double warningLow(double value)
+    {
+        // persistThreshold
+        setDbusProperty(bus, entityManagerBusName, entityPath,
+                        entityInterfaceLow, "Value", value);
+        return WarningObject::warningLow(value);
+    }
+
+    /** @brief Set the entitymanager interface corresponding to virtualsensor
+     * warningLow
+     */
+    void setEntityInterfaceLow(const std::string& interfaceLow)
+    {
+        entityInterfaceLow = interfaceLow;
+    }
+
+    /** @brief Set the entitymanager interface corresponding to virtualsensor
+     * warningHigh
+     */
+    void setEntityInterfaceHigh(const std::string& interfaceHigh)
+    {
+        entityInterfaceHigh = interfaceHigh;
+    }
+
+    /** @brief Set the entitymanager path corresponding to virtualsensor warning
+     */
+    void setEntityPath(const std::string& path)
+    {
+        entityPath = path;
+    }
 };
 
 template <>
 struct Threshold<CriticalObject> : public CriticalObject, public Hysteresis
 {
     static constexpr auto name = "Critical";
+
+    /** @brief sdbusplus bus client connection. */
+    sdbusplus::bus::bus& bus;
+    std::string objPath;
+
+    /** @brief Virtual sensor path/interface in entityManagerDbus.
+     * This 3 value is used to set thresholds
+     */
+    std::string entityPath;
+    std::string entityInterfaceHigh;
+    std::string entityInterfaceLow;
+
     using CriticalObject::CriticalObject;
 
+    /** @brief Constructor to put object onto bus at a dbus path.
+     *  @param[in] bus - Bus to attach to.
+     *  @param[in] path - Path to attach at.
+     */
+    Threshold(sdbusplus::bus::bus& bus, const char* path) :
+        CriticalObject(bus, path), bus(bus), objPath(std::string(path))
+    {}
+
     auto high()
     {
-        return criticalHigh();
+        return CriticalObject::criticalHigh();
     }
     auto low()
     {
-        return criticalLow();
+        return CriticalObject::criticalLow();
     }
 
     template <typename... Args>
@@ -150,6 +229,46 @@
     {
         return criticalLowAlarmDeasserted(std::forward<Args>(args)...);
     }
+
+    /** @brief Set value of CriticalHigh */
+    virtual double criticalHigh(double value)
+    {
+        // persistThreshold
+        setDbusProperty(bus, entityManagerBusName, entityPath,
+                        entityInterfaceHigh, "Value", value);
+        return CriticalObject::criticalHigh(value);
+    }
+
+    /** @brief Set value of CriticalLow */
+    virtual double criticalLow(double value)
+    {
+        setDbusProperty(bus, entityManagerBusName, entityPath,
+                        entityInterfaceLow, "Value", value);
+        return CriticalObject::criticalLow(value);
+    }
+
+    /** @brief Set the entitymanager interface corresponding to virtualsensor
+     * criticalLow
+     */
+    void setEntityInterfaceLow(const std::string& interfaceLow)
+    {
+        entityInterfaceLow = interfaceLow;
+    }
+
+    /** @brief Set the entitymanager interface corresponding to virtualsensor
+     * criticalLow
+     */
+    void setEntityInterfaceHigh(const std::string& interfaceHigh)
+    {
+        entityInterfaceHigh = interfaceHigh;
+    }
+
+    /** @brief Set the entitymanager path corresponding to virtualsensor warning
+     */
+    void setEntityPath(const std::string& path)
+    {
+        entityPath = path;
+    }
 };
 
 template <>
diff --git a/virtualSensor.cpp b/virtualSensor.cpp
index 5e4ca5f..063fb0f 100644
--- a/virtualSensor.cpp
+++ b/virtualSensor.cpp
@@ -188,7 +188,8 @@
     return severity;
 }
 
-void parseThresholds(Json& thresholds, const PropertyMap& propertyMap)
+void parseThresholds(Json& thresholds, const PropertyMap& propertyMap,
+                     const std::string& entityInterface = "")
 {
     std::string direction;
 
@@ -210,6 +211,11 @@
     {
         thresholds[threshold + "Hysteresis"] = hysteresis;
     }
+
+    if (!entityInterface.empty())
+    {
+        thresholds[threshold + "Direction"] = entityInterface;
+    }
 }
 
 void VirtualSensor::parseConfigInterface(const PropertyMap& propertyMap,
@@ -415,7 +421,7 @@
          * eg xyz.openbmc_project.Configuration.ModifiedMedian.Thresholds1 */
         if (interface.find(vsThresholdsIntf) != std::string::npos)
         {
-            parseThresholds(thresholds, propertyMap);
+            parseThresholds(thresholds, propertyMap, interface);
         }
         else if (interface == calculationIface)
         {
@@ -568,6 +574,34 @@
             threshold.value("CriticalHighHysteresis", defaultHysteresis));
         criticalIface->setLowHysteresis(
             threshold.value("CriticalLowHysteresis", defaultHysteresis));
+
+        if (threshold.contains("CriticalHigh"))
+        {
+            criticalIface->setEntityInterfaceHigh(
+                threshold.value("CriticalHighDirection", ""));
+            if (DEBUG)
+            {
+                debug("Sensor Threshold:{NAME} = intf:{INTF}", "NAME", objPath,
+                      "INTF", threshold.value("CriticalHighDirection", ""));
+            }
+        }
+        if (threshold.contains("CriticalLow"))
+        {
+            criticalIface->setEntityInterfaceLow(
+                threshold.value("CriticalLowDirection", ""));
+            if (DEBUG)
+            {
+                debug("Sensor Threshold:{NAME} = intf:{INTF}", "NAME", objPath,
+                      "INTF", threshold.value("CriticalLowDirection", ""));
+            }
+        }
+
+        criticalIface->setEntityPath(entityPath);
+        if (DEBUG)
+        {
+            debug("Sensor Threshold:{NAME} = path:{PATH}", "NAME", objPath,
+                  "PATH", entityPath);
+        }
     }
 
     if (threshold.contains("WarningHigh") || threshold.contains("WarningLow"))
@@ -583,6 +617,34 @@
             threshold.value("WarningHighHysteresis", defaultHysteresis));
         warningIface->setLowHysteresis(
             threshold.value("WarningLowHysteresis", defaultHysteresis));
+
+        if (threshold.contains("WarningHigh"))
+        {
+            warningIface->setEntityInterfaceHigh(
+                threshold.value("WarningHighDirection", ""));
+            if (DEBUG)
+            {
+                debug("Sensor Threshold:{NAME} = intf:{INTF}", "NAME", objPath,
+                      "INTF", threshold.value("WarningHighDirection", ""));
+            }
+        }
+        if (threshold.contains("WarningLow"))
+        {
+            warningIface->setEntityInterfaceLow(
+                threshold.value("WarningLowDirection", ""));
+            if (DEBUG)
+            {
+                debug("Sensor Threshold:{NAME} = intf:{INTF}", "NAME", objPath,
+                      "INTF", threshold.value("WarningLowDirection", ""));
+            }
+        }
+
+        warningIface->setEntityPath(entityPath);
+        if (DEBUG)
+        {
+            debug("Sensor Threshold:{NAME} = path:{PATH}", "NAME", objPath,
+                  "PATH", entityPath);
+        }
     }
 
     if (threshold.contains("HardShutdownHigh") ||
