Posting data from multiple WattsOn devices to the Elkor Cloud with the ETport

The ETport allows multiple WattsOn devices (or other RS-485 devices) to be connected to its RS-485 bus. This allows multiple WattsOn devices to send data the Elkor Cloud (or a custom cloud) with only one gateway.

The following instructions are applicable to ETport devices with a firmware version of 1.51 or higher. You can see the firmware version number on the upper-right corner of the device's web interface.

WattsOn-Mark II

If all of the WattsOn devices are all WattsOn-Mark II units (the part number begins with W2), this is straightforward. First, enable Web Posting by visiting the device's web interface and clicking on Web Posting from its menu. Next to the "Posting" field, click Change, and select Elkor Cloud from the list of preconfigured profiles. Click "Submit" to save your changes.

At this point, only data from one WattsOn device will be sent to the cloud (if it's Modbus address is set to 1). To send data from multiple WattsOn-Mark II devices to the cloud, one of the advanced settings must be changed. Click on System from the menu, and click on the Advanced Configuration button. Search for the setting post_addr_0 in the list. This setting is a sequence of 32 hexadecimal bytes (two digits per byte), containing the addresses of up to 32 Modbus devices which will be read each time the ETport posts data to the Elkor Cloud. A byte of 00 terminates the sequence.

For example, a value of 01050D0000 ... 00 will cause the ETport to upload data from three WattsOn devices at addresses 1, 5, and D (13 decimal). These addresses, generally, will match the number selected on the physical rotary switch on the top of each WattsOn unit, though devices with their switch set to F can have their addresses overridden to a different value with Modbus software or the LCD display (if present).

WattsOn-1100 or WattsOn-1200

If all of your devices are original WattsOn devices (part numbers begin with WattsOn-1100 or WattsOn-1200), you must perform additional steps.

Before following the above instructions for the WattsOn-Mark II, you must upload a new template file. This file controls the data that is read from each device and sent to the cloud. Copy the text below, and save it to a plain text file on your computer, called w1_template.json, with a text editor program (such as Notepad on Windows).

$this.block(0x300,0x4E){
  "payload": {
    "device": "$gateway-device(format="plain")-$cloud-id(format="plain")",
    "device_firmware_version": $gateway-version(),
    "mb_address": $this,
    "meter_serial": $this.ushort(0x95),
    "meter_firmware_version": "$this.fixedshort(0x1F, 2)",
    "meter_model": "WattsOn",
    $when($equals($this.ushort(0x88), 0x85))"meter_id_string": "Elkor Technologies WattsOn-1100",
    $when($not($equals($this.ushort(0x88), 0x85)))"meter_id_string": "Elkor Technologies WattsOn-1200",
    $when(true)"time": $clock(style="ISO8601"),
    "live_data": $live(),
    "data": {
      "active_power_total_kW": $this.float(0x302),
      "reactive_power_total_kVAR": $this.float(0x304),
      "apparent_power_total_kVA": $this.float(0x306),
      "voltage_LN_average_V": $this.float(0x308),
      "voltage_LL_average_V": $this.float(0x30A),
      "current_average_A": $this.float(0x30C),
      "power_factor_total_none": $this.float(0x30E),
      "frequency_Hz": $this.float(0x310),
      "voltage_a_instantaneous_V": $this.float(0x314),
      "voltage_b_instantaneous_V": $this.float(0x316),
      "voltage_c_instantaneous_V": $this.float(0x318),
      "voltage_ab_instantaneous_V": $this.float(0x31A),
      "voltage_bc_instantaneous_V": $this.float(0x31C),
      "voltage_ac_instantaneous_V": $this.float(0x31E),
      "current_a_instantaneous_A": $this.float(0x320),
      "current_b_instantaneous_A": $this.float(0x322),
      "current_c_instantaneous_A": $this.float(0x324),
      "active_power_a_instantaneous_kW": $this.float(0x326),
      "active_power_b_instantaneous_kW": $this.float(0x328),
      "active_power_c_instantaneous_kW": $this.float(0x32A),
      "reactive_power_a_instantaneous_kVAR": $this.float(0x32C),
      "reactive_power_b_instantaneous_kVAR": $this.float(0x32E),
      "reactive_power_c_instantaneous_kVAR": $this.float(0x330),
      "apparent_power_a_instantaneous_kVA": $this.float(0x332),
      "apparent_power_b_instantaneous_kVA": $this.float(0x334),
      "apparent_power_c_instantaneous_kVA": $this.float(0x336),
      "power_factor_a_instantaneous_none": $this.float(0x338),
      "power_factor_b_instantaneous_none": $this.float(0x33A),
      "power_factor_c_instantaneous_none": $this.float(0x33C),
      "sliding_window_power_average_kW": $this.float(0x312),
      "net_real_energy_total_kWh": $this.float(0x300),
      "net_real_energy_a_kWh": $this.float(0x350),
      "net_real_energy_b_kWh": $this.float(0x352),
      "net_real_energy_c_kWh": $this.float(0x354),
      "import_real_energy_a_kWh": $this.float(0x340),
      "import_real_energy_b_kWh": $this.float(0x342),
      "import_real_energy_c_kWh": $this.float(0x344),
      "export_real_energy_a_kWh": $this.float(0x348),
      "export_real_energy_b_kWh": $this.float(0x34A),
      "export_real_energy_c_kWh": $this.float(0x34C)
    }
  }
}

Next, enable Web Posting by visiting the device's web interface and clicking on Web Posting from its menu. Next to the "Posting" field, click Change, and select Elkor Cloud from the list of preconfigured profiles. Next to "template", click Choose, then click Upload New, and then navigate to the file you uploaded to the device earlier, w1_template.json. It may take a few seconds to upload to the device. Click "Submit" to save your changes.

At this point, only data from one WattsOn device will be sent to the cloud (if it's Modbus address is set to 1). To send data from multiple WattsOn-Mark II devices to the cloud, one of the advanced settings must be changed. Click on System from the menu, and click on the Advanced Configuration button. Search for the setting post_addr_0 in the list. This setting is a sequence of 32 hexadecimal bytes (two digits per byte), containing the addresses of up to 32 Modbus devices which will be read each time the ETport posts data to the Elkor Cloud. A byte of 00 terminates the sequence.

For example, a value of 01050D0000 ... 00 will cause the ETport to upload data from three WattsOn devices at addresses 1, 5, and D (13 decimal). These addresses, generally, will match the number selected on the physical rotary switch on the top of each WattsOn unit, though devices with their switch set to F can have their addresses overridden to a different value with Modbus software or the LCD display (if present).

Other Devices, Mixed Setups, and Custom Clouds

The Elkor Cloud only supports WattsOn devices, but if you use your own custom cloud, you can send data from other kinds of Modbus devices or customize the data that is uploaded, by modifying the template files that the ETport uses. Multiple template files (up to 10) can be used if there are different kinds of devices on the same RS-485 line. This is described in a separate article, ETport templates with multiple devices.