UPM

The UPM API is a high level sensor library for IoT devices using MRAA. See examples here. Back to index page.
SparkFun sensor images provided under CC BY-NC-SA-3.0.

H803X Class

Module: h803x

This module implements support for the Veris H8035 and H8036 Energy Meters.
The H8036 is similar to the H8035, but provides much more data.
The Enercept H8035/H8036 is an innovative three-phase networked (Modbus RTU) power transducer that combines electronics and high accuracy industrial grade CTs in a single package. The need for external electrical enclosures is eliminated, greatly reducing installation time and cost. Color-coordination between voltage leads and CTs makes phase matching easy. Additionally, these transducers automatically detect and compensate for phase reversal, eliminating the concern of CT load orientation. Up to 63 Transducers can be daisy-chained on a single RS-485 network.
This module was developed using libmodbus 3.1.2, and the H8035. The H8036 has not been tested. libmodbus 3.1.2 must be present for this module to build.
It was developed using an RS232->RS485 interface. You cannot use the built in MCU TTL UART pins for accessing this device b you must use a full Serial RS232->RS485 or USB-RS485 interface connected via USB.

Methods

H803X

(
  • device
  • address
  • baud
  • bits
  • parity
  • stopBits
)
Number

H803X constructor

Parameters:

  • device String

    Path to the serial device

  • address Number

    The MODBUS slave address

  • baud Number

    The baudrate of the device. Default: 9600

  • bits Number

    The number of bits per byte. Default: 8

  • parity String

    The parity of the connection, 'N' for None, 'E' for Even, 'O' for Odd. Default: 'N'

  • stopBits Number

    The number of stop bits. Default: 2

Returns:

Number:

update

()

Read current values from the sensor and update internal stored values. This method must be called prior to querying any values.

getSlaveID

() String

Return a string corresponding the the device's MODBUS slave ID.

Returns:

String:

string represnting the MODBUS slave ID

setSlaveAddress

(
  • addr
)

Set a new MODBUS slave address. This is useful if you have multiple H803X devices on a single bus. When this method is called, the current stored data is cleared, and a new attempt is made to determine whether the target device is an H8035 or H8036.

Parameters:

  • addr Number

    The new slave address to set

presetConsumption

(
  • value
  • multiplier
)

Preset the kWh accumulated Consumption registers to a predefined value. This is generally not advised, but is provided for those installations that might require it. The multiplier depends on the current range of your device. Be sure to select the right multiplier for your devices' supported current capacity.

Parameters:

  • value Number

    The desired value for the consumption accumulator registers in kWh.

  • multiplier MULTIPLIERS_T

    The correct MULTIPLIERS_T value for your device.

getConsumption

() Number

Return the accumulated consumption value, in kWh. update() must have been called prior to calling this method.

Returns:

Number:

The accumulated consumption.

getRealPower

() Number

Return the real power value in kW. update() must have been called prior to calling this method.

Returns:

Number:

The real power value in kW.

getReactivePower

() Number

Return the reactive power value in kVAR (kilo-volt Amperes Reactive). update() must have been called prior to calling this method.

Returns:

Number:

The reactive power value in kVAR.

getApparentPower

() Number

Return the apparent power value in kVA. update() must have been called prior to calling this method.

Returns:

Number:

The apparent power value in kVA.

getPowerFactor

() Number

Return the power factor value. update() must have been called prior to calling this method.

Returns:

Number:

The power factor.

getVoltsLineToLine

() Number

Return the voltage line to line value. update() must have been called prior to calling this method.

Returns:

Number:

The voltage, line to line.

getVoltsLineToNeutral

() Number

Return the voltage line to neutral. update() must have been called prior to calling this method.

Returns:

Number:

The voltage, line to neutral.

getCurrent

() Number

Return the current value in amps. update() must have been called prior to calling this method.

Returns:

Number:

The current value in amps.

getRealPowerPhaseA

() Number

Return the real power for phase A. update() must have been called prior to calling this method.

Returns:

Number:

The real power for phase A.

getRealPowerPhaseB

() Number

Return the real power for phase B. update() must have been called prior to calling this method.

Returns:

Number:

The real power for phase B.

getRealPowerPhaseC

() Number

Return the real power for phase C. update() must have been called prior to calling this method.

Returns:

Number:

The real power for phase C.

getPowerFactorPhaseA

() Number

Return the power factor for phase A. update() must have been called prior to calling this method.

Returns:

Number:

The power factor for phase A.

getPowerFactorPhaseB

() Number

Return the power factor for phase B. update() must have been called prior to calling this method.

Returns:

Number:

The power factor for phase B.

getPowerFactorPhaseC

() Number

Return the power factor for phase C. update() must have been called prior to calling this method.

Returns:

Number:

The power factor for phase C.

getVoltsPhaseAToB

() Number

Return the voltage for phase A to B. update() must have been called prior to calling this method.

Returns:

Number:

The voltage for phase A to B.

getVoltsPhaseBToC

() Number

Return the voltage for phase B to C. update() must have been called prior to calling this method.

Returns:

Number:

The voltage for phase B to C.

getVoltsPhaseAToC

() Number

Return the voltage for phase A to B. update() must have been called prior to calling this method.

Returns:

Number:

The voltage for phase A to B.

getVoltsPhaseAToNeutral

() Number

Return the voltage for phase A to neutral. update() must have been called prior to calling this method.

Returns:

Number:

The voltage for phase A to neutral.

getVoltsPhaseBToNeutral

() Number

Return the voltage for phase B to neutral. update() must have been called prior to calling this method.

Returns:

Number:

The voltage for phase B to neutral.

getVoltsPhaseCToNeutral

() Number

Return the voltage for phase C to neutral. update() must have been called prior to calling this method.

Returns:

Number:

The voltage for phase C to neutral.

getCurrentPhaseA

() Number

Return the current for phase A. update() must have been called prior to calling this method.

Returns:

Number:

The current for phase A.

getCurrentPhaseB

() Number

Return the current for phase B. update() must have been called prior to calling this method.

Returns:

Number:

The current for phase B.

getCurrentPhaseC

() Number

Return the current for phase C. update() must have been called prior to calling this method.

Returns:

Number:

The current for phase C.

getAvgRealPower

() Number

Return the average real power. update() must have been called prior to calling this method.

Returns:

Number:

The average real power.

getMinRealPower

() Number

Return the minimum real power. update() must have been called prior to calling this method.

Returns:

Number:

The minimum real power.

getMaxRealPower

() Number

Return the maximum real power. update() must have been called prior to calling this method.

Returns:

Number:

The maximum real power.

setDebug

(
  • enable
)

Enable or disable debugging output. This primarily enables and disables libmodbus debugging output.

Parameters:

  • enable Boolean

    true to enable debugging, false otherwise

isH8036

() Boolean

Indicate whether the connected device is an H8035 or an H8036. The H8036 provides many more data registers.

Returns:

Boolean:

true if we are using an H8036, false otherwise.

Properties

HOLDING_CONSUMPTION_KWH_INT_L

Enum HOLDING_REGS_T

HOLDING_CONSUMPTION_KWH_INT_H

Enum HOLDING_REGS_T

HOLDING_CONSUMPTION_KWH

Enum HOLDING_REGS_T

HOLDING_REAL_POWER_KW

Enum HOLDING_REGS_T

HOLDING_REACTIVE_POWER_KVAR

Enum HOLDING_REGS_T

HOLDING_APPARENT_POWER_KVA

Enum HOLDING_REGS_T

HOLDING_POWER_FACTOR

Enum HOLDING_REGS_T

HOLDING_VOLTS_LINE_TO_LINE

Enum HOLDING_REGS_T

HOLDING_VOLTS_LINE_TO_NEUTRAL

Enum HOLDING_REGS_T

HOLDING_CURRENT

Enum HOLDING_REGS_T

HOLDING_REAL_POWER_PHASE_A_KWH

Enum HOLDING_REGS_T

HOLDING_REAL_POWER_PHASE_B_KWH

Enum HOLDING_REGS_T

HOLDING_REAL_POWER_PHASE_C_KWH

Enum HOLDING_REGS_T

HOLDING_POWER_FACTOR_PHASE_A

Enum HOLDING_REGS_T

HOLDING_POWER_FACTOR_PHASE_B

Enum HOLDING_REGS_T

HOLDING_POWER_FACTOR_PHASE_C

Enum HOLDING_REGS_T

HOLDING_VOLTS_PHASE_AB

Enum HOLDING_REGS_T

HOLDING_VOLTS_PHASE_BC

Enum HOLDING_REGS_T

HOLDING_VOLTS_PHASE_AC

Enum HOLDING_REGS_T

HOLDING_VOLTS_PHASE_AN

Enum HOLDING_REGS_T

HOLDING_VOLTS_PHASE_BN

Enum HOLDING_REGS_T

HOLDING_VOLTS_PHASE_CN

Enum HOLDING_REGS_T

HOLDING_CURRENT_PHASE_A

Enum HOLDING_REGS_T

HOLDING_CURRENT_PHASE_B

Enum HOLDING_REGS_T

HOLDING_CURRENT_PHASE_C

Enum HOLDING_REGS_T

HOLDING_AVG_REAL_POWER_KW

Enum HOLDING_REGS_T

HOLDING_MIN_REAL_POWER_KW

Enum HOLDING_REGS_T

HOLDING_MAX_REAL_POWER_KW

Enum HOLDING_REGS_T

MULT_100A

Enum MULTIPLIERS_T

MULT_300A_400A

Enum MULTIPLIERS_T

MULT_800A

Enum MULTIPLIERS_T

MULT_1600A

Enum MULTIPLIERS_T

MULT_2400A

Enum MULTIPLIERS_T