Search documentation of grizzly

# View Source Grizzly.ZWave.CommandClasses.Meter (grizzly v7.4.2)

"Meter" Command Class

The Meter Command Class is used to advertise instantaneous and accumulated numerical readings.

# Summary

## Types

meter_rate_type()
meter_scale()
meter_type()

## Functions

decode_meter_scale(byte, arg2)

Decode meter scale

decode_meter_type(byte)

Decode meter type

decode_rate_type(v)

Decode rate type

decode_supported_scales_bitmasks(arg, meter_type)

Decode supported scales bitmasks.

encode_meter_scale(atom1, atom2)
encode_meter_type(atom)

Encode meter type

encode_rate_type(atom)

Encode meter rate type

encode_supported_scales_bitmasks(supported_scales, meter_type)

Encode supported meter scales as two bit masks. The first bitmask encodes "byte 1" scales and the second bitmask encodes "byte 2" scales. We assume that there is no byte 3, 4, encoding etc. A bit 1 indicates support.

# Types

Link to this type

# meter_rate_type()

View Source

    @type meter_rate_type() :: :export | :import | :import_export | :unspecified

Link to this type

# meter_scale()

View Source

    @type meter_scale() ::
      :a
      | :cubic_feet
      | :cubic_meters
      | :kvah
      | :kvar
      | :kvarh
      | :kwh
      | :power_factor
      | :pulse_count
      | :us_gallons
      | :v
      | :w

Link to this type

# meter_type()

View Source

    @type meter_type() :: :electric | :gas | :water | :heating | :cooling

# Functions

Link to this function

# decode_meter_scale(byte, arg2)

View Source

    @spec decode_meter_scale(
      {byte(), byte()},
      meter_type() | non_neg_integer()
    ) :: {:ok, meter_scale()} | {:error, Grizzly.ZWave.DecodeError.t()}

Decode meter scale

Link to this function

# decode_meter_type(byte)

View Source

    @spec decode_meter_type(non_neg_integer()) ::
      {:ok, meter_type()} | {:error, Grizzly.ZWave.DecodeError.t()}

Decode meter type

Link to this function

# decode_rate_type(v)

View Source

    @spec decode_rate_type(non_neg_integer()) ::
      {:ok, meter_rate_type()} | {:error, Grizzly.ZWave.DecodeError.t()}

Decode rate type

Link to this function

# decode_supported_scales_bitmasks(arg, meter_type)

View Source

    @spec decode_supported_scales_bitmasks(
      {binary(), binary()},
      meter_type()
    ) :: {:ok, [meter_scale()]}

Decode supported scales bitmasks.

Link to this function

# encode_meter_scale(atom1, atom2)

View Source

    @spec encode_meter_scale(meter_scale(), meter_type()) :: {0..7, 0..1}

Link to this function

# encode_meter_type(atom)

View Source

    @spec encode_meter_type(meter_type()) :: 1..5

Encode meter type

Link to this function

# encode_rate_type(atom)

View Source

    @spec encode_rate_type(meter_rate_type()) :: 0..3

Encode meter rate type

Link to this function

# encode_supported_scales_bitmasks(supported_scales, meter_type)

View Source

    @spec encode_supported_scales_bitmasks([meter_scale()], meter_type()) ::
      {byte(), byte()}

Encode supported meter scales as two bit masks. The first bitmask encodes "byte 1" scales and the second bitmask encodes "byte 2" scales. We assume that there is no byte 3, 4, encoding etc. A bit 1 indicates support.