diff --git a/homeassistant/components/modbus/__init__.py b/homeassistant/components/modbus/__init__.py index 182e3dc28fa..0500a904cb9 100644 --- a/homeassistant/components/modbus/__init__.py +++ b/homeassistant/components/modbus/__init__.py @@ -60,7 +60,9 @@ SERVICE_WRITE_REGISTER_SCHEMA = vol.Schema({ vol.Optional(ATTR_HUB, default=DEFAULT_HUB): cv.string, vol.Required(ATTR_UNIT): cv.positive_int, vol.Required(ATTR_ADDRESS): cv.positive_int, - vol.Required(ATTR_VALUE): vol.All(cv.ensure_list, [cv.positive_int]) + vol.Required(ATTR_VALUE): vol.Any( + cv.positive_int, + vol.All(cv.ensure_list, [cv.positive_int])) }) SERVICE_WRITE_COIL_SCHEMA = vol.Schema({ diff --git a/homeassistant/components/modbus/services.yaml b/homeassistant/components/modbus/services.yaml index 0fd9e5a49e7..48e9e815aaa 100644 --- a/homeassistant/components/modbus/services.yaml +++ b/homeassistant/components/modbus/services.yaml @@ -9,4 +9,4 @@ write_register: fields: address: {description: Address of the holding register to write to., example: 0} unit: {description: Address of the modbus unit., example: 21} - value: {description: Value to write., example: 0} + value: {description: Value (single value or array) to write., example: 0 or [4,0]}