waterfurnace_aurora 0.5.0 → 0.6.0

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: 16b9a4ef085dc672bf6b360947c70a959f03b3406f0c2dae4eac614a2f12c412
4
- data.tar.gz: 5a7ef967170bd5440b94407e05cfe6e2f1bae40d838a23de26d442a1e4fa9a14
3
+ metadata.gz: 77762dc2957715e4f0a1dc4f608158b5f17a4801624f50d8af01ba26c8dc7410
4
+ data.tar.gz: 338fd829fb1bb364900242d2a4cdacada3e08a3b87214377f81f04b0c5f9eb66
5
5
  SHA512:
6
- metadata.gz: d31c1d4a82dc9420adedd8b5043ebde59845eb5cc90c14109ad51d533687e0fa7010e91c04858773d9f40523f534118d72f891fb673344810244e2d121c0b764
7
- data.tar.gz: b83b92e7b7ad9ecb2dda5eae57d2d460a82285420e169acc317c54390234cc123bead659fc56e2be53dbb602dd24e0b4cce66bd4223bd52badd7d543d641a4a7
6
+ metadata.gz: 1a16b1f69d3b5720bdc323ae27b7de9908573e6a959857dce575273129fcfa5a42e7754ea87a072d28afbc47aa5e8ec9e46b40682fcc9a88dca30c36ec2aa207
7
+ data.tar.gz: 0d221ae7e69561ab79dd0f9591751492c4282dc4fd33a658cc8bf99ee6973587616f199c6228e7ca2506eb99fb7a622bc77a33d0272cea942ff99177dae22c90
@@ -46,8 +46,20 @@ class MQTTBridge
46
46
  when /\$modbus$/
47
47
  registers = @abc.query_registers(value)
48
48
  Aurora.print_registers(registers) do |register, v|
49
- @homie.mqtt.publish("#{@homie.topic}/$modbus/#{register}", v, retain: false, qos: 1)
49
+ @homie.mqtt.publish("#{@homie.topic}/$modbus/#{register}", v, qos: 1)
50
50
  end
51
+ when %r{\$modbus/getregs}
52
+ query_id, query = value.split(":")
53
+ queries = query.split(";").map do |range|
54
+ start, length = range.split(",").map(&:to_i)
55
+ next start if length.nil?
56
+
57
+ start...(start + length)
58
+ end
59
+ registers = @abc.modbus_slave.read_multiple_holding_registers(*queries)
60
+ result = registers.values.join(",")
61
+ @homie.mqtt.publish("#{@homie.topic}/$modbus/getregs/response",
62
+ "#{query_id}:#{result}", qos: 1)
51
63
  when %r{\$modbus/(\d+)/set$}
52
64
  register = $1.to_i
53
65
  value = case value
@@ -59,7 +71,7 @@ class MQTTBridge
59
71
  @abc.modbus_slave.holding_registers[register] = value if value
60
72
  registers = { register => @abc.modbus_slave.holding_registers[register] }
61
73
  Aurora.print_registers(registers) do |r, v|
62
- @homie.mqtt.publish("#{@homie.topic}/$modbus/#{r}", v, retain: false, qos: 1)
74
+ @homie.mqtt.publish("#{@homie.topic}/$modbus/#{r}", v, qos: 1)
63
75
  end
64
76
  end
65
77
  end
@@ -79,7 +91,8 @@ class MQTTBridge
79
91
  @compressor => @abc.compressor,
80
92
  @blower => @abc.blower,
81
93
  @pump => @abc.pump,
82
- @dhw => @abc.dhw }.compact
94
+ @dhw => @abc.dhw,
95
+ @humidistat => @abc.humidistat }.compact
83
96
  @abc.zones.each_with_index do |z, idx|
84
97
  homie_zone = @homie["zone#{idx + 1}"]
85
98
  components[homie_zone] = z
@@ -92,6 +105,8 @@ class MQTTBridge
92
105
  end
93
106
 
94
107
  @abc.faults.each_with_index do |fault_count, i|
108
+ next if fault_count == 0xffff
109
+
95
110
  @faults["e#{i + 1}"].value = fault_count
96
111
  end
97
112
  end
@@ -105,8 +120,10 @@ class MQTTBridge
105
120
 
106
121
  def publish_basic_attributes
107
122
  @homie_abc = @homie.node("abc", "Aurora Basic Control", "ABC") do |node|
123
+ allowed_modes = %w[lockout standby blower heating cooling eh1 eh2 emergency waiting]
124
+ allowed_modes << "dehumidify" if @abc.compressor.is_a?(Aurora::Compressor::VSDrive)
108
125
  node.property("current-mode", "Current Heating/Cooling Mode", :enum, @abc.current_mode,
109
- format: %w[lockout standby blower heating cooling eh1 eh2 emergency waiting dehumidify])
126
+ format: allowed_modes)
110
127
  node.property("entering-air-temperature", "Entering Air Temperature", :float, @abc.entering_air_temperature,
111
128
  unit: "ºF")
112
129
  node.property("entering-water-temperature", "Entering Water Temperature", :float,
@@ -118,8 +135,7 @@ class MQTTBridge
118
135
  unless @abc.outdoor_temperature.zero? # TODO: figure out the config if this actually exists
119
136
  node.property("outdoor-temperature", "Outdoor Temperature", :float, @abc.outdoor_temperature, unit: "ºF")
120
137
  end
121
- node.property("relative-humidity", "Relative Humidity", :integer, @abc.relative_humidity, unit: "%",
122
- format: 0..100)
138
+
123
139
  node.property("fp1", "FP1 Sensor", :float, @abc.fp1, unit: "ºF")
124
140
  node.property("fp2", "FP2 Sensor", :float, @abc.fp2, unit: "ºF")
125
141
  %i[aux_heat total].each do |component|
@@ -177,6 +193,7 @@ class MQTTBridge
177
193
 
178
194
  next unless @abc.pump.is_a?(Aurora::Pump::VSPump)
179
195
 
196
+ node.property("running", "Pump is running", :boolean, @abc.pump.running)
180
197
  node.property("speed", "Speed", :integer, @abc.pump.speed, format: 0..100, unit: "%") do |value, property|
181
198
  @mutex.synchronize { property.value = @abc.pump.speed = value }
182
199
  end
@@ -199,6 +216,7 @@ class MQTTBridge
199
216
  node.property("enabled", "Enabled", :boolean, @abc.dhw.enabled) do |value, property|
200
217
  @mutex.synchronize { property.value = @abc.dhw.enabled = value }
201
218
  end
219
+ node.property("running", "DHW Pump is running", :boolean, @abc.dhw.running?)
202
220
  node.property("water-temperature", "Water Temperature", :float,
203
221
  @abc.dhw.water_temperature, unit: "ºF")
204
222
  node.property("set-point", "Set Point", :float, @abc.dhw.set_point, format: 100..140,
@@ -208,8 +226,45 @@ class MQTTBridge
208
226
  end
209
227
  end
210
228
 
229
+ @humidistat = @homie.node("humidistat", "Humidistat", "Humidistat") do |node|
230
+ node.property("relative-humidity", "Relative Humidity", :integer, @abc.humidistat.relative_humidity,
231
+ unit: "%", format: 0..100)
232
+ if @abc.humidistat.humidifier?
233
+ node.property("humidifier-running", "Humidifier is running", :boolean, @abc.humidistat.humidifier_running?)
234
+ node.property("humidifier-mode", "Humidifier Mode", :enum, @abc.humidistat.humidifier_mode,
235
+ format: %i[auto manual]) do |value, property|
236
+ @mutex.synchronize { property.value = @abc.humidistat.humidifier_mode = value.to_sym }
237
+ end
238
+ node.property("humidification-target", "Humidification target relative humidity", :integer,
239
+ @abc.humidistat.humidification_target, unit: "%", format: 15..50) do |value, property|
240
+ @mutex.synchronize { property.value = @abc.humidistat.humidification_target = value }
241
+ end
242
+ end
243
+
244
+ # VSDrive can perform active dehumidification, even without a dedicated dehumidifier
245
+ if @abc.humidistat.dehumidifier? || @abc.compressor.is_a?(Aurora::Compressor::VSDrive)
246
+ node.property("dehumidifier-mode", "Dehumidifier Mode", :enum, @abc.humidistat.dehumidifier_mode,
247
+ format: %i[auto manual]) do |value, property|
248
+ @mutex.synchronize { property.value = @abc.humidistat.dehumidifier_mode = value.to_sym }
249
+ end
250
+ node.property("dehumidification-target", "Dehumidification target relative humidity", :integer,
251
+ @abc.humidistat.dehumidification_target, unit: "%", format: 35..65) do |value, property|
252
+ @mutex.synchronize { property.value = @abc.humidistat.dehumidification_target = value }
253
+ end
254
+ end
255
+
256
+ next unless @abc.humidistat.dehumidifier?
257
+
258
+ node.property("dehumidifier-running", "Dehumidifier is running", :boolean, @abc.humidistat.dehumidifier_running?)
259
+ end
260
+
211
261
  @faults = @homie.node("faults", "Fault History", "ABC") do |node|
262
+ node.property("clear-history", "Reset fault counts", :enum, retained: false, format: "clear") do |_|
263
+ @mutex.synchronize { @abc.clear_fault_history }
264
+ end
212
265
  @abc.faults.each_with_index do |count, i|
266
+ next if count == 0xffff
267
+
213
268
  name = Aurora::FAULTS[i + 1]
214
269
  node.property("e#{i + 1}", name || "E#{i + 1}", :integer, count)
215
270
  end
@@ -258,6 +313,7 @@ class MQTTBridge
258
313
 
259
314
  # direct access to modbus registers for debugging purposes
260
315
  @homie.mqtt.subscribe("#{@homie.topic}/$modbus")
316
+ @homie.mqtt.subscribe("#{@homie.topic}/$modbus/getregs")
261
317
  @homie.mqtt.subscribe("#{@homie.topic}/$modbus/+/set")
262
318
  @homie.publish
263
319
  end
@@ -6,6 +6,7 @@ require "uri"
6
6
  require "aurora/blower"
7
7
  require "aurora/compressor"
8
8
  require "aurora/dhw"
9
+ require "aurora/humidistat"
9
10
  require "aurora/iz2_zone"
10
11
  require "aurora/pump"
11
12
  require "aurora/thermostat"
@@ -26,7 +27,9 @@ module Aurora
26
27
  port: uri.port || 23,
27
28
  baud: 19_200,
28
29
  parity: :even)
29
-
30
+ when "mqtt", "mqtts"
31
+ require "aurora/mqtt_modbus"
32
+ return Aurora::MQTTModBus.new(uri)
30
33
  else
31
34
  return Aurora::MockABC.new(YAML.load_file(uri.path)) if File.file?(uri.path)
32
35
 
@@ -46,10 +49,10 @@ module Aurora
46
49
  :blower,
47
50
  :pump,
48
51
  :dhw,
52
+ :humidistat,
49
53
  :faults,
50
54
  :current_mode,
51
55
  :entering_air_temperature,
52
- :relative_humidity,
53
56
  :leaving_air_temperature,
54
57
  :leaving_water_temperature,
55
58
  :entering_water_temperature,
@@ -63,7 +66,7 @@ module Aurora
63
66
  @modbus_slave = self.class.open_modbus_slave(uri)
64
67
  @modbus_slave.read_retry_timeout = 15
65
68
  @modbus_slave.read_retries = 2
66
- raw_registers = @modbus_slave.holding_registers[88..91, 105...110, 404, 412..413, 1114]
69
+ raw_registers = @modbus_slave.holding_registers[33, 88..91, 105...110, 404, 412..413, 1103, 1114]
67
70
  registers = Aurora.transform_registers(raw_registers.dup)
68
71
  @program = registers[88]
69
72
  @serial_number = registers[105]
@@ -76,7 +79,14 @@ module Aurora
76
79
  [Thermostat.new(self)]
77
80
  end
78
81
 
79
- @compressor = @program == "ABCVSP" ? Compressor::VSDrive.new(self) : Compressor::GenericCompressor.new(self)
82
+ @abc_dipswitches = registers[33]
83
+ @axb_dipswitches = registers[1103]
84
+ @compressor = if @program == "ABCVSP"
85
+ Compressor::VSDrive.new(self)
86
+ else
87
+ Compressor::GenericCompressor.new(self,
88
+ @abc_dipswitches[:compressor])
89
+ end
80
90
  @blower = case raw_registers[404]
81
91
  when 1, 2 then Blower::ECM.new(self, registers[404])
82
92
  when 3 then Blower::FiveSpeed.new(self, registers[404])
@@ -90,8 +100,23 @@ module Aurora
90
100
  registers[413])
91
101
  end
92
102
  @dhw = DHW.new(self) if (-999..999).include?(registers[1114])
103
+ @humidistat = Humidistat.new(self,
104
+ @abc_dipswitches[:accessory_relay] == :humidifier,
105
+ @axb_dipswitches[:accessory_relay2] == :dehumidifier)
93
106
 
94
107
  @faults = []
108
+
109
+ @registers_to_read = [6, 19..20, 25, 30, 344, 740..741, 900, 1104, 1110..1111, 1114, 1150..1153, 1165,
110
+ 31_003]
111
+ zones.each do |z|
112
+ @registers_to_read.concat(z.registers_to_read)
113
+ end
114
+ @components = [compressor, blower, pump, dhw, humidistat].compact
115
+ @components.each do |component|
116
+ @registers_to_read.concat(component.registers_to_read)
117
+ end
118
+ # need dehumidify mode to calculate final current mode
119
+ @registers_to_read.concat([362]) if compressor.is_a?(Compressor::VSDrive)
95
120
  end
96
121
 
97
122
  def query_registers(query)
@@ -129,28 +154,15 @@ module Aurora
129
154
  end
130
155
 
131
156
  def refresh
132
- registers_to_read = [6, 19..20, 25, 30, 344, 740..741, 900, 1110..1111, 1114, 1150..1153, 1165,
133
- 31_003]
134
- zones.each do |z|
135
- registers_to_read.concat(z.registers_to_read)
136
- end
137
- registers_to_read.concat(compressor.registers_to_read)
138
- registers_to_read.concat(blower.registers_to_read)
139
- registers_to_read.concat(pump.registers_to_read)
140
- registers_to_read.concat(dhw.registers_to_read) if dhw
141
- # need dehumidify mode to calculate final current mode;
142
- # apparently non-VSD doesn't have this register at all?
143
- registers_to_read.concat([362]) if compressor.is_a?(Compressor::VSDrive)
157
+ faults = @modbus_slave.read_multiple_holding_registers(601..699)
158
+ @faults = Aurora.transform_registers(faults).values
144
159
 
145
- @faults = @modbus_slave.holding_registers[601..699]
146
-
147
- registers = @modbus_slave.holding_registers[*registers_to_read]
160
+ registers = @modbus_slave.holding_registers[*@registers_to_read]
148
161
  Aurora.transform_registers(registers)
149
162
 
150
163
  outputs = registers[30]
151
164
 
152
165
  @entering_air_temperature = registers[740]
153
- @relative_humidity = registers[741]
154
166
  @leaving_air_temperature = registers[900]
155
167
  @leaving_water_temperature = registers[1110]
156
168
  @entering_water_temperature = registers[1111]
@@ -185,10 +197,9 @@ module Aurora
185
197
  zones.each do |z|
186
198
  z.refresh(registers)
187
199
  end
188
- compressor.refresh(registers)
189
- blower.refresh(registers)
190
- pump.refresh(registers)
191
- dhw&.refresh(registers)
200
+ @components.each do |component|
201
+ component.refresh(registers)
202
+ end
192
203
  end
193
204
 
194
205
  def cooling_airflow_adjustment=(value)
@@ -7,12 +7,17 @@ module Aurora
7
7
  class GenericCompressor < Component
8
8
  attr_reader :speed, :watts
9
9
 
10
+ def initialize(abc, stages)
11
+ super(abc)
12
+ @stages = stages
13
+ end
14
+
10
15
  def type
11
- "Compressor"
16
+ "#{@stages == 2 ? 'Dual' : 'Single'} Stage Compressor"
12
17
  end
13
18
 
14
19
  def speed_range
15
- 0..2
20
+ 0..@stages
16
21
  end
17
22
 
18
23
  def registers_to_read
@@ -39,12 +44,12 @@ module Aurora
39
44
  class VSDrive < GenericCompressor
40
45
  attr_reader :ambient_temperature, :iz2_desired_speed
41
46
 
42
- def type
43
- "Variable Speed Drive"
47
+ def initialize(abc)
48
+ super(abc, 12)
44
49
  end
45
50
 
46
- def speed_range
47
- 0..12
51
+ def type
52
+ "Variable Speed Drive"
48
53
  end
49
54
 
50
55
  def registers_to_read
data/lib/aurora/dhw.rb CHANGED
@@ -4,7 +4,8 @@ require "aurora/component"
4
4
 
5
5
  module Aurora
6
6
  class DHW < Component
7
- attr_reader :enabled, :set_point, :water_temperature
7
+ attr_reader :enabled, :running, :set_point, :water_temperature
8
+ alias running? running
8
9
 
9
10
  def registers_to_read
10
11
  [400..401, 1114]
@@ -12,6 +13,7 @@ module Aurora
12
13
 
13
14
  def refresh(registers)
14
15
  @enabled = registers[400]
16
+ @running = registers[1104].include?(:dhw)
15
17
  @set_point = registers[401]
16
18
  @water_temperature = registers[1114]
17
19
  end
@@ -0,0 +1,92 @@
1
+ # frozen_string_literal: true
2
+
3
+ require "aurora/component"
4
+
5
+ module Aurora
6
+ class Humidistat < Component
7
+ attr_reader :humidifier_running, :humidifier_mode, :humidification_target,
8
+ :dehumidifier_running, :dehumidifier_mode, :dehumidification_target,
9
+ :relative_humidity
10
+ alias humidifier_running? humidifier_running
11
+ alias dehumidifer_running? dehumidifier_running
12
+
13
+ def initialize(abc, has_humidifier, has_dehumidifier)
14
+ super(abc)
15
+ @humidifier = has_humidifier
16
+ @dehumidifier = has_dehumidifier
17
+ end
18
+
19
+ def humidifier?
20
+ @humidifier
21
+ end
22
+
23
+ def dehumidifier?
24
+ @dehumidifier
25
+ end
26
+
27
+ def registers_to_read
28
+ result = [741]
29
+ if humidifier? || dehumidifier? || abc.compressor.is_a?(Compressor::VSDrive)
30
+ result.concat(abc.iz2? ? [21_114, 31_109..31_110] : [12_309..12_310])
31
+ end
32
+ result
33
+ end
34
+
35
+ def refresh(registers)
36
+ @relative_humidity = registers[741]
37
+
38
+ outputs = registers[30]
39
+ @humidifier_running = humidifier? && outputs.include?(:accessory)
40
+
41
+ outputs = registers[1104]
42
+ @dehumidifer_running = dehumidifier? && outputs.include?(:accessory2)
43
+
44
+ base = abc.iz2? ? 31_109 : 12_309
45
+ @humidifier_settings = registers[abc.iz2? ? 21_114 : 12_309]
46
+ @humidifier_mode = @humidifier_settings&.include?(:auto_humidification) ? :auto : :manual
47
+ @dehumidifier_mode = @humidifier_settings&.include?(:auto_dehumidification) ? :auto : :manual
48
+
49
+ @humidification_target = registers[base + 1]&.[](:humidification_target)
50
+ @dehumidification_target = registers[base + 1]&.[](:dehumidification_target)
51
+ end
52
+
53
+ def humidifier_mode=(mode)
54
+ set_humidistat_mode(mode, dehumidifier_mode)
55
+ end
56
+
57
+ def dehumidifier_mode=(mode)
58
+ set_humidistat_mode(humidifier_mode, mode)
59
+ end
60
+
61
+ def set_humidistat_mode(humidifier_mode, dehumidifier_mode)
62
+ allowed = %i[auto manual]
63
+ raise ArgumentError unless allowed.include?(humidifier_mode) && allowed.include?(dehumidifier_mode)
64
+
65
+ # start with the prior value of the register, since I'm not sure what
66
+ # else is stuffed in there
67
+ raw_value = @humidifier_settings &= ~0xc000
68
+ raw_value |= 0x4000 if humidifier_mode == :auto
69
+ raw_value |= 0x8000 if dehumidifier_mode == :auto
70
+ holding_registers[abc.iz2? ? 21_114 : 12_309] = raw_value
71
+ @humidifier_mode = humidifier_mode
72
+ @dehumidifier_mode = dehumidifier_mode
73
+ end
74
+
75
+ def humidification_target=(value)
76
+ set_humidistat_targets(value, dehumidification_target)
77
+ end
78
+
79
+ def dehumidification_target=(value)
80
+ set_humidistat_targets(humidification_target, value)
81
+ end
82
+
83
+ def set_humidistat_targets(humidification_target, dehumidification_target)
84
+ raise ArgumentError unless (15..50).include?(humidification_target)
85
+ raise ArgumentError unless (35..65).include?(dehumidification_target)
86
+
87
+ holding_registers[iz2? ? 21_115 : 12_310] = (humidification_target << 8) + dehumidification_target
88
+ @humidification_target = humidification_target
89
+ @dehumidification_target = dehumidification_target
90
+ end
91
+ end
92
+ end
@@ -0,0 +1,47 @@
1
+ # frozen_string_literal: true
2
+
3
+ require "mqtt"
4
+ require "securerandom"
5
+
6
+ module Aurora
7
+ class MQTTModBus
8
+ attr_accessor :logger
9
+
10
+ def initialize(uri)
11
+ @mqtt = MQTT::Client.new(uri)
12
+ @mqtt.connect
13
+
14
+ @base_topic = uri.path[1..]
15
+ @mqtt.subscribe("#{@base_topic}/getregs/response")
16
+ end
17
+
18
+ def read_multiple_holding_registers(*queries)
19
+ query_id = SecureRandom.uuid
20
+ mqtt_query = queries.map { |m| m.is_a?(Range) ? "#{m.begin},#{m.count}" : m }.join(";")
21
+ @mqtt.publish("#{@base_topic}/getregs", "#{query_id}:#{mqtt_query}", qos: 1)
22
+ Timeout.timeout(15) do
23
+ result = {}
24
+ loop do
25
+ packet = @mqtt.get
26
+ response_id, registers_flat = packet.payload.split(":")
27
+ next unless response_id == query_id
28
+
29
+ values = registers_flat.split(",").map(&:to_i)
30
+ result_index = 0
31
+ queries.each do |query|
32
+ Array(query).each do |i|
33
+ result[i] = values[result_index]
34
+ result_index += 1
35
+ end
36
+ end
37
+ break
38
+ end
39
+ result
40
+ end
41
+ end
42
+
43
+ def write_holding_register(addr, value)
44
+ @mqtt.publish("#{@base_topic}/#{addr}/set", value, qos: 1)
45
+ end
46
+ end
47
+ end
data/lib/aurora/pump.rb CHANGED
@@ -5,7 +5,8 @@ require "aurora/component"
5
5
  module Aurora
6
6
  module Pump
7
7
  class GenericPump < Component
8
- attr_reader :type, :watts, :waterflow
8
+ attr_reader :type, :watts, :waterflow, :running
9
+ alias running? running
9
10
 
10
11
  def initialize(abc, type)
11
12
  super(abc)
@@ -21,6 +22,7 @@ module Aurora
21
22
  def refresh(registers)
22
23
  @waterflow = registers[1117]
23
24
  @watts = registers[1164] if abc.energy_monitoring?
25
+ @running = registers[1104].include?(:loop_pump)
24
26
  end
25
27
  end
26
28
 
@@ -194,24 +194,24 @@ module Aurora
194
194
  name ? "#{value} #{name}" : value.to_s
195
195
  end
196
196
 
197
- AR_SETTINGS = {
198
- 0 => "Cycle with Compressor",
199
- 1 => "Slow Opening Water Valve",
200
- 2 => "Cycle with Thermostat Humidification Call",
201
- 3 => "Cycle with Blower"
197
+ ACCESSORY_RELAY_SETTINGS = {
198
+ 0 => :compressor,
199
+ 1 => :slow_opening_water_valve,
200
+ 2 => :humidifier,
201
+ 3 => :blower
202
202
  }.freeze
203
203
 
204
204
  def dipswitch_settings(value)
205
205
  return :manual if value == 0x7fff
206
206
 
207
207
  {
208
- fp1: value & 0x01 == 0x01 ? "30ºF" : "15ºF",
209
- fp2: value & 0x02 == 0x02 ? "30ºF" : "15ºF",
210
- rv: value & 0x04 == 0x04 ? "O" : "B",
211
- ar: AR_SETTINGS[(value >> 3) & 0x3],
212
- cc: value & 0x20 == 0x20 ? "Single Stage" : "Dual Stage",
213
- lo: value & 0x40 == 0x40 ? "Continouous" : "Pulse",
214
- dh_rh: value & 0x80 == 0x80 ? "Dehumidifier On" : "Reheat On"
208
+ fp1: value & 0x01 == 0x01 ? 30 : 15,
209
+ fp2: value & 0x02 == 0x02 ? 30 : :off,
210
+ reversing_valve: value & 0x04 == 0x04 ? :o : :b, # cycle to cool on O, or !B
211
+ accessory_relay: ACCESSORY_RELAY_SETTINGS[(value >> 3) & 0x3],
212
+ compressor: value & 0x20 == 0x20 ? 1 : 2, # single or dual stage compressor
213
+ lockout: value & 0x40 == 0x40 ? :continuous : :pulse,
214
+ dehumidifier_reheat: value & 0x80 == 0x80 ? :dehumidifier : :reheat
215
215
  }
216
216
  end
217
217
 
@@ -302,23 +302,23 @@ module Aurora
302
302
 
303
303
  def axb_inputs(value)
304
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
305
+ result[:smart_grid] = value & 0x001 == 0x001
306
+ result[:ha1] = value & 0x002 == 0x002
307
+ result[:ha2] = value & 0x004 == 0x004
308
+ result[:pump_slave] = value & 0x008 == 0x008
309
309
 
310
310
  result[:mb_address] = value & 0x010 == 0x010 ? 3 : 4
311
311
  result[:sw1_2] = value & 0x020 == 0x020 # future use # rubocop:disable Naming/VariableNumber
312
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
313
+ result[:accessory_relay2] = 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
+ :dehumidifier
321
+ end
322
322
  leftover = value & ~0x1ff
323
323
  result[:unknown] = format("0x%04x", leftover) unless leftover.zero?
324
324
  result
@@ -533,8 +533,8 @@ module Aurora
533
533
  method(:thermostat_configuration2) => [12_006],
534
534
  ->(v) { HEATING_MODE[v] } => [12_606, 21_202, 21_211, 21_220, 21_229, 21_238, 21_247],
535
535
  ->(v) { FAN_MODE[v] } => [12_621, 21_205, 21_214, 21_223, 21_232, 21_241, 21_250],
536
- ->(v) { from_bitmask(v, HUMIDIFIER_SETTINGS) } => [31_109],
537
- ->(v) { { humidification_target: v >> 8, dehumidification_target: v & 0xff } } => [31_110],
536
+ ->(v) { from_bitmask(v, HUMIDIFIER_SETTINGS) } => [12_309, 21_114, 31_109],
537
+ ->(v) { { humidification_target: v >> 8, dehumidification_target: v & 0xff } } => [12_310, 21_115, 31_110],
538
538
  method(:iz2_demand) => [31_005],
539
539
  method(:zone_configuration1) => [12_005, 31_008, 31_011, 31_014, 31_017, 31_020, 31_023],
540
540
  method(:zone_configuration2) => [31_009, 31_012, 31_015, 31_018, 31_021, 31_024],
@@ -888,16 +888,20 @@ module Aurora
888
888
  3906 => "VS Drive SuperHeat Temperature",
889
889
  12_005 => "Fan Configuration",
890
890
  12_006 => "Heating Mode",
891
+ 12_309 => "De/Humidifier Mode",
892
+ 12_310 => "De/Humidifier Setpoints",
891
893
  12_606 => "Heating Mode (write)",
892
894
  12_619 => "Heating Setpoint (write)",
893
895
  12_620 => "Cooling Setpoint (write)",
894
896
  12_621 => "Fan Mode (write)",
895
897
  12_622 => "Intermittent Fan On Time (write)",
896
898
  12_623 => "Intermittent Fan Off Time (write)",
899
+ 21_114 => "IZ2 De/Humidifier Mode (write)",
900
+ 21_115 => "IZ2 De/Humidifier Setpoints (write)",
897
901
  31_003 => "Outdoor Temp",
898
902
  31_005 => "IZ2 Demand",
899
- 31_109 => "Humidifier Mode", # write to 21114
900
- 31_110 => "Manual De/Humidification Target", # write to 21115
903
+ 31_109 => "De/Humidifier Mode",
904
+ 31_110 => "Manual De/Humidification Setpoints",
901
905
  31_400 => "Dealer Name",
902
906
  31_413 => "Dealer Phone",
903
907
  31_421 => "Dealer Address 1",
@@ -1,5 +1,5 @@
1
1
  # frozen_string_literal: true
2
2
 
3
3
  module Aurora
4
- VERSION = "0.5.0"
4
+ VERSION = "0.6.0"
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: 0.5.0
4
+ version: 0.6.0
5
5
  platform: ruby
6
6
  authors:
7
7
  - Cody Cutrer
8
8
  autorequire:
9
9
  bindir: exe
10
10
  cert_chain: []
11
- date: 2021-09-01 00:00:00.000000000 Z
11
+ date: 2021-09-02 00:00:00.000000000 Z
12
12
  dependencies:
13
13
  - !ruby/object:Gem::Dependency
14
14
  name: ccutrer-serialport
@@ -139,10 +139,12 @@ files:
139
139
  - lib/aurora/compressor.rb
140
140
  - lib/aurora/core_ext/string.rb
141
141
  - lib/aurora/dhw.rb
142
+ - lib/aurora/humidistat.rb
142
143
  - lib/aurora/iz2_zone.rb
143
144
  - lib/aurora/mock_abc.rb
144
145
  - lib/aurora/modbus/server.rb
145
146
  - lib/aurora/modbus/slave.rb
147
+ - lib/aurora/mqtt_modbus.rb
146
148
  - lib/aurora/pump.rb
147
149
  - lib/aurora/registers.rb
148
150
  - lib/aurora/thermostat.rb