diff --git a/buffet/commands/command_instance_unittest.cc b/buffet/commands/command_instance_unittest.cc
index 1afd8c7..56c9023 100644
--- a/buffet/commands/command_instance_unittest.cc
+++ b/buffet/commands/command_instance_unittest.cc
@@ -168,7 +168,7 @@
             first->GetMessage());
   auto inner = error->GetInnerError();
   EXPECT_EQ("invalid_parameter_value", inner->GetCode());
-  EXPECT_EQ("Invalid parameter value for property 'volume'",
+  EXPECT_EQ("Invalid value for property 'volume'",
             inner->GetMessage());
   EXPECT_EQ("command_failed", error->GetCode());
   EXPECT_EQ("Failed to validate command 'robot.speak'", error->GetMessage());
diff --git a/buffet/commands/schema_utils.cc b/buffet/commands/schema_utils.cc
index aaa5050..4106511 100644
--- a/buffet/commands/schema_utils.cc
+++ b/buffet/commands/schema_utils.cc
@@ -127,8 +127,13 @@
       const base::Value* param_value = nullptr;
       CHECK(dict->GetWithoutPathExpansion(pair.first, &param_value))
           << "Unable to get parameter";
-      if (!value->FromJson(param_value, error))
+      if (!value->FromJson(param_value, error)) {
+        chromeos::Error::AddToPrintf(error, errors::commands::kDomain,
+                                     errors::commands::kInvalidPropValue,
+                                     "Invalid value for property '%s'",
+                                     pair.first.c_str());
         return false;
+      }
       value_out->insert(std::make_pair(pair.first, std::move(value)));
     } else if (def_value) {
       std::shared_ptr<PropValue> value = def_value->Clone();
@@ -162,7 +167,7 @@
     if (!prop_type->ValidateConstraints(*pair.second, error)) {
       chromeos::Error::AddToPrintf(error, errors::commands::kDomain,
                                    errors::commands::kInvalidPropValue,
-                                   "Invalid parameter value for property '%s'",
+                                   "Invalid value for property '%s'",
                                    pair.first.c_str());
       return false;
     }
@@ -192,5 +197,92 @@
   return str;
 }
 
+chromeos::Any PropValueToDBusVariant(const PropValue* value) {
+  if (value->GetType() != ValueType::Object)
+    return value->GetValueAsAny();
+  // Special case for object types.
+  // Convert native_types::Object to chromeos::dbus_utils::Dictionary
+  chromeos::dbus_utils::Dictionary dict;
+  for (const auto& pair : value->GetObject()->GetValue()) {
+    // Since we are inserting the elements from native_types::Object which is
+    // a map, the keys are already sorted. So use the "end()" position as a hint
+    // for dict.insert() so the destination map can optimize its insertion
+    // time.
+    chromeos::Any prop = PropValueToDBusVariant(pair.second.get());
+    dict.emplace_hint(dict.end(), pair.first, std::move(prop));
+  }
+  return chromeos::Any(std::move(dict));
+}
+
+std::shared_ptr<const PropValue> PropValueFromDBusVariant(
+    const PropType* type,
+    const chromeos::Any& value,
+    chromeos::ErrorPtr* error) {
+  std::shared_ptr<const PropValue> result;
+  if (type->GetType() != ValueType::Object) {
+    result = type->CreateValue(value, error);
+    if (result && !type->ValidateConstraints(*result, error))
+      result.reset();
+    return result;
+  }
+
+  // Special case for object types.
+  // We expect the |value| to contain chromeos::dbus_utils::Dictionary, while
+  // PropValue must use native_types::Object instead. Do the conversion.
+  if (!value.IsTypeCompatible<chromeos::dbus_utils::Dictionary>()) {
+    type->GenerateErrorValueTypeMismatch(error);
+    return result;
+  }
+  const auto& dict = value.Get<chromeos::dbus_utils::Dictionary>();
+  native_types::Object obj;
+  CHECK(nullptr != type->GetObjectSchemaPtr())
+      << "An object type must have a schema defined for it";
+  std::set<std::string> keys_processed;
+  // First go over all object parameters defined by type's object schema and
+  // extract the corresponding parameters from the source dictionary.
+  for (const auto& pair : type->GetObjectSchemaPtr()->GetProps()) {
+    const PropValue* def_value = pair.second->GetDefaultValue();
+    auto it = dict.find(pair.first);
+    if (it != dict.end()) {
+      const PropType* prop_type = pair.second.get();
+      CHECK(prop_type) << "Value property type must be available";
+      auto prop_value = PropValueFromDBusVariant(prop_type, it->second, error);
+      if (!prop_value) {
+        chromeos::Error::AddToPrintf(error, errors::commands::kDomain,
+                                     errors::commands::kInvalidPropValue,
+                                     "Invalid value for property '%s'",
+                                     pair.first.c_str());
+        return result;
+      }
+      obj.emplace_hint(obj.end(), pair.first, std::move(prop_value));
+    } else if (def_value) {
+      std::shared_ptr<const PropValue> prop_value = def_value->Clone();
+      obj.emplace_hint(obj.end(), pair.first, std::move(prop_value));
+    } else {
+      ErrorMissingProperty(error, pair.first.c_str());
+      return result;
+    }
+    keys_processed.insert(pair.first);
+  }
+
+  // Make sure that we processed all the necessary properties and there weren't
+  // any extra (unknown) ones specified, unless the schema allows them.
+  if (!type->GetObjectSchemaPtr()->GetExtraPropertiesAllowed()) {
+    for (const auto& pair : dict) {
+      if (keys_processed.find(pair.first) == keys_processed.end()) {
+        chromeos::Error::AddToPrintf(error, errors::commands::kDomain,
+                                     errors::commands::kUnknownProperty,
+                                     "Unrecognized property '%s'",
+                                     pair.first.c_str());
+        return result;
+      }
+    }
+  }
+
+  result = type->CreateValue(std::move(obj), error);
+  if (result && !type->ValidateConstraints(*result, error))
+    result.reset();
+  return result;
+}
 
 }  // namespace buffet
diff --git a/buffet/commands/schema_utils.h b/buffet/commands/schema_utils.h
index 3f84b19..a05d080 100644
--- a/buffet/commands/schema_utils.h
+++ b/buffet/commands/schema_utils.h
@@ -13,10 +13,12 @@
 #include <vector>
 
 #include <base/values.h>
+#include <chromeos/any.h>
 #include <chromeos/errors/error.h>
 
 namespace buffet {
 
+class PropType;
 class PropValue;
 class ObjectSchema;
 
@@ -70,7 +72,7 @@
   return std::move(list);
 }
 
-// Similarly to CreateTypedValue() function above, the following overloaded
+// Similarly to TypedValueToJson() function above, the following overloaded
 // helper methods allow to extract specific C++ data types from base::Value.
 // Also used in template classes below to simplify specialization logic.
 bool TypedValueFromJson(const base::Value* value_in,
@@ -116,6 +118,18 @@
   return std::abs(v1 - v2) <= std::numeric_limits<T>::epsilon();
 }
 
+// Converts PropValue to Any in a format understood by D-Bus data serialization.
+// Has special handling for Object types where native_types::Object are
+// converted to chromeos::dbus_utils::Dictionary.
+chromeos::Any PropValueToDBusVariant(const PropValue* value);
+// Converts D-Bus variant to PropValue.
+// Has special handling for Object types where chromeos::dbus_utils::Dictionary
+// is converted to native_types::Object.
+std::shared_ptr<const PropValue> PropValueFromDBusVariant(
+    const PropType* type,
+    const chromeos::Any& value,
+    chromeos::ErrorPtr* error);
+
 }  // namespace buffet
 
 #endif  // BUFFET_COMMANDS_SCHEMA_UTILS_H_
diff --git a/buffet/commands/schema_utils_unittest.cc b/buffet/commands/schema_utils_unittest.cc
index f3279be..c5acbc8 100644
--- a/buffet/commands/schema_utils_unittest.cc
+++ b/buffet/commands/schema_utils_unittest.cc
@@ -12,11 +12,14 @@
 #include "buffet/commands/object_schema.h"
 #include "buffet/commands/prop_types.h"
 #include "buffet/commands/prop_values.h"
+#include "buffet/commands/schema_constants.h"
 #include "buffet/commands/schema_utils.h"
 #include "buffet/commands/unittest_utils.h"
 
+using buffet::unittests::CreateDictionaryValue;
 using buffet::unittests::CreateValue;
 using buffet::unittests::ValueToString;
+using chromeos::dbus_utils::Dictionary;
 
 TEST(CommandSchemaUtils, TypedValueToJson_Scalar) {
   EXPECT_EQ("true",
@@ -76,7 +79,7 @@
   chromeos::ErrorPtr error;
   EXPECT_FALSE(buffet::TypedValueFromJson(CreateValue("0").get(), nullptr,
                                           &value, &error));
-  EXPECT_EQ("type_mismatch", error->GetCode());
+  EXPECT_EQ(buffet::errors::commands::kTypeMismatch, error->GetCode());
   error.reset();
 }
 
@@ -98,7 +101,7 @@
   chromeos::ErrorPtr error;
   EXPECT_FALSE(buffet::TypedValueFromJson(CreateValue("'abc'").get(), nullptr,
                                           &value, &error));
-  EXPECT_EQ("type_mismatch", error->GetCode());
+  EXPECT_EQ(buffet::errors::commands::kTypeMismatch, error->GetCode());
   error.reset();
 }
 
@@ -126,7 +129,7 @@
   chromeos::ErrorPtr error;
   EXPECT_FALSE(buffet::TypedValueFromJson(CreateValue("'abc'").get(), nullptr,
                                           &value, &error));
-  EXPECT_EQ("type_mismatch", error->GetCode());
+  EXPECT_EQ(buffet::errors::commands::kTypeMismatch, error->GetCode());
   error.reset();
 }
 
@@ -148,7 +151,7 @@
   chromeos::ErrorPtr error;
   EXPECT_FALSE(buffet::TypedValueFromJson(CreateValue("12").get(), nullptr,
                                           &value, &error));
-  EXPECT_EQ("type_mismatch", error->GetCode());
+  EXPECT_EQ(buffet::errors::commands::kTypeMismatch, error->GetCode());
   error.reset();
 }
 
@@ -176,6 +179,128 @@
   chromeos::ErrorPtr error;
   EXPECT_FALSE(buffet::TypedValueFromJson(CreateValue("'abc'").get(), nullptr,
                                           &value, &error));
-  EXPECT_EQ("type_mismatch", error->GetCode());
+  EXPECT_EQ(buffet::errors::commands::kTypeMismatch, error->GetCode());
   error.reset();
 }
+
+TEST(CommandSchemaUtils, PropValueToDBusVariant) {
+  buffet::IntPropType int_type;
+  auto prop_value = int_type.CreateValue(5, nullptr);
+  EXPECT_EQ(5, PropValueToDBusVariant(prop_value.get()).Get<int>());
+
+  buffet::BooleanPropType bool_type;
+  prop_value = bool_type.CreateValue(true, nullptr);
+  EXPECT_TRUE(PropValueToDBusVariant(prop_value.get()).Get<bool>());
+
+  buffet::DoublePropType dbl_type;
+  prop_value = dbl_type.CreateValue(5.5, nullptr);
+  EXPECT_DOUBLE_EQ(5.5, PropValueToDBusVariant(prop_value.get()).Get<double>());
+
+  buffet::StringPropType str_type;
+  prop_value = str_type.CreateValue(std::string{"foo"}, nullptr);
+  EXPECT_EQ("foo", PropValueToDBusVariant(prop_value.get()).Get<std::string>());
+
+  buffet::ObjectPropType obj_type;
+  ASSERT_TRUE(obj_type.FromJson(CreateDictionaryValue(
+      "{'properties':{'width':'integer','height':'integer'},"
+      "'enum':[{'width':10,'height':20},{'width':100,'height':200}]}").get(),
+      nullptr, nullptr));
+  buffet::native_types::Object obj{
+    {"width", int_type.CreateValue(10, nullptr)},
+    {"height", int_type.CreateValue(20, nullptr)},
+  };
+  prop_value = obj_type.CreateValue(obj, nullptr);
+  Dictionary dict = PropValueToDBusVariant(prop_value.get()).Get<Dictionary>();
+  EXPECT_EQ(20, dict["height"].Get<int>());
+  EXPECT_EQ(10, dict["width"].Get<int>());
+}
+
+TEST(CommandSchemaUtils, PropValueFromDBusVariant_Int) {
+  buffet::IntPropType int_type;
+  ASSERT_TRUE(int_type.FromJson(CreateDictionaryValue("{'enum':[1,2]}").get(),
+                                nullptr, nullptr));
+
+  auto prop_value = PropValueFromDBusVariant(&int_type, 1, nullptr);
+  ASSERT_NE(nullptr, prop_value.get());
+  EXPECT_EQ(1, prop_value->GetValueAsAny().Get<int>());
+
+  chromeos::ErrorPtr error;
+  prop_value = PropValueFromDBusVariant(&int_type, 5, &error);
+  EXPECT_EQ(nullptr, prop_value.get());
+  ASSERT_NE(nullptr, error.get());
+  EXPECT_EQ(buffet::errors::commands::kOutOfRange, error->GetCode());
+}
+
+TEST(CommandSchemaUtils, PropValueFromDBusVariant_Bool) {
+  buffet::BooleanPropType bool_type;
+  ASSERT_TRUE(bool_type.FromJson(CreateDictionaryValue("{'enum':[true]}").get(),
+                                 nullptr, nullptr));
+
+  auto prop_value = PropValueFromDBusVariant(&bool_type, true, nullptr);
+  ASSERT_NE(nullptr, prop_value.get());
+  EXPECT_TRUE(prop_value->GetValueAsAny().Get<bool>());
+
+  chromeos::ErrorPtr error;
+  prop_value = PropValueFromDBusVariant(&bool_type, false, &error);
+  EXPECT_EQ(nullptr, prop_value.get());
+  ASSERT_NE(nullptr, error.get());
+  EXPECT_EQ(buffet::errors::commands::kOutOfRange, error->GetCode());
+}
+
+TEST(CommandSchemaUtils, PropValueFromDBusVariant_Double) {
+  buffet::DoublePropType dbl_type;
+  ASSERT_TRUE(dbl_type.FromJson(CreateDictionaryValue("{'maximum':2.0}").get(),
+                                 nullptr, nullptr));
+
+  auto prop_value = PropValueFromDBusVariant(&dbl_type, 1.0, nullptr);
+  ASSERT_NE(nullptr, prop_value.get());
+  EXPECT_DOUBLE_EQ(1.0, prop_value->GetValueAsAny().Get<double>());
+
+  chromeos::ErrorPtr error;
+  prop_value = PropValueFromDBusVariant(&dbl_type, 10.0, &error);
+  EXPECT_EQ(nullptr, prop_value.get());
+  ASSERT_NE(nullptr, error.get());
+  EXPECT_EQ(buffet::errors::commands::kOutOfRange, error->GetCode());
+}
+
+TEST(CommandSchemaUtils, PropValueFromDBusVariant_String) {
+  buffet::StringPropType str_type;
+  ASSERT_TRUE(str_type.FromJson(CreateDictionaryValue("{'minLength': 4}").get(),
+                                 nullptr, nullptr));
+
+  auto prop_value = PropValueFromDBusVariant(&str_type, std::string{"blah"},
+                                             nullptr);
+  ASSERT_NE(nullptr, prop_value.get());
+  EXPECT_EQ("blah", prop_value->GetValueAsAny().Get<std::string>());
+
+  chromeos::ErrorPtr error;
+  prop_value = PropValueFromDBusVariant(&str_type, std::string{"foo"}, &error);
+  EXPECT_EQ(nullptr, prop_value.get());
+  ASSERT_NE(nullptr, error.get());
+  EXPECT_EQ(buffet::errors::commands::kOutOfRange, error->GetCode());
+}
+
+TEST(CommandSchemaUtils, PropValueFromDBusVariant_Object) {
+  buffet::ObjectPropType obj_type;
+  ASSERT_TRUE(obj_type.FromJson(CreateDictionaryValue(
+      "{'properties':{'width':'integer','height':'integer'},"
+      "'enum':[{'width':10,'height':20},{'width':100,'height':200}]}").get(),
+      nullptr, nullptr));
+
+  Dictionary obj{
+    {"width", 100},
+    {"height", 200},
+  };
+  auto prop_value = PropValueFromDBusVariant(&obj_type, obj, nullptr);
+  ASSERT_NE(nullptr, prop_value.get());
+  auto value = prop_value->GetValueAsAny().Get<buffet::native_types::Object>();
+  EXPECT_EQ(100, value["width"].get()->GetValueAsAny().Get<int>());
+  EXPECT_EQ(200, value["height"].get()->GetValueAsAny().Get<int>());
+
+  chromeos::ErrorPtr error;
+  obj["height"] = 20;
+  prop_value = PropValueFromDBusVariant(&obj_type, obj, &error);
+  EXPECT_EQ(nullptr, prop_value.get());
+  ASSERT_NE(nullptr, error.get());
+  EXPECT_EQ(buffet::errors::commands::kOutOfRange, error->GetCode());
+}
