Class: Simms::ElectricityDataBeacon
- 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
-
#accumulated_apparent_energy ⇒ Object
In Wh - see #accumulated_real_energy for counter info.
-
#accumulated_real_energy ⇒ Object
May be negative, as in the case of a solar power installation.
- #current_peak ⇒ Object
- #current_rms ⇒ Object
-
#error_state ⇒ Object
TODO What does this mean? What are the valid values?.
- #max_demand ⇒ Object
-
#phase ⇒ Object
Which phase this beacon represents.
-
#power_factor ⇒ Object
In VA.
-
#present_apparent_power ⇒ Object
In W.
-
#present_real_power ⇒ Object
In W.
- #volts_peak ⇒ Object
- #volts_rms ⇒ Object
- #volts_sag ⇒ Object
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_energy ⇒ Object
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_energy ⇒ Object
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_peak ⇒ Object
65 66 67 |
# File 'lib/simms/electricity_data_beacon.rb', line 65 def current_peak @bytes.uint16(44) end |
#current_rms ⇒ Object
44 45 46 |
# File 'lib/simms/electricity_data_beacon.rb', line 44 def current_rms @bytes.float(28) end |
#error_state ⇒ Object
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_demand ⇒ Object
53 54 55 |
# File 'lib/simms/electricity_data_beacon.rb', line 53 def max_demand @bytes.float(36) end |
#phase ⇒ Object
Which phase this beacon represents
10 11 12 |
# File 'lib/simms/electricity_data_beacon.rb', line 10 def phase @bytes.uint8(6) end |
#power_factor ⇒ Object
In VA
49 50 51 |
# File 'lib/simms/electricity_data_beacon.rb', line 49 def power_factor @bytes.float(32) end |
#present_apparent_power ⇒ Object
In W
36 37 38 |
# File 'lib/simms/electricity_data_beacon.rb', line 36 def present_apparent_power @bytes.float(20) end |
#present_real_power ⇒ Object
In W
31 32 33 |
# File 'lib/simms/electricity_data_beacon.rb', line 31 def present_real_power @bytes.float(16) end |
#volts_peak ⇒ Object
61 62 63 |
# File 'lib/simms/electricity_data_beacon.rb', line 61 def volts_peak @bytes.uint16(42) end |
#volts_rms ⇒ Object
40 41 42 |
# File 'lib/simms/electricity_data_beacon.rb', line 40 def volts_rms @bytes.float(24) end |
#volts_sag ⇒ Object
57 58 59 |
# File 'lib/simms/electricity_data_beacon.rb', line 57 def volts_sag @bytes.uint16(40) end |