diff --git a/obmc/sensors.py b/obmc/sensors.py
index fba7a91..b8c26ed 100644
--- a/obmc/sensors.py
+++ b/obmc/sensors.py
@@ -110,7 +110,48 @@
 class PowerSupplyRedundancySensor(VirtualSensor):
     def __init__(self, bus, name):
         VirtualSensor.__init__(self, bus, name)
-        self.setValue("Enabled")
+        self.bus = bus
+        self.bus_name = 'xyz.openbmc_project.Settings'
+        self.obj_path = '/xyz/openbmc_project/control/power_supply_redundancy'
+        self.iface = 'xyz.openbmc_project.Control.PowerSupplyRedundancy'
+        self.prop_iface = 'org.freedesktop.DBus.Properties'
+        self.property_name = 'PowerSupplyRedundancyEnabled'
+        super(PowerSupplyRedundancySensor, self).setValue(self.getValue())
+
+    # Override setValue method
+    @dbus.service.method(
+        SensorValue.IFACE_NAME, in_signature='v', out_signature='')
+    def setValue(self, value):
+        if (value == "Enabled"):
+            intf = self.getPowerSupplyInterface()
+            intf.Set(self.iface, self.property_name, True)
+        elif (value == "Disabled"):
+            intf = self.getPowerSupplyInterface()
+            intf.Set(self.iface, self.property_name, False)
+        else:
+            print "Invalid Power Supply Redundancy value"
+            return
+        super(PowerSupplyRedundancySensor, self).setValue(value)
+
+    # Override getValue method
+    @dbus.service.method(
+        SensorValue.IFACE_NAME, in_signature='', out_signature='v')
+    def getValue(self):
+        intf = self.getPowerSupplyInterface()
+        value = intf.Get(self.iface, self.property_name)
+        if (value == 1):
+            return "Enabled"
+        elif (value == 0):
+            return "Disabled"
+        else:
+            print "Unable to determine Power Supply Redundancy value"
+            return ""
+
+    def getPowerSupplyInterface(self):
+        obj = self.bus.get_object(self.bus_name, self.obj_path,
+                                  introspect=True)
+        return dbus.Interface(obj, self.prop_iface)
+
 
 class PowerSupplyDeratingSensor(VirtualSensor):
     def __init__(self, bus, name):
