waterfurnace_aurora 1.4.7 → 1.4.9

Sign up to get free protection for your applications and to get access to all the features.
checksums.yaml CHANGED
@@ -1,7 +1,7 @@
1
1
  ---
2
2
  SHA256:
3
- metadata.gz: 3818cdd3c436ede6d451b02220702b2e27ab5c904deed2258b0329e3ddfc85c2
4
- data.tar.gz: 7770c14ff60b4bcc3f3614d57986233cb414b35bbae4857ff7726ca68c3c1796
3
+ metadata.gz: b28b02578f6c8cee89665c9bbbeee63beca4293b0e00ed443136ef38a2d42471
4
+ data.tar.gz: 54abf4d6ece6a830e8e26c7b75ca2e062261adbf5ac88369b28d71aca2924ad8
5
5
  SHA512:
6
- metadata.gz: e1d2e8b8a571068f5f905b7bb16ccb53414df338b9bbaf3c39f162015bd3a6dd95ea6fa9067db7a8342e099c6e99ce1311477823348b97da989847b690a0f470
7
- data.tar.gz: 16d8ca6f18aae43bbd4d87b286b4a07da01be0e39a2c10d5e99857b46495ed3cc683692b9d8f553683606716225dbf763592f7812fe6deb80245cffd9dfbb920
6
+ metadata.gz: 07dee234ff32befc9ac76c1b7eae9225aaaaf0a3421efda39339472242eda1d8bc7a5020509942d711ab03558d5cc9e78260b8677a2af537c1aeb1ab4968125d
7
+ data.tar.gz: c0b386559d04b2544a7b421c5a5ae03d130171160af6b7bca8b0f4ac7ff1c49772a74fd2b979a5eb5c3e7f041ce616e5104e4ea075fd1cbc7c602f5f529df1dc
data/exe/aurora_monitor CHANGED
@@ -12,7 +12,8 @@ diff_only = debug_modbus = ignore_awl_heartbeat = ignore_sensors = false
12
12
  options = OptionParser.new do |opts|
13
13
  opts.banner = "Usage: aurora_monitor /path/to/serial/port [options]"
14
14
 
15
- opts.on("-q", "--quiet",
15
+ opts.on("-q",
16
+ "--quiet",
16
17
  "Enables quiet mode (--diff-only, --ignore-awl-heartbeat, --ignore-sensors) to ease in deciphering new registers") do # rubocop:disable Layout/LineLength
17
18
  diff_only = true
18
19
  ignore_awl_heartbeat = true
@@ -43,8 +44,35 @@ uri = URI.parse(ARGV[0])
43
44
 
44
45
  last_registers = {}
45
46
 
46
- SENSOR_REGISTERS = [16, 19, 20, 740, 900, 901, 903, 908, 909, 1109, 1105, 1106, 1107, 1108, 1110, 1111, 1114, 1117,
47
- 1134, 1148, 1149, 1150, 1151, 1152, 1153, 1164, 1165, 3326, 3330].freeze
47
+ SENSOR_REGISTERS = [16,
48
+ 19,
49
+ 20,
50
+ 740,
51
+ 900,
52
+ 901,
53
+ 903,
54
+ 908,
55
+ 909,
56
+ 1109,
57
+ 1105,
58
+ 1106,
59
+ 1107,
60
+ 1108,
61
+ 1110,
62
+ 1111,
63
+ 1114,
64
+ 1117,
65
+ 1134,
66
+ 1148,
67
+ 1149,
68
+ 1150,
69
+ 1151,
70
+ 1152,
71
+ 1153,
72
+ 1164,
73
+ 1165,
74
+ 3326,
75
+ 3330].freeze
48
76
 
49
77
  io = case uri.scheme
50
78
  when "tcp"
@@ -19,7 +19,7 @@ options = OptionParser.new do |opts|
19
19
 
20
20
  opts.on("--device-name DEVICENAME", "Give a descriptive name to your device") { |v| device_name = v }
21
21
  opts.on("--debug-modbus", "Print actual protocol bytes") { debug_modbus = true }
22
- opts.on("--web-aid-tool PORT", "Run web aid tool on given port", :integer) { |v| web_aid_tool = v }
22
+ opts.on("--web-aid-tool PORT", "Run web aid tool on given port", Integer) { |v| web_aid_tool = v }
23
23
  opts.on("-v", "--version", "Print version") do
24
24
  puts Aurora::VERSION
25
25
  exit
@@ -70,7 +70,8 @@ class MQTTBridge
70
70
  registers = @abc.modbus_slave.read_multiple_holding_registers(*queries)
71
71
  result = registers.values.join(",")
72
72
  @homie.mqtt.publish("#{@homie.topic}/$modbus/getregs/response",
73
- "#{query_id}:#{result}", qos: 1)
73
+ "#{query_id}:#{result}",
74
+ qos: 1)
74
75
  when %r{\$modbus/(\d+)/set$}
75
76
  register = $1.to_i
76
77
  value = case value
@@ -236,13 +237,13 @@ class MQTTBridge
236
237
  state_class: :measurement } })
237
238
  end
238
239
 
239
- node.property("line-voltage",
240
+ node.property("line-voltage-setting",
240
241
  "Line Voltage Setting",
241
242
  :integer,
242
243
  @abc.line_voltage,
243
244
  format: 90..635,
244
245
  unit: "V") do |value|
245
- @mutex.synchronize { @abc.line_voltage = value }
246
+ @mutex.synchronize { @abc.line_voltage_setting = value }
246
247
  end
247
248
  if (-999..999).cover?(@abc.air_coil_temperature)
248
249
  node.property("air-coil-temperature",
@@ -255,6 +256,13 @@ class MQTTBridge
255
256
  entity_category: :diagnostic } })
256
257
  end
257
258
  if @abc.energy_monitoring?
259
+ node.property("line-voltage",
260
+ "Line Voltage",
261
+ :integer,
262
+ @abc.line_voltage,
263
+ format: 90..635,
264
+ unit: "V")
265
+
258
266
  node.property("watts",
259
267
  "Total Power Usage",
260
268
  :integer,
@@ -490,7 +498,7 @@ class MQTTBridge
490
498
  @abc.blower.public_send(field),
491
499
  format: 1..12,
492
500
  hass: { number: { entity_category: :config } }) do |value|
493
- @mutex.synchronize { @abc.blower.public_send("#{field}=", value) }
501
+ @mutex.synchronize { @abc.blower.public_send(:"#{field}=", value) }
494
502
  end
495
503
  end
496
504
 
@@ -798,7 +806,8 @@ class MQTTBridge
798
806
  @mutex.synchronize { zone.heating_target_temperature = value }
799
807
  end
800
808
  node.property("cooling-target-temperature",
801
- "Cooling Target Temperature", :integer,
809
+ "Cooling Target Temperature",
810
+ :integer,
802
811
  zone.cooling_target_temperature,
803
812
  unit: "°F",
804
813
  format: 54..99) do |value|
@@ -106,7 +106,7 @@ module Aurora
106
106
  last_log_time ||= Process.clock_gettime(Process::CLOCK_MONOTONIC)
107
107
  now = Process.clock_gettime(Process::CLOCK_MONOTONIC)
108
108
  if now - last_log_time > 5
109
- Aurora&.logger&.info("Fetching register(s) #{query}...")
109
+ Aurora.logger&.info("Fetching register(s) #{query}...")
110
110
  last_log_time = now
111
111
  end
112
112
  last_log_time
@@ -141,6 +141,7 @@ module Aurora
141
141
  :outdoor_temperature,
142
142
  :air_coil_temperature,
143
143
  :line_voltage,
144
+ :line_voltage_setting,
144
145
  :watts
145
146
 
146
147
  alias_method :emergency_shutdown?, :emergency_shutdown
@@ -201,7 +202,7 @@ module Aurora
201
202
  @registers_to_read << 1104 if axb?
202
203
  @registers_to_read.push(741, 31_003) if awl_communicating?
203
204
  @registers_to_read << (1110..1111) if performance_monitoring?
204
- @registers_to_read << (1150..1153) if energy_monitoring?
205
+ @registers_to_read.push(16, 1150..1153) if energy_monitoring?
205
206
  @registers_to_read << 900 if awl_axb?
206
207
  zones.each do |z|
207
208
  @registers_to_read.concat(z.registers_to_read)
@@ -243,7 +244,8 @@ module Aurora
243
244
  @high_pressure_switch = registers[31][:hps]
244
245
  @emergency_shutdown = !!registers[31][:emergency_shutdown]
245
246
  @load_shed = !!registers[31][:load_shed]
246
- @line_voltage = registers[112]
247
+ @line_voltage = registers[16] if energy_monitoring?
248
+ @line_voltage_setting = registers[112]
247
249
  @watts = registers[1153]
248
250
 
249
251
  @current_mode = if outputs.include?(:lockout)
@@ -285,7 +287,7 @@ module Aurora
285
287
  @modbus_slave.holding_registers[419] = (value * 10).to_i
286
288
  end
287
289
 
288
- def line_voltage=(value)
290
+ def line_voltage_setting=(value)
289
291
  raise ArgumentError unless (90..635).cover?(value)
290
292
 
291
293
  @modbus_slave.holding_registers[112] = value
data/lib/aurora/blower.rb CHANGED
@@ -51,7 +51,11 @@ module Aurora
51
51
  end
52
52
 
53
53
  class ECM < PSC
54
- attr_reader :speed, :blower_only_speed, :low_compressor_speed, :high_compressor_speed, :aux_heat_speed,
54
+ attr_reader :speed,
55
+ :blower_only_speed,
56
+ :low_compressor_speed,
57
+ :high_compressor_speed,
58
+ :aux_heat_speed,
55
59
  :iz2_desired_speed
56
60
 
57
61
  def speed_range
data/lib/aurora/dhw.rb CHANGED
@@ -22,7 +22,7 @@ module Aurora
22
22
  holding_registers[400] = value ? 1 : 0
23
23
  end
24
24
 
25
- def set_point=(value) # rubocop:disable Naming/AccessorMethodName
25
+ def set_point=(value)
26
26
  raise ArgumentError unless (100..140).cover?(value)
27
27
 
28
28
  raw_value = (value * 10).to_i
@@ -4,8 +4,11 @@ require "aurora/component"
4
4
 
5
5
  module Aurora
6
6
  class Humidistat < Component
7
- attr_reader :humidifier_running, :humidifier_mode, :humidification_target,
8
- :dehumidifier_mode, :dehumidification_target,
7
+ attr_reader :humidifier_running,
8
+ :humidifier_mode,
9
+ :humidification_target,
10
+ :dehumidifier_mode,
11
+ :dehumidification_target,
9
12
  :relative_humidity
10
13
  alias_method :humidifier_running?, :humidifier_running
11
14
 
@@ -76,4 +76,7 @@ end
76
76
  # 66 => read multiple discontiguous registers (command is a list of addrs)
77
77
  # 67 => write multiple discontiguous registers (command is a list of pairs of addr and value; response has no content)
78
78
  # 68 => ?? request has 4 bytes, response has 1 byte that seems to be 0 (for success?)
79
- ModBus::Server::Funcs.push(65, 66, 67, 68)
79
+ funcs = ModBus::Server::FUNCS.dup
80
+ funcs.push(65, 66, 67, 68)
81
+ ModBus::Server.send(:remove_const, :FUNCS)
82
+ ModBus::Server.const_set(:FUNCS, funcs.freeze)
@@ -61,7 +61,7 @@ module Aurora
61
61
  end
62
62
 
63
63
  def to_uint32(registers, idx)
64
- Aurora&.logger&.warn("Missing register #{idx + 1}") unless registers[idx + 1]
64
+ Aurora.logger&.warn("Missing register #{idx + 1}") unless registers[idx + 1]
65
65
  (registers[idx] << 16) + registers[idx + 1]
66
66
  end
67
67
 
@@ -494,6 +494,7 @@ module Aurora
494
494
  REGISTER_CONVERTERS = {
495
495
  TO_HUNDREDTHS => [2, 3, 417, 418, 801, 804, 807, 813, 816, 817, 819, 820, 825, 828],
496
496
  method(:dipswitch_settings) => [4, 33],
497
+ # rubocop:disable Layout/MultilineArrayLineBreaks
497
498
  TO_TENTHS => [401, 419, 745, 746, 901,
498
499
  1105, 1106, 1107, 1108, 1115, 1116, 1117, 1119,
499
500
  3322, 3323,
@@ -508,6 +509,7 @@ module Aurora
508
509
  1109, 1110, 1111, 1112, 1113, 1114, 1124, 1125, 1134, 1135, 1136,
509
510
  3325, 3326, 3327, 3330, 3522, 3903, 3905, 3906,
510
511
  31_003, 31_007, 31_010, 31_013, 31_016, 31_019, 31_022],
512
+ # rubocop:enable Layout/MultilineArrayLineBreaks
511
513
  TO_LAST_LOCKOUT => [26],
512
514
  ->(v) { from_bitmask(v, SYSTEM_OUTPUTS) } => [27, 30],
513
515
  ->(v) { from_bitmask(v, SYSTEM_INPUTS) } => [28],
@@ -561,6 +563,7 @@ module Aurora
561
563
  REGISTER_FORMATS = {
562
564
  "%ds" => [1, 6, 9, 15, 84, 85, 110],
563
565
  "%dV" => [16, 112, 3331, 3424, 3523],
566
+ # rubocop:disable Layout/MultilineArrayLineBreaks
564
567
  "%0.1f°F" => [19, 20, 401, 501, 502, 567, 740, 745, 746, 747, 900, 903,
565
568
  1109, 1110, 1111, 1112, 1113, 1114, 1124, 1125, 1134, 1135, 1136,
566
569
  3325, 3326, 3327, 3330, 3522, 3903, 3905, 3906,
@@ -573,6 +576,7 @@ module Aurora
573
576
  21_248, 21_249,
574
577
  31_003,
575
578
  31_007, 31_010, 31_013, 31_016, 31_019, 31_022],
579
+ # rubocop:enable Layout/MultilineArrayLineBreaks
576
580
  "E%d" => [25, 26],
577
581
  "%d%%" => [282, 321, 322, 325, 346, 565, 741, 908, 1126, 3332, 3524, 3808],
578
582
  "%0.1f psi" => [419, 901, 1115, 1116, 1119, 3322, 3323],
@@ -1,5 +1,5 @@
1
1
  # frozen_string_literal: true
2
2
 
3
3
  module Aurora
4
- VERSION = "1.4.7"
4
+ VERSION = "1.4.9"
5
5
  end
metadata CHANGED
@@ -1,14 +1,14 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: waterfurnace_aurora
3
3
  version: !ruby/object:Gem::Version
4
- version: 1.4.7
4
+ version: 1.4.9
5
5
  platform: ruby
6
6
  authors:
7
7
  - Cody Cutrer
8
8
  autorequire:
9
9
  bindir: exe
10
10
  cert_chain: []
11
- date: 2023-08-12 00:00:00.000000000 Z
11
+ date: 2024-10-07 00:00:00.000000000 Z
12
12
  dependencies:
13
13
  - !ruby/object:Gem::Dependency
14
14
  name: ccutrer-serialport
@@ -65,7 +65,7 @@ dependencies:
65
65
  - !ruby/object:Gem::Version
66
66
  version: 1.0.1
67
67
  - !ruby/object:Gem::Dependency
68
- name: rmodbus-ccutrer
68
+ name: rmodbus
69
69
  requirement: !ruby/object:Gem::Requirement
70
70
  requirements:
71
71
  - - "~>"
@@ -106,62 +106,6 @@ dependencies:
106
106
  - - "~>"
107
107
  - !ruby/object:Gem::Version
108
108
  version: '1.8'
109
- - !ruby/object:Gem::Dependency
110
- name: byebug
111
- requirement: !ruby/object:Gem::Requirement
112
- requirements:
113
- - - "~>"
114
- - !ruby/object:Gem::Version
115
- version: '11.0'
116
- type: :development
117
- prerelease: false
118
- version_requirements: !ruby/object:Gem::Requirement
119
- requirements:
120
- - - "~>"
121
- - !ruby/object:Gem::Version
122
- version: '11.0'
123
- - !ruby/object:Gem::Dependency
124
- name: rubocop
125
- requirement: !ruby/object:Gem::Requirement
126
- requirements:
127
- - - "~>"
128
- - !ruby/object:Gem::Version
129
- version: '1.23'
130
- type: :development
131
- prerelease: false
132
- version_requirements: !ruby/object:Gem::Requirement
133
- requirements:
134
- - - "~>"
135
- - !ruby/object:Gem::Version
136
- version: '1.23'
137
- - !ruby/object:Gem::Dependency
138
- name: rubocop-performance
139
- requirement: !ruby/object:Gem::Requirement
140
- requirements:
141
- - - "~>"
142
- - !ruby/object:Gem::Version
143
- version: '1.12'
144
- type: :development
145
- prerelease: false
146
- version_requirements: !ruby/object:Gem::Requirement
147
- requirements:
148
- - - "~>"
149
- - !ruby/object:Gem::Version
150
- version: '1.12'
151
- - !ruby/object:Gem::Dependency
152
- name: rubocop-rake
153
- requirement: !ruby/object:Gem::Requirement
154
- requirements:
155
- - - "~>"
156
- - !ruby/object:Gem::Version
157
- version: '0.6'
158
- type: :development
159
- prerelease: false
160
- version_requirements: !ruby/object:Gem::Requirement
161
- requirements:
162
- - - "~>"
163
- - !ruby/object:Gem::Version
164
- version: '0.6'
165
109
  description:
166
110
  email: cody@cutrer.us'
167
111
  executables:
@@ -218,7 +162,7 @@ required_rubygems_version: !ruby/object:Gem::Requirement
218
162
  - !ruby/object:Gem::Version
219
163
  version: '0'
220
164
  requirements: []
221
- rubygems_version: 3.3.7
165
+ rubygems_version: 3.5.11
222
166
  signing_key:
223
167
  specification_version: 4
224
168
  summary: Library for communication with WaterFurnace Aurora control systems