diff --git a/manager.hpp b/manager.hpp
index 10af42d..8dbbcd6 100644
--- a/manager.hpp
+++ b/manager.hpp
@@ -2,12 +2,18 @@
 
 #include <map>
 #include <set>
+#include <sdbusplus/bus.hpp>
 #include "ledlayout.hpp"
 namespace phosphor
 {
 namespace led
 {
 
+/** @brief Physical LED dbus constructs */
+constexpr auto PHY_LED_PATH = "/xyz/openbmc_project/led/physical/";
+constexpr auto PHY_LED_IFACE = "xyz.openbmc_project.Led.Physical";
+constexpr auto DBUS_PROPERTY_IFACE = "org.freedesktop.DBus.Properties";
+
 /** @class Manager
  *  @brief Manages group of LEDs and applies action on the elements of group
  */
@@ -30,16 +36,20 @@
         }
 
         using group = std::set<phosphor::led::Layout::LedAction>;
+        using LedLayout = std::map<std::string, group>;
 
         /** @brief static global map constructed at compile time */
-        const std::map<std::string, group>& ledMap;
+        const LedLayout& ledMap;
 
-        /** @brief Refer the user supplied LED layout.
+        /** @brief Refer the user supplied LED layout and sdbusplus handler
          *
-         *  @param [in] ledLayout - LEDs group layout
+         *  @param [in] bus       - sdbusplus handler
+         *  @param [in] LedLayout - LEDs group layout
          */
-        explicit Manager(const std::map<std::string, Manager::group>& ledLayout)
-                : ledMap(ledLayout)
+        Manager(sdbusplus::bus::bus& bus,
+                const LedLayout& ledLayout)
+                : ledMap(ledLayout),
+                  bus(bus)
         {
             // Nothing here
         }
@@ -72,12 +82,71 @@
                        group& ledsUpdate);
 
     private:
+        /** @brief sdbusplus handler */
+        sdbusplus::bus::bus& bus;
+
         /** @brief Pointers to groups that are in asserted state */
         std::set<const group*> assertedGroups;
 
         /** @brief Contains the LEDs that are in asserted state */
         group currentState;
 
+        /** @brief Returns action string based on enum
+         *
+         *  @param[in]  action - Action enum
+         *
+         *  @return string equivalent of the passed in enumeration
+         */
+        static const char* const getPhysicalAction(Layout::Action action);
+
+        /** @brief Chooses appropriate action to be triggered on physical LED
+         *  and calls into function that applies the actual action.
+         *
+         *  @param[in]  objPath   -  dbus object path
+         *  @param[in]  action    -  Intended action to be triggered
+         *  @param[in]  dutyOn    -  Duty Cycle ON percentage
+         */
+        void drivePhysicalLED(const std::string& objPath,
+                              Layout::Action action,
+                              uint8_t dutyOn);
+
+        /** @brief Makes a dbus call to a passed in service name.
+         *  This is now the physical LED controller
+         *
+         *  @param[in]  service   -  dbus service name
+         *  @param[in]  objPath   -  dbus object path
+         *  @param[in]  property  -  property to be written to
+         *  @param[in]  value     -  Value to write
+         */
+        template <typename T>
+        void drivePhysicalLED(const std::string& service,
+                              const std::string& objPath,
+                              const std::string& property,
+                              const T& value)
+        {
+            sdbusplus::message::variant<T> data = value;
+
+            auto method = bus.new_method_call(service.c_str(), objPath.c_str(),
+                                              DBUS_PROPERTY_IFACE, "Set");
+            method.append(PHY_LED_IFACE);
+            method.append(property);
+            method.append(data);
+
+            // There will be exceptions going forward and hence don't need a
+            // response
+            bus.call_noreply(method);
+            return;
+        }
+
+        /** @brief Finds the service name given a dbus object path and interface
+         *
+         *  @param[in]  objPath    -  dbus object path
+         *  @param[in]  interface  -  dbus interface
+         *
+         *  @return: Service name or none
+         */
+        std::string getServiceName(const std::string& objPath,
+                                   const std::string& interface) const;
 };
 
 } // namespace led
