Class: Simms::ElectricityDataBeacon

Inherits:
Beacon
  • Object
show all
Defined in:
lib/simms/electricity_data_beacon.rb

Constant Summary

Constants inherited from Beacon

Beacon::CG_ELECTRIC, Beacon::CG_GLOBAL, Beacon::CG_HVAC, Beacon::CG_IRRIGATION, Beacon::CG_PULSER, Beacon::CG_SENSOR, Beacon::DC_CONFIG, Beacon::DC_DATA, Beacon::DC_GLOBAL_CONFIG

Instance Attribute Summary

Attributes inherited from Beacon

#command_group_id, #device_command_id, #timestamp, #uuid

Instance Method Summary collapse

Methods inherited from Beacon

class_for, #config?, #data?, #group, #initialize, #type

Constructor Details

This class inherits a constructor from Simms::Beacon

Instance Method Details

#accumulated_apparent_energyObject

In Wh - see #accumulated_real_energy for counter info



26
27
28
# File 'lib/simms/electricity_data_beacon.rb', line 26

def accumulated_apparent_energy
  @bytes.sint32(12)
end

#accumulated_real_energyObject

May be negative, as in the case of a solar power installation. Is a counter, ie to get the real energy (Wh) for a given interval, you need to diff against past values



21
22
23
# File 'lib/simms/electricity_data_beacon.rb', line 21

def accumulated_real_energy
  @bytes.sint32(8)
end

#current_peakObject



65
66
67
# File 'lib/simms/electricity_data_beacon.rb', line 65

def current_peak
  @bytes.uint16(44)
end

#current_rmsObject



44
45
46
# File 'lib/simms/electricity_data_beacon.rb', line 44

def current_rms
  @bytes.float(28)
end

#error_stateObject

TODO What does this mean? What are the valid values?



15
16
17
# File 'lib/simms/electricity_data_beacon.rb', line 15

def error_state
  @bytes.uint8(7)
end

#max_demandObject



53
54
55
# File 'lib/simms/electricity_data_beacon.rb', line 53

def max_demand
  @bytes.float(36)
end

#phaseObject

Which phase this beacon represents



10
11
12
# File 'lib/simms/electricity_data_beacon.rb', line 10

def phase
  @bytes.uint8(6)
end

#power_factorObject

In VA



49
50
51
# File 'lib/simms/electricity_data_beacon.rb', line 49

def power_factor
  @bytes.float(32)
end

#present_apparent_powerObject

In W



36
37
38
# File 'lib/simms/electricity_data_beacon.rb', line 36

def present_apparent_power
  @bytes.float(20)
end

#present_real_powerObject

In W



31
32
33
# File 'lib/simms/electricity_data_beacon.rb', line 31

def present_real_power
  @bytes.float(16)
end

#volts_peakObject



61
62
63
# File 'lib/simms/electricity_data_beacon.rb', line 61

def volts_peak
  @bytes.uint16(42)
end

#volts_rmsObject



40
41
42
# File 'lib/simms/electricity_data_beacon.rb', line 40

def volts_rms
  @bytes.float(24)
end

#volts_sagObject



57
58
59
# File 'lib/simms/electricity_data_beacon.rb', line 57

def volts_sag
  @bytes.uint16(40)
end