From 73b34d5be69296260cf8cc9c150dcc071bbf8593 Mon Sep 17 00:00:00 2001 From: Fabian Wolter Date: Mon, 30 Nov 2020 08:58:43 +0100 Subject: [PATCH] Incorporate review feedback #1 --- bundles/org.openhab.binding.modbus.sbc/README.md | 5 ++--- .../openhab/binding/modbus/sbc/internal/ALD1Handler.java | 2 +- .../binding/modbus/sbc/internal/ALD1Registers.java | 4 ++-- .../src/main/resources/OH-INF/config/config.xml | 8 +------- 4 files changed, 6 insertions(+), 13 deletions(-) diff --git a/bundles/org.openhab.binding.modbus.sbc/README.md b/bundles/org.openhab.binding.modbus.sbc/README.md index acc5625a1b93a..d1d75f35353ba 100644 --- a/bundles/org.openhab.binding.modbus.sbc/README.md +++ b/bundles/org.openhab.binding.modbus.sbc/README.md @@ -15,12 +15,11 @@ This binding does not support discovery. ## Thing Configuration -The following configuration parameters apply to `ald1Unidirectional` and `ald1Bidirectional`. +The following configuration parameter applys to `ald1Unidirectional` and `ald1Bidirectional`. | Name | Description | Type | Required | |---------------|------------------------------------------|---------|----------| -| address | Modbus slave address of the energy meter | Integer | yes | -| pollIntervall | Time between polling the data in ms | Integer | yes | +| pollInterval | Time between polling the data in ms | Integer | yes | The Thing needs a Modbus serial slave Bridge to operate. diff --git a/bundles/org.openhab.binding.modbus.sbc/src/main/java/org/openhab/binding/modbus/sbc/internal/ALD1Handler.java b/bundles/org.openhab.binding.modbus.sbc/src/main/java/org/openhab/binding/modbus/sbc/internal/ALD1Handler.java index 8bfba76165d05..5eee8e8d60aa9 100644 --- a/bundles/org.openhab.binding.modbus.sbc/src/main/java/org/openhab/binding/modbus/sbc/internal/ALD1Handler.java +++ b/bundles/org.openhab.binding.modbus.sbc/src/main/java/org/openhab/binding/modbus/sbc/internal/ALD1Handler.java @@ -66,7 +66,7 @@ public void initialize() { return; } - ModbusReadRequestBlueprint localBlueprint = blueprint = new ModbusReadRequestBlueprint(config.address, + ModbusReadRequestBlueprint localBlueprint = blueprint = new ModbusReadRequestBlueprint(getSlaveId(), ModbusReadFunctionCode.READ_MULTIPLE_REGISTERS, FIRST_READ_ADDRESS - 1, READ_LENGTH, TRIES); updateStatus(ThingStatus.UNKNOWN); diff --git a/bundles/org.openhab.binding.modbus.sbc/src/main/java/org/openhab/binding/modbus/sbc/internal/ALD1Registers.java b/bundles/org.openhab.binding.modbus.sbc/src/main/java/org/openhab/binding/modbus/sbc/internal/ALD1Registers.java index 02b5acf65929d..1ab52b4e692b0 100644 --- a/bundles/org.openhab.binding.modbus.sbc/src/main/java/org/openhab/binding/modbus/sbc/internal/ALD1Registers.java +++ b/bundles/org.openhab.binding.modbus.sbc/src/main/java/org/openhab/binding/modbus/sbc/internal/ALD1Registers.java @@ -29,8 +29,8 @@ @NonNullByDefault public enum ALD1Registers { TOTAL_ENERGY(0.01f, 28, UINT32, SmartHomeUnits.KILOWATT_HOUR), - PARTIAL_ENERGY(0.01f, 30, UINT32, SmartHomeUnits.KILOWATT_HOUR), - FEEDING_BACK_ENERGY(0.01f, 30, UINT32, SmartHomeUnits.KILOWATT_HOUR), + PARTIAL_ENERGY(0.01f, 30, UINT32, SmartHomeUnits.KILOWATT_HOUR), // only unidirectional meters + FEEDING_BACK_ENERGY(0.01f, 30, UINT32, SmartHomeUnits.KILOWATT_HOUR), // only bidirectional meters VOLTAGE(1, 36, UINT16, SmartHomeUnits.VOLT), CURRENT(0.1f, 37, UINT16, SmartHomeUnits.AMPERE), ACTIVE_POWER(10, 38, INT16, SmartHomeUnits.WATT), diff --git a/bundles/org.openhab.binding.modbus.sbc/src/main/resources/OH-INF/config/config.xml b/bundles/org.openhab.binding.modbus.sbc/src/main/resources/OH-INF/config/config.xml index 77c2d3f74ab01..001cf9136bca6 100644 --- a/bundles/org.openhab.binding.modbus.sbc/src/main/resources/OH-INF/config/config.xml +++ b/bundles/org.openhab.binding.modbus.sbc/src/main/resources/OH-INF/config/config.xml @@ -5,15 +5,9 @@ xsi:schemaLocation="https://openhab.org/schemas/config-description/v1.0.0 https://openhab.org/schemas/config-description-1.0.0.xsd"> - - - Modbus slave address of the energy meter. - 1 - - - Time between polling the data. + Time between polling the data in ms. 5000