waterfurnace_aurora 0.3.13 → 0.4.3

Sign up to get free protection for your applications and to get access to all the features.
@@ -142,6 +142,45 @@ module Aurora
142
142
  5 => :dirty_filter
143
143
  }.freeze
144
144
 
145
+ BRINE_TYPE = Hash.new("Water").merge!(
146
+ 485 => "Antifreeze"
147
+ ).freeze
148
+
149
+ FLOW_METER_TYPE = Hash.new("Other").merge!(
150
+ 0 => "None",
151
+ 1 => '3/4"',
152
+ 2 => '1"'
153
+ ).freeze
154
+
155
+ PUMP_TYPE = Hash.new("Other").merge!(
156
+ 0 => "Open Loop",
157
+ 1 => "FC1",
158
+ 2 => "FC2",
159
+ 3 => "VS Pump",
160
+ 4 => "VS Pump + 26-99",
161
+ 5 => "VS Pump + UPS26-99",
162
+ 6 => "FC1_GLNP",
163
+ 7 => "FC2_GLNP"
164
+ ).freeze
165
+
166
+ PHASE_TYPE = Hash.new("Other").merge!(
167
+ 0 => "Single",
168
+ 1 => "Three"
169
+ ).freeze
170
+
171
+ BLOWER_TYPE = Hash.new("Other").merge!(
172
+ 0 => "PSC",
173
+ 1 => "ECM 208/230",
174
+ 2 => "ECM 265/277",
175
+ 3 => "5 Speed ECM 460"
176
+ ).freeze
177
+
178
+ ENERGY_MONITOR_TYPE = Hash.new("Other").merge!(
179
+ 0 => "None",
180
+ 1 => "Compressor Monitor",
181
+ 2 => "Energy Monitor"
182
+ ).freeze
183
+
145
184
  VS_FAULTS = {
146
185
  "Under-Voltage Warning" => (71..77),
147
186
  "RPM Sensor Signal Fault" => (78..82),
@@ -157,8 +196,8 @@ module Aurora
157
196
 
158
197
  AR_SETTINGS = {
159
198
  0 => "Cycle with Compressor",
160
- 1 => "Cycle with Thermostat Humidification Call",
161
- 2 => "Slow Opening Water Valve",
199
+ 1 => "Slow Opening Water Valve",
200
+ 2 => "Cycle with Thermostat Humidification Call",
162
201
  3 => "Cycle with Blower"
163
202
  }.freeze
164
203
 
@@ -169,17 +208,18 @@ module Aurora
169
208
  fp1: value & 0x01 == 0x01 ? "30ºF" : "15ºF",
170
209
  fp2: value & 0x02 == 0x02 ? "30ºF" : "15ºF",
171
210
  rv: value & 0x04 == 0x04 ? "O" : "B",
172
- ar: AR_SETTINGS[(value >> 3) & 0x7],
211
+ ar: AR_SETTINGS[(value >> 3) & 0x3],
173
212
  cc: value & 0x20 == 0x20 ? "Single Stage" : "Dual Stage",
174
213
  lo: value & 0x40 == 0x40 ? "Continouous" : "Pulse",
175
- dh_rh: value & 0x80 == 0x80 ? "Dehumdifier On" : "Reheat On"
214
+ dh_rh: value & 0x80 == 0x80 ? "Dehumidifier On" : "Reheat On"
176
215
  }
177
216
  end
178
217
 
179
218
  COMPONENT_STATUS = {
180
219
  1 => :active,
181
220
  2 => :added,
182
- 3 => :removed
221
+ 3 => :removed,
222
+ 0xffff => :missing
183
223
  }.freeze
184
224
 
185
225
  SYSTEM_OUTPUTS = {
@@ -194,22 +234,15 @@ module Aurora
194
234
  0x800 => :alarm
195
235
  }.freeze
196
236
 
197
- # 5-speed ECM shows
198
- # Aux if eh1 is on
199
- # High if cc2 is on
200
- # Med if cc1 is on
201
- # Low if blower is on
202
- # Off
203
-
204
237
  SYSTEM_INPUTS = {
205
- 0x01 => "Y1",
206
- 0x02 => "Y2",
207
- 0x04 => "W",
208
- 0x08 => "O",
209
- 0x10 => "G",
210
- 0x20 => "Dehumidifer",
211
- 0x40 => "Emergency Shutdown",
212
- 0x200 => "Load Shed"
238
+ 0x01 => :y1,
239
+ 0x02 => :y2,
240
+ 0x04 => :w,
241
+ 0x08 => :o,
242
+ 0x10 => :g,
243
+ 0x20 => :dh_rh,
244
+ 0x40 => :emergency_shutdown,
245
+ 0x200 => :load_shed
213
246
  }.freeze
214
247
 
215
248
  def status(value)
@@ -217,9 +250,10 @@ module Aurora
217
250
  lps: value & 0x80 == 0x80 ? :closed : :open,
218
251
  hps: value & 0x100 == 0x100 ? :closed : :open
219
252
  }
220
- result[:load_shed] = true if value & 0x0200 == 0x0200
221
- result[:emergency_shutdown] = true if value & 0x0040 == 0x0040
222
- leftover = value & ~0x03c0
253
+ SYSTEM_INPUTS.each do |(i, name)|
254
+ result[name] = true if value & i == i
255
+ end
256
+ leftover = value & ~0x03ff
223
257
  result[:unknown] = format("0x%04x", leftover) unless leftover.zero?
224
258
  result
225
259
  end
@@ -266,13 +300,36 @@ module Aurora
266
300
 
267
301
  }.freeze
268
302
 
269
- AXB_INPUTS = {
270
- }.freeze
303
+ def axb_inputs(value)
304
+ result = {}
305
+ result["Smart Grid"] = value & 0x001 == 0x001
306
+ result["Home Automation 1"] = value & 0x002 == 0x002
307
+ result["Home Automation 2"] = value & 0x004 == 0x004
308
+ result["Pump Slave"] = value & 0x008 == 0x008
309
+
310
+ result[:mb_address] = value & 0x010 == 0x010 ? 3 : 4
311
+ result[:sw1_2] = value & 0x020 == 0x020 # future use # rubocop:disable Naming/VariableNumber
312
+ result[:sw1_3] = value & 0x040 == 0x040 # future use # rubocop:disable Naming/VariableNumber
313
+ result[:cycle_with] = if value & 0x080 == 0x080 && value & 0x100 == 0x100
314
+ "Blower"
315
+ elsif value & 0x100 == 0x100
316
+ "Low Capacity Compressor"
317
+ elsif value & 0x080 == 0x080
318
+ "High Capacity Compressor"
319
+ else
320
+ "Thermostat Dehumidifier"
321
+ end
322
+ leftover = value & ~0x1ff
323
+ result[:unknown] = format("0x%04x", leftover) unless leftover.zero?
324
+ result
325
+ end
271
326
 
272
327
  AXB_OUTPUTS = {
273
- 0x10 => "Accessory 2",
274
- 0x02 => "Loop Pump",
275
- 0x01 => "DHW"
328
+ 0x01 => :dhw,
329
+ 0x02 => :loop_pump,
330
+ 0x04 => :diverting_valve,
331
+ 0x08 => :dehumidifer_reheat,
332
+ 0x10 => :accessory2
276
333
  }.freeze
277
334
 
278
335
  HEATING_MODE = {
@@ -338,6 +395,12 @@ module Aurora
338
395
  value
339
396
  end
340
397
 
398
+ def thermostat_override(value)
399
+ return [:off] if value == 0x7fff
400
+
401
+ from_bitmask(value, SYSTEM_INPUTS)
402
+ end
403
+
341
404
  def iz2_demand(value)
342
405
  {
343
406
  fan_demand: value >> 8,
@@ -411,11 +474,11 @@ module Aurora
411
474
  # intermittent off time allowed: 5, 10, 15, 20, 25, 30, 35, 40
412
475
 
413
476
  REGISTER_CONVERTERS = {
414
- TO_HUNDREDTHS => [2, 3, 801, 807, 813, 816, 817, 819, 820, 825, 828],
477
+ TO_HUNDREDTHS => [2, 3, 417, 418, 801, 804, 807, 813, 816, 817, 819, 820, 825, 828],
415
478
  method(:dipswitch_settings) => [4, 33],
416
479
  TO_TENTHS => [19, 20, 401, 419, 501, 502, 567, 740, 745, 746, 747, 900,
417
- 1105, 1106, 1107, 1108, 1110, 1111, 1114, 1117, 1134, 1136,
418
- 3327, 3522,
480
+ 1105, 1106, 1107, 1108, 1109, 1110, 1111, 1112, 1113, 1114, 1115, 1116, 1117, 1119, 1124, 1125, 1134,
481
+ 3322, 3323, 3325, 3326, 3327, 3330, 3522, 3903, 3905, 3906,
419
482
  12_619, 12_620,
420
483
  21_203, 21_204,
421
484
  21_212, 21_213,
@@ -429,6 +492,7 @@ module Aurora
429
492
  ->(v) { from_bitmask(v, SYSTEM_OUTPUTS) } => [27, 30],
430
493
  ->(v) { from_bitmask(v, SYSTEM_INPUTS) } => [28],
431
494
  method(:status) => [31],
495
+ method(:thermostat_override) => [32],
432
496
  ->(v) { !v.zero? } => [45, 362, 400],
433
497
  ->(registers, idx) { to_string(registers, idx, 4) } => [88],
434
498
  ->(registers, idx) { to_string(registers, idx, 12) } => [92],
@@ -440,17 +504,23 @@ module Aurora
440
504
  ->(v) { from_bitmask(v, VS_EEV2) } => [280, 3804],
441
505
  method(:vs_manual_control) => [323],
442
506
  NEGATABLE => [346, 1146],
507
+ ->(v) { BRINE_TYPE[v] } => [402],
508
+ ->(v) { FLOW_METER_TYPE[v] } => [403],
509
+ ->(v) { BLOWER_TYPE[v] } => [404],
443
510
  ->(v) { v.zero? ? :closed : :open } => [405, 408, 410],
444
511
  ->(v) { SMARTGRID_ACTION[v] } => [406],
445
512
  ->(v) { HA_ALARM[v] } => [409, 411],
513
+ ->(v) { ENERGY_MONITOR_TYPE[v] } => [412],
514
+ ->(v) { PUMP_TYPE[v] } => [413],
515
+ ->(v) { PHASE_TYPE[v] } => [416],
446
516
  method(:iz2_fan_desired) => [565],
447
517
  ->(registers, idx) { to_string(registers, idx, 8) } => [710],
448
- ->(v) { COMPONENT_STATUS[v] } => [800, 806, 812, 815, 818, 824, 827],
449
- ->(v) { from_bitmask(v, AXB_INPUTS) } => [1103],
518
+ ->(v) { COMPONENT_STATUS[v] } => [800, 803, 806, 812, 815, 818, 824, 827],
519
+ method(:axb_inputs) => [1103],
450
520
  ->(v) { from_bitmask(v, AXB_OUTPUTS) } => [1104],
451
- ->(v) { TO_TENTHS.call(NEGATABLE.call(v)) } => [1136],
521
+ ->(v) { TO_TENTHS.call(NEGATABLE.call(v)) } => [1135, 1136],
522
+ method(:to_int32) => [1146, 1148, 1150, 1152, 1154, 1156, 1164, 3422, 3424],
452
523
  method(:manual_operation) => [3002],
453
- method(:to_int32) => [3422, 3424],
454
524
  ->(v) { HEATING_MODE[v] } => [12_606, 21_202, 21_211, 21_220, 21_229, 21_238, 21_247],
455
525
  ->(v) { FAN_MODE[v] } => [12_621, 21_205, 21_214, 21_223, 21_232, 21_241, 21_250],
456
526
  ->(v) { from_bitmask(v, HUMIDIFIER_SETTINGS) } => [31_109],
@@ -468,10 +538,11 @@ module Aurora
468
538
  }.freeze
469
539
 
470
540
  REGISTER_FORMATS = {
471
- "%ds" => [1, 6, 9, 15, 84, 85],
541
+ "%ds" => [1, 6, 9, 15, 84, 85, 110],
472
542
  "%dV" => [16, 112, 3331, 3424, 3523],
473
- "%0.1fºF" => [19, 20, 401, 501, 502, 567, 740, 745, 746, 747, 900, 1110, 1111, 1114, 1134, 1136,
474
- 3327, 3522,
543
+ "%0.1fºF" => [19, 20, 401, 501, 502, 567, 740, 745, 746, 747, 900,
544
+ 1109, 1110, 1111, 1112, 1113, 1114, 1124, 1125, 1134, 1135, 1136,
545
+ 3325, 3326, 3327, 3330, 3522, 3903, 3905, 3906,
475
546
  12_619, 12_620,
476
547
  21_203, 21_204,
477
548
  21_212, 21_213,
@@ -482,16 +553,17 @@ module Aurora
482
553
  31_003,
483
554
  31_007, 31_010, 31_013, 31_016, 31_019, 31_022],
484
555
  "E%d" => [25, 26],
485
- "%d%%" => [282, 321, 322, 346, 565, 741, 3332, 3524],
486
- "%0.1f psi" => [419],
556
+ "%d%%" => [282, 321, 322, 325, 346, 565, 741, 1126, 3332, 3524, 3808],
557
+ "%0.1f psi" => [419, 1115, 1116, 1119, 3322, 3323],
487
558
  "%0.1fA" => [1105, 1106, 1107, 1108],
488
559
  "%0.1fgpm" => [1117],
489
- "%dW" => [1147, 1149, 1151, 1153, 1165, 3422],
490
- "%dBtuh" => [1157]
560
+ "%dW" => [1146, 1148, 1150, 1152, 1164, 3422],
561
+ "%dBtuh" => [1154, 1156]
491
562
  }.freeze
492
563
 
493
- def ignore(range)
494
- range = (range..range) if range.is_a?(Integer)
564
+ def ignore(*range)
565
+ range = range.first if range.length == 1
566
+ range = [range] if range.is_a?(Integer)
495
567
  range.zip(Array.new(range.count)).to_h
496
568
  end
497
569
 
@@ -621,7 +693,9 @@ module Aurora
621
693
  9 => "Compressor Minimum Run Time",
622
694
  15 => "Blower Off Delay",
623
695
  16 => "Line Voltage",
624
- 19 => "FP1",
696
+ 17 => "Aux/E Heat Stage", # this has some complicated condition based on
697
+ # current inputs and outputs on if it should have a value (310 - v) or (130 - v), or be 0
698
+ 19 => "FP1 (Cooling Liquid Line) Temperature",
625
699
  20 => "FP2",
626
700
  21 => "Condensate", # >= 270 normal, otherwise fault
627
701
  25 => "Last Fault Number", # high bit set if locked out
@@ -630,6 +704,7 @@ module Aurora
630
704
  28 => "System Inputs (At Last Lockout)",
631
705
  30 => "System Outputs",
632
706
  31 => "Status",
707
+ 32 => "Thermostat Input Override",
633
708
  33 => "DIP Switch Status",
634
709
  36 => "ABC Board Rev",
635
710
  45 => "Test Mode (write)", # 1 to enable
@@ -643,7 +718,8 @@ module Aurora
643
718
  88 => "ABC Program",
644
719
  92 => "Model Number",
645
720
  105 => "Serial Number",
646
- 112 => "Setup Line Voltage",
721
+ 110 => "Reheat Delay",
722
+ 112 => "Line Voltage Setting",
647
723
  201 => "Discharge Pressure", # I can't figure out how this number is represented;
648
724
  203 => "Suction Pressure",
649
725
  205 => "Discharge Temperature",
@@ -665,6 +741,7 @@ module Aurora
665
741
  321 => "VS Pump Min",
666
742
  322 => "VS Pump Max",
667
743
  323 => "VS Pump Speed Manual Control",
744
+ 325 => "VS Pump Output",
668
745
  326 => "VS Pump Fault",
669
746
  340 => "Blower Only Speed",
670
747
  341 => "Lo Compressor ECM Speed",
@@ -673,21 +750,28 @@ module Aurora
673
750
  346 => "Cooling Airflow Adjustment",
674
751
  347 => "Aux Heat ECM Speed",
675
752
  362 => "Active Dehumidify", # any value is true
676
- 460 => "IZ2??",
677
- 461 => "IZ2??",
678
- 462 => "IZ2 Status", # 5 when online; 1 when in setup mode
679
753
  400 => "DHW Enabled",
680
754
  401 => "DHW Setpoint",
681
- # 403 => "DHW Status", just a guess, based on AID Tool querying this register while showing DHW settings
755
+ 402 => "Brine Type",
756
+ 403 => "Flow Meter Type",
757
+ 404 => "Blower Type",
682
758
  405 => "SmartGrid Trigger",
683
759
  406 => "SmartGrid Action", # 0/1 for 1/2; see 414
684
760
  407 => "Off Time Length",
685
761
  408 => "HA Alarm 1 Trigger",
686
762
  409 => "HA Alarm 1 Action",
687
- 410 => "HA Alaram 2 Trigger",
763
+ 410 => "HA Alarm 2 Trigger",
688
764
  411 => "HA Alarm 2 Action",
765
+ 412 => "Energy Monitor", # 0 none, 1 compressor monitor, 2 energy monitor
766
+ 413 => "Pump Type",
689
767
  414 => "On Peak/SmartGrid", # 0x0001 only
768
+ 416 => "Energy Phase Type",
769
+ 417 => "Power Adjustment Factor L",
770
+ 418 => "Power Adjustment Factor H",
690
771
  419 => "Loop Pressure Trip",
772
+ 460 => "IZ2 Heartbeat?",
773
+ 461 => "IZ2 Heartbeat?",
774
+ 462 => "IZ2 Status", # 5 when online; 1 when in setup mode
691
775
  483 => "Number of IZ2 Zones",
692
776
  501 => "Set Point", # only read by AID tool? this is _not_ heating/cooling set point
693
777
  502 => "Ambient Temperature",
@@ -703,6 +787,9 @@ module Aurora
703
787
  800 => "Thermostat Installed",
704
788
  801 => "Thermostat Version",
705
789
  802 => "Thermostat Revision",
790
+ 803 => "??? Installed",
791
+ 804 => "??? Version",
792
+ 805 => "??? Revision",
706
793
  806 => "AXB Installed",
707
794
  807 => "AXB Version",
708
795
  808 => "AXB Revision",
@@ -731,19 +818,29 @@ module Aurora
731
818
  1106 => "Aux Amps",
732
819
  1107 => "Compressor 1 Amps",
733
820
  1108 => "Compressor 2 Amps",
734
- 1109 => "Heating Liquid Line",
821
+ 1109 => "Heating Liquid Line Temperature",
735
822
  1110 => "Leaving Water",
736
823
  1111 => "Entering Water",
737
- 1114 => "DHW Temp",
824
+ 1112 => "Leaving Air Temperature",
825
+ 1113 => "Suction Temperature",
826
+ 1114 => "DHW Temperature",
827
+ 1115 => "Discharge Pressure",
828
+ 1116 => "Suction Pressure",
738
829
  1117 => "Waterflow",
739
- 1134 => "Saturated Discharge Temperature",
740
- 1135 => "SubCooling",
741
- 1147 => "Compressor Watts",
742
- 1149 => "Blower Watts",
743
- 1151 => "Aux Watts",
744
- 1153 => "Total Watts",
745
- 1157 => "Ht of Rej",
746
- 1165 => "VS Pump Watts",
830
+ 1119 => "Loop Pressure", # only valid < 1000psi
831
+ 1124 => "Saturated Evaporator Temperature",
832
+ 1125 => "SuperHeat",
833
+ 1126 => "Vaport Injector Open %",
834
+ 1134 => "Saturated Condensor Discharge Temperature",
835
+ 1135 => "SubCooling (Heating)",
836
+ 1136 => "SubCooling (Cooling)",
837
+ 1146 => "Compressor Watts",
838
+ 1148 => "Blower Watts",
839
+ 1150 => "Aux Watts",
840
+ 1152 => "Total Watts",
841
+ 1154 => "Heat of Extraction",
842
+ 1156 => "Heat of Rejection",
843
+ 1164 => "Pump Watts",
747
844
  12_606 => "Heating Mode (write)",
748
845
  12_619 => "Heating Setpoint (write)",
749
846
  12_620 => "Cooling Setpoint (write)",
@@ -761,6 +858,11 @@ module Aurora
761
858
  3226 => "VS Drive Details (Alarm 1)",
762
859
  3227 => "VS Drive Details (Alarm 2)",
763
860
  3327 => "VS Drive Temperature",
861
+ 3322 => "VS Drive Discharge Pressure",
862
+ 3323 => "VS Drive Suction Pressure",
863
+ 3325 => "VS Drive Discharge Temperature",
864
+ 3326 => "VS Drive Compressor Ambient Temperature",
865
+ 3330 => "VS Drive Entering Water Temperature",
764
866
  3331 => "VS Drive Line Voltage",
765
867
  3332 => "VS Drive Thermo Power",
766
868
  3422 => "VS Drive Compressor Power",
@@ -769,7 +871,11 @@ module Aurora
769
871
  3523 => "VS Drive UDC Voltage",
770
872
  3524 => "VS Drive Fan Speed",
771
873
  3804 => "VS Drive Details (EEV2 Ctl)",
772
- 3904 => "Leaving Air Temperature?",
874
+ 3808 => "VS Drive SuperHeat Percent",
875
+ 3903 => "VS Drive Suction Temperature",
876
+ 3904 => "VS Drive Leaving Air Temperature?",
877
+ 3905 => "VS Drive Saturated Evaporator Discharge Temperature",
878
+ 3906 => "VS Drive SuperHeat Temperature",
773
879
  31_003 => "Outdoor Temp",
774
880
  31_005 => "IZ2 Demand",
775
881
  31_109 => "Humidifier Mode", # write to 21114
@@ -786,8 +892,8 @@ module Aurora
786
892
  .merge(faults(601..699))
787
893
  .merge(ignore(711..717))
788
894
  .merge(zone_registers)
789
- .merge(ignore(3423))
790
- .merge(ignore(3425))
895
+ .merge(ignore(1147, 1149, 1151, 1153, 1155, 1157, 1165))
896
+ .merge(ignore(3423, 3425))
791
897
  .merge(ignore(31_401..31_412))
792
898
  .merge(ignore(31_414..31_420))
793
899
  .merge(ignore(31_422..31_433))
@@ -1,17 +1,15 @@
1
1
  # frozen_string_literal: true
2
2
 
3
+ require "aurora/component"
4
+
3
5
  module Aurora
4
- class Thermostat
6
+ class Thermostat < Component
5
7
  attr_reader :target_mode,
6
8
  :target_fan_mode,
7
9
  :ambient_temperature,
8
10
  :cooling_target_temperature,
9
11
  :heating_target_temperature
10
12
 
11
- def initialize(abc)
12
- @abc = abc
13
- end
14
-
15
13
  def refresh(registers)
16
14
  @ambient_temperature = registers[502]
17
15
  @heating_target_temperature = registers[746]
@@ -1,5 +1,5 @@
1
1
  # frozen_string_literal: true
2
2
 
3
3
  module Aurora
4
- VERSION = "0.3.13"
4
+ VERSION = "0.4.3"
5
5
  end
data/lib/aurora.rb CHANGED
@@ -3,8 +3,7 @@
3
3
  require "rmodbus"
4
4
 
5
5
  require "aurora/abc_client"
6
- require "aurora/iz2_zone"
7
- require "aurora/thermostat"
6
+ require "aurora/mock_abc"
8
7
  require "aurora/modbus/server"
9
8
  require "aurora/modbus/slave"
10
9
  require "aurora/registers"