View Source Grizzly.ZWave.CommandClasses.Meter (grizzly v8.5.2)
"Meter" Command Class
The Meter Command Class is used to advertise instantaneous and accumulated numerical readings.
Summary
Functions
Decode meter scale
Decode meter type
Decode rate type
Decode supported scales bitmasks.
Encode meter type
Encode meter rate 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
@type meter_rate_type() :: :export | :import | :import_export | :unspecified
@type meter_scale() ::
:a
| :cubic_feet
| :cubic_meters
| :kvah
| :kvar
| :kvarh
| :kwh
| :power_factor
| :pulse_count
| :us_gallons
| :v
| :w
@type meter_type() :: :electric | :gas | :water | :heating | :cooling
Functions
@spec decode_meter_scale( {byte(), byte()}, meter_type() | non_neg_integer() ) :: {:ok, meter_scale()} | {:error, Grizzly.ZWave.DecodeError.t()}
Decode meter scale
@spec decode_meter_type(non_neg_integer()) :: {:ok, meter_type()} | {:error, Grizzly.ZWave.DecodeError.t()}
Decode meter type
@spec decode_rate_type(non_neg_integer()) :: {:ok, meter_rate_type()} | {:error, Grizzly.ZWave.DecodeError.t()}
Decode rate type
@spec decode_supported_scales_bitmasks( {binary(), binary()}, meter_type() ) :: {:ok, [meter_scale()]}
Decode supported scales bitmasks.
@spec encode_meter_scale(meter_scale(), meter_type()) :: {0..7, 0..1}
@spec encode_meter_type(meter_type()) :: 1..5
Encode meter type
@spec encode_rate_type(meter_rate_type()) :: 0..3
Encode meter rate type
@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.