waterfurnace_aurora 0.7.1 → 0.7.2

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: 8cb9189b26a420442c7cb7208ac5c955d6be8ed9296a73f62df320eec5ca69b4
4
- data.tar.gz: da661eea9277eef4f927e7714bf384f4377930a5e49df52632d7ed457df10fb5
3
+ metadata.gz: 99e010fe7824750e53ba48441df5bfeb529ee6f3ac82ab01bea677d7ef7ea128
4
+ data.tar.gz: 6988c340050b2e54a132d9c73ba1ad1641ff0b62ab032541dea8ccb2b15fba8d
5
5
  SHA512:
6
- metadata.gz: 7a80d7049be630d2531e6acfa4d0a56693377555f46a102cb742e1c9e947454f67756ae0f8ca9c146a99e8bbf9acc32db821eae65aa57d4186ca9a5bdfe5280f
7
- data.tar.gz: 6fcc21eea70ab2a9a8d7169c68528b01635a2e16acdff5601feed205c80b816f398323cb24c77ec7d3df1193c121247302cedd4fd844312015f26be1959a2c81
6
+ metadata.gz: 9c68d22de2c99fd5e84ac1c2b806252724daeeb5e8db33044cfc8281de22d23e8d7e93871ce38a000c21d0c8c3c564fd8e5346b7754d495803baa55480714371
7
+ data.tar.gz: d2301b364d1e1853d26113da9dbc2b1f484364c50c9e7a4d86dc13415afc423c4f977ce7516c600bc793b3993b42936ea0c17749033591daeb84ca928479f7ca
@@ -124,57 +124,153 @@ class MQTTBridge
124
124
  end
125
125
 
126
126
  def publish_basic_attributes
127
+ @homie.home_assistant_device = {
128
+ manufacturer: "WaterFurnace",
129
+ sw_version: Aurora::VERSION,
130
+ model: @abc.model
131
+ }
132
+
127
133
  @homie_abc = @homie.node("abc", "Heat Pump", "ABC") do |node|
128
134
  allowed_modes = %w[lockout standby blower heating cooling eh1 eh2 emergency waiting]
129
135
  allowed_modes << "dehumidify" if @abc.compressor.is_a?(Aurora::Compressor::VSDrive)
130
- node.property("current-mode", "Current Heating/Cooling Mode", :enum, @abc.current_mode,
131
- format: allowed_modes)
132
- node.property("entering-air-temperature", "Entering Air Temperature", :float, @abc.entering_air_temperature,
133
- unit: "°F")
134
- node.property("entering-water-temperature", "Entering Water Temperature", :float,
135
- @abc.entering_water_temperature, unit: "°F")
136
- node.property("leaving-air-temperature", "Leaving Air Temperature", :float, @abc.leaving_air_temperature,
137
- unit: "°F")
138
- node.property("leaving-water-temperature", "Leaving Water Temperature", :float, @abc.leaving_water_temperature,
139
- unit: "°F")
136
+ node.property("current-mode",
137
+ "Current Heating/Cooling Mode",
138
+ :enum,
139
+ @abc.current_mode,
140
+ format: allowed_modes,
141
+ hass: { sensor: { state_class: :measurement } })
142
+ node.property("entering-air-temperature",
143
+ "Entering Air Temperature",
144
+ :float,
145
+ @abc.entering_air_temperature,
146
+ unit: "°F",
147
+ hass: { sensor: { device_class: :temperature,
148
+ state_class: :measurement,
149
+ entity_category: :diagnostic } })
150
+ node.property("entering-water-temperature",
151
+ "Entering Water Temperature",
152
+ :float,
153
+ @abc.entering_water_temperature,
154
+ unit: "°F",
155
+ hass: { sensor: { device_class: :temperature,
156
+ state_class: :measurement,
157
+ entity_category: :diagnostic } })
158
+ node.property("leaving-air-temperature",
159
+ "Leaving Air Temperature",
160
+ :float,
161
+ @abc.leaving_air_temperature,
162
+ unit: "°F",
163
+ hass: { sensor: { device_class: :temperature,
164
+ state_class: :measurement,
165
+ entity_category: :diagnostic } })
166
+ node.property("leaving-water-temperature",
167
+ "Leaving Water Temperature",
168
+ :float,
169
+ @abc.leaving_water_temperature,
170
+ unit: "°F",
171
+ hass: { sensor: { device_class: :temperature,
172
+ state_class: :measurement,
173
+ entity_category: :diagnostic } })
140
174
  unless @abc.outdoor_temperature.zero? # TODO: figure out the config if this actually exists
141
- node.property("outdoor-temperature", "Outdoor Temperature", :float, @abc.outdoor_temperature, unit: "°F")
175
+ node.property("outdoor-temperature",
176
+ "Outdoor Temperature",
177
+ :float,
178
+ @abc.outdoor_temperature,
179
+ unit: "°F",
180
+ hass: { sensor: { device_class: :temperature,
181
+ state_class: :measurement } })
142
182
  end
143
183
 
144
- node.property("fp1", "FP1 Sensor", :float, @abc.fp1, unit: "°F")
145
- node.property("fp2", "FP2 Sensor", :float, @abc.fp2, unit: "°F")
184
+ node.property("fp1",
185
+ "FP1 Sensor",
186
+ :float,
187
+ @abc.fp1,
188
+ unit: "°F",
189
+ hass: { sensor: { device_class: :temperature,
190
+ state_class: :measurement,
191
+ entity_category: :diagnostic } })
192
+ node.property("fp2",
193
+ "FP2 Sensor",
194
+ :float,
195
+ @abc.fp2,
196
+ unit: "°F",
197
+ hass: { sensor: { device_class: :temperature,
198
+ state_class: :measurement,
199
+ entity_category: :diagnostic } })
146
200
  %i[aux_heat total].each do |component|
147
201
  component = "#{component}_watts"
148
202
  node.property(component.tr("_", "-"),
149
203
  component.sub("_watts", " Power Usage").tr("_", " ").titleize,
150
204
  :integer,
151
205
  @abc.public_send(component),
152
- unit: "W")
206
+ unit: "W",
207
+ hass: { sensor: { device_class: :power,
208
+ state_class: :measurement } })
153
209
  end
154
210
  end
155
211
 
156
212
  @compressor = @homie.node("compressor", "Compressor", @abc.compressor.type) do |node|
157
- node.property("speed", "Current Speed", :integer, @abc.compressor.speed,
158
- format: @abc.compressor.speed_range)
159
- node.property("watts", "Power Usage", :integer, @abc.compressor.watts, unit: "W") if @abc.energy_monitoring?
213
+ node.property("speed",
214
+ "Current Speed",
215
+ :integer,
216
+ @abc.compressor.speed,
217
+ format: @abc.compressor.speed_range,
218
+ hass: { sensor: { state_class: :measurement } })
219
+ if @abc.energy_monitoring?
220
+ node.property("watts",
221
+ "Power Usage",
222
+ :integer,
223
+ @abc.compressor.watts,
224
+ unit: "W",
225
+ hass: { sensor: { device_class: :power,
226
+ state_class: :measurement } })
227
+ end
160
228
 
161
229
  next unless @abc.compressor.is_a?(Aurora::Compressor::VSDrive)
162
230
 
163
- node.property("ambient-temperature", "Ambient Temperature", :float,
164
- @abc.compressor.ambient_temperature, unit: "°F")
231
+ node.property("ambient-temperature",
232
+ "Ambient Temperature",
233
+ :float,
234
+ @abc.compressor.ambient_temperature,
235
+ unit: "°F",
236
+ hass: { sensor: { device_class: :temperature,
237
+ state_class: :measurement,
238
+ entity_category: :diagnostic } })
165
239
 
166
240
  next unless @abc.iz2?
167
241
 
168
- node.property("iz2-desired-speed", "IZ2 Desired Speed", :integer, @abc.compressor.iz2_desired_speed,
169
- format: 0..12)
242
+ node.property("iz2-desired-speed",
243
+ "IZ2 Desired Speed",
244
+ :integer,
245
+ @abc.compressor.iz2_desired_speed,
246
+ format: 0..12,
247
+ hass: { sensor: { state_class: :measurement,
248
+ entity_category: :diagnostic } })
170
249
  end
171
250
 
172
251
  @blower = @homie.node("blower", "Blower", @abc.blower.type) do |node|
173
- node.property("running", "Running", :boolean, @abc.blower.running?)
252
+ node.property("running",
253
+ "Running",
254
+ :boolean,
255
+ @abc.blower.running?,
256
+ hass: { binary_sensor: { device_class: :running } })
174
257
  if @abc.blower.respond_to?(:speed)
175
- node.property("speed", "Current Speed", :integer, @abc.blower.speed, format: @abc.blower.speed_range)
258
+ node.property("speed",
259
+ "Current Speed",
260
+ :integer,
261
+ @abc.blower.speed,
262
+ format: @abc.blower.speed_range,
263
+ hass: { sensor: { state_class: :measurement } })
264
+ end
265
+ if @abc.energy_monitoring?
266
+ node.property("watts",
267
+ "Power Usage",
268
+ :integer,
269
+ @abc.blower.watts,
270
+ unit: "W",
271
+ hass: { sensor: { device_class: :power,
272
+ state_class: :measurement } })
176
273
  end
177
- node.property("watts", "Power Usage", :integer, @abc.blower.watts, unit: "W") if @abc.energy_monitoring?
178
274
 
179
275
  next unless @abc.blower.is_a?(Aurora::Blower::ECM)
180
276
 
@@ -182,95 +278,209 @@ class MQTTBridge
182
278
  presets.concat %w[low-compressor high-compressor] unless @abc.iz2?
183
279
  presets.each do |setting|
184
280
  field = "#{setting.tr("-", "_")}_speed"
185
- node.property("#{setting}-speed", "#{setting.tr("-", " ").titleize} Preset Speed", :integer,
186
- @abc.blower.public_send(field), format: 1..12) do |value, property|
281
+ node.property("#{setting}-speed",
282
+ "#{setting.tr("-", " ").titleize} Preset Speed",
283
+ :integer,
284
+ @abc.blower.public_send(field),
285
+ format: 1..12,
286
+ hass: { number: { entity_category: :config } }) do |value, property|
187
287
  @mutex.synchronize { property.value = @abc.blower.public_send("#{field}=", value) }
188
288
  end
189
289
  end
190
290
 
191
291
  next unless @abc.iz2?
192
292
 
193
- node.property("iz2-desired-speed", "IZ2 Desired Speed", :integer, @abc.blower.iz2_desired_speed,
194
- format: 0..100, unit: "%")
293
+ node.property("iz2-desired-speed",
294
+ "IZ2 Desired Speed",
295
+ :integer,
296
+ @abc.blower.iz2_desired_speed,
297
+ format: 0..100,
298
+ unit: "%",
299
+ hass: { sensor: { state_class: :measurement,
300
+ entity_category: :diagnostic } })
195
301
  end
196
302
 
197
303
  @pump = @homie.node("pump", "Loop Pump", @abc.pump.type) do |node|
198
- node.property("waterflow", "Waterflow", :float, @abc.pump.waterflow, unit: "gpm")
199
- node.property("watts", "Power Usage", :integer, @abc.pump.watts, unit: "W") if @abc.energy_monitoring?
304
+ node.property("waterflow",
305
+ "Waterflow",
306
+ :float,
307
+ @abc.pump.waterflow,
308
+ unit: "gpm",
309
+ hass: { sensor: { state_class: :measurement,
310
+ entity_category: :diagnostic } })
311
+ if @abc.energy_monitoring?
312
+ node.property("watts",
313
+ "Power Usage",
314
+ :integer,
315
+ @abc.pump.watts,
316
+ unit: "W",
317
+ hass: { sensor: { device_class: :power,
318
+ state_class: :measurement } })
319
+ end
200
320
 
201
321
  next unless @abc.pump.is_a?(Aurora::Pump::VSPump)
202
322
 
203
- node.property("running", "Running", :boolean, @abc.pump.running)
204
- node.property("speed", "Speed", :integer, @abc.pump.speed, format: 0..100, unit: "%") do |value, property|
323
+ node.property("running",
324
+ "Running",
325
+ :boolean,
326
+ @abc.pump.running,
327
+ hass: { binary_sensor: { device_class: :running } })
328
+ node.property("speed",
329
+ "Speed",
330
+ :integer,
331
+ @abc.pump.speed,
332
+ format: 0..100,
333
+ unit: "%",
334
+ hass: { number: { entity_category: :diagnostic } }) do |value, property|
205
335
  @mutex.synchronize { property.value = @abc.pump.speed = value }
206
336
  end
207
- node.property("manual-control", "Manual Control", :boolean,
208
- @abc.pump.manual_control?) do |value, property|
337
+ node.property("manual-control",
338
+ "Manual Control",
339
+ :boolean,
340
+ @abc.pump.manual_control?,
341
+ hass: { switch: { entity_category: :diagnostic } }) do |value, property|
209
342
  @mutex.synchronize { property.value = @abc.pump.manual_control = value }
210
343
  end
211
- node.property("minimum-speed", "Actual Minimum Speed", :integer, @abc.pump.minimum_speed,
212
- format: 0..100, unit: "%") do |value, property|
344
+ node.property("minimum-speed",
345
+ "Actual Minimum Speed",
346
+ :integer,
347
+ @abc.pump.minimum_speed,
348
+ format: 0..100,
349
+ unit: "%",
350
+ hass: { number: { entity_category: :config } }) do |value, property|
213
351
  @mutex.synchronize { property.value = @abc.pump.minimum_speed = value }
214
352
  end
215
- node.property("maximum-speed", "Actual Maximum Speed", :integer, @abc.pump.minimum_speed,
216
- format: 0..100, unit: "%") do |value, property|
353
+ node.property("maximum-speed",
354
+ "Actual Maximum Speed",
355
+ :integer,
356
+ @abc.pump.minimum_speed,
357
+ format: 0..100,
358
+ unit: "%",
359
+ hass: { number: { entity_category: :config } }) do |value, property|
217
360
  @mutex.synchronize { property.value = @abc.pump.maximum_speed = value }
218
361
  end
219
362
  end
220
363
 
221
364
  if @abc.dhw
222
365
  @dhw = @homie.node("dhw", "Domestic Hot Water Generator", "DHW") do |node|
223
- node.property("enabled", "Enabled", :boolean, @abc.dhw.enabled) do |value, property|
366
+ node.property("enabled",
367
+ "Enabled",
368
+ :boolean,
369
+ @abc.dhw.enabled,
370
+ hass: { switch: { icon: "mdi:water-boiler" } }) do |value, property|
224
371
  @mutex.synchronize { property.value = @abc.dhw.enabled = value }
225
372
  end
226
- node.property("running", "Pump Running", :boolean, @abc.dhw.running?)
227
- node.property("water-temperature", "Water Temperature", :float,
228
- @abc.dhw.water_temperature, unit: "°F")
229
- node.property("set-point", "Set Point", :float, @abc.dhw.set_point, format: 100..140,
230
- unit: "°F") do |value, property|
373
+ node.property("running",
374
+ "Pump Running",
375
+ :boolean,
376
+ @abc.dhw.running?,
377
+ hass: { binary_sensor: { device_class: :running } })
378
+ node.property("water-temperature",
379
+ "Water Temperature",
380
+ :float,
381
+ @abc.dhw.water_temperature,
382
+ unit: "°F",
383
+ hass: { sensor: { device_class: :temperature,
384
+ state_class: :measurement } })
385
+ node.property("set-point",
386
+ "Set Point",
387
+ :float,
388
+ @abc.dhw.set_point,
389
+ format: 100..140,
390
+ unit: "°F",
391
+ hass: :number) do |value, property|
231
392
  @mutex.synchronize { property.value = @abc.dhw.set_point = value }
232
393
  end
233
394
  end
234
395
  end
235
396
 
236
397
  @humidistat = @homie.node("humidistat", "Humidistat", "Humidistat") do |node|
237
- node.property("relative-humidity", "Relative Humidity", :integer, @abc.humidistat.relative_humidity,
238
- unit: "%", format: 0..100)
398
+ node.property("relative-humidity",
399
+ "Relative Humidity",
400
+ :integer,
401
+ @abc.humidistat.relative_humidity,
402
+ unit: "%",
403
+ format: 0..100,
404
+ hass: { sensor: { device_class: :humidity,
405
+ state_class: :measurement } })
239
406
  if @abc.humidistat.humidifier?
240
- node.property("humidifier-running", "Humidifier Running", :boolean, @abc.humidistat.humidifier_running?)
241
- node.property("humidifier-mode", "Humidifier Mode", :enum, @abc.humidistat.humidifier_mode,
407
+ node.property("humidifier-running",
408
+ "Humidifier Running",
409
+ :boolean,
410
+ @abc.humidistat.humidifier_running?)
411
+ node.property("humidifier-mode",
412
+ "Humidifier Mode",
413
+ :enum,
414
+ @abc.humidistat.humidifier_mode,
242
415
  format: %i[auto manual]) do |value, property|
243
416
  @mutex.synchronize { property.value = @abc.humidistat.humidifier_mode = value.to_sym }
244
417
  end
245
- node.property("humidification-target", "Humidification Target Relative Humidity", :integer,
246
- @abc.humidistat.humidification_target, unit: "%", format: 15..50) do |value, property|
418
+ node.property("humidification-target",
419
+ "Humidification Target Relative Humidity",
420
+ :integer,
421
+ @abc.humidistat.humidification_target,
422
+ unit: "%",
423
+ format: 15..50) do |value, property|
247
424
  @mutex.synchronize { property.value = @abc.humidistat.humidification_target = value }
248
425
  end
426
+ node.hass_humidifier("humidifier-running",
427
+ target_property: "humidification-target",
428
+ mode_property: "humidifier-mode",
429
+ id: "humidifier",
430
+ name: "Humidifier",
431
+ device_class: :humidifier)
249
432
  end
250
433
 
251
434
  # VSDrive can perform active dehumidification, even without a dedicated dehumidifier
252
- if @abc.humidistat.dehumidifier? || @abc.compressor.is_a?(Aurora::Compressor::VSDrive)
253
- node.property("dehumidifier-running", "Dehumidifier Running", :boolean, @abc.humidistat.dehumidifier_running?)
254
- node.property("dehumidifier-mode", "Dehumidifier Mode", :enum, @abc.humidistat.dehumidifier_mode,
435
+ if @abc.humidistat.dehumidifier? ||
436
+ @abc.compressor.is_a?(Aurora::Compressor::VSDrive)
437
+ node.property("dehumidifier-running",
438
+ "Dehumidifier Running",
439
+ :boolean,
440
+ @abc.humidistat.dehumidifier_running?)
441
+ node.property("dehumidifier-mode",
442
+ "Dehumidifier Mode",
443
+ :enum,
444
+ @abc.humidistat.dehumidifier_mode,
255
445
  format: %i[auto manual]) do |value, property|
256
446
  @mutex.synchronize { property.value = @abc.humidistat.dehumidifier_mode = value.to_sym }
257
447
  end
258
- node.property("dehumidification-target", "Dehumidification Target Relative Humidity", :integer,
259
- @abc.humidistat.dehumidification_target, unit: "%", format: 35..65) do |value, property|
448
+ node.property("dehumidification-target",
449
+ "Dehumidification Target Relative Humidity",
450
+ :integer,
451
+ @abc.humidistat.dehumidification_target,
452
+ unit: "%",
453
+ format: 35..65) do |value, property|
260
454
  @mutex.synchronize { property.value = @abc.humidistat.dehumidification_target = value }
261
455
  end
456
+ node.hass_humidifier("dehumidifier-running",
457
+ target_property: "dehumidification-target",
458
+ mode_property: "dehumidifier-mode",
459
+ id: "dehumidifier",
460
+ name: "Dehumidifier",
461
+ device_class: :dehumidifier)
262
462
  end
263
463
  end
264
464
 
265
465
  @faults = @homie.node("faults", "Fault History", "ABC") do |node|
266
- node.property("clear-history", "Reset Fault Counts", :enum, retained: false, format: "clear") do |_|
466
+ node.property("clear-history",
467
+ "Reset Fault Counts",
468
+ :enum,
469
+ retained: false,
470
+ format: "clear",
471
+ hass: :scene) do |_|
267
472
  @mutex.synchronize { @abc.clear_fault_history }
268
473
  end
269
474
  @abc.faults.each_with_index do |count, i|
270
475
  next if count == 0xffff
271
476
 
272
477
  name = Aurora::FAULTS[i + 1]
273
- node.property("e#{i + 1}", name || "E#{i + 1}", :integer, count)
478
+ node.property("e#{i + 1}",
479
+ name || "E#{i + 1}",
480
+ :integer,
481
+ count,
482
+ hass: { sensor: { state_class: :total_increasing,
483
+ entity_category: :diagnostic } })
274
484
  end
275
485
  end
276
486
 
@@ -279,39 +489,108 @@ class MQTTBridge
279
489
  @homie.node("zone#{i + 1}", "Zone #{i + 1}", type) do |node|
280
490
  allowed_modes = %w[off auto cool heat]
281
491
  allowed_modes << "eheat" if i.zero?
282
- node.property("target-mode", "Target Heating/Cooling Mode", :enum, zone.target_mode,
492
+ node.property("target-mode",
493
+ "Target Heating/Cooling Mode",
494
+ :enum,
495
+ zone.target_mode,
283
496
  format: allowed_modes) do |value, property|
284
497
  @mutex.synchronize { property.value = zone.target_mode = value.to_sym }
285
498
  end
286
- node.property("current-mode", "Current Heating/Cooling Mode Requested", :enum, zone.current_mode,
499
+ node.property("current-mode",
500
+ "Current Heating/Cooling Mode Requested",
501
+ :enum,
502
+ zone.current_mode,
287
503
  format: %w[standby h1 h2 h3 c1 c2])
288
- node.property("target-fan-mode", "Target Fan Mode", :enum, zone.target_fan_mode,
504
+ node.property("target-fan-mode",
505
+ "Target Fan Mode",
506
+ :enum,
507
+ zone.target_fan_mode,
289
508
  format: %w[auto continuous intermittent]) do |value, property|
290
509
  @mutex.synchronize { property.value = zone.target_fan_mode = value.to_sym }
291
510
  end
292
- node.property("fan-intermittent-on", "Fan Intermittent Mode On Duration", :enum, zone.fan_intermittent_on,
293
- unit: "M", format: %w[0 5 10 15 20]) do |value, property|
511
+ node.property("fan-intermittent-on",
512
+ "Fan Intermittent Mode On Duration",
513
+ :enum,
514
+ zone.fan_intermittent_on,
515
+ unit: "M",
516
+ format: %w[0 5 10 15 20],
517
+ hass: { select: { entity_category: :config } }) do |value, property|
294
518
  @mutex.synchronize { property.value = zone.fan_intermittent_on = value.to_i }
295
519
  end
296
- node.property("fan-intermittent-off", "Fan Intermittent Mode Off Duration", :enum, zone.fan_intermittent_on,
297
- unit: "M", format: %w[0 5 10 15 20 25 30 35 40]) do |value, property|
520
+ node.property("fan-intermittent-off",
521
+ "Fan Intermittent Mode Off Duration",
522
+ :enum,
523
+ zone.fan_intermittent_on,
524
+ unit: "M",
525
+ format: %w[0 5 10 15 20 25 30 35 40],
526
+ hass: { select: { entity_category: :config } }) do |value, property|
298
527
  @mutex.synchronize { property.value = zone.fan_intermittent_on = value.to_i }
299
528
  end
300
- node.property("current-fan-mode", "Current Fan Status", :boolean, zone.current_fan_mode)
529
+ node.property("current-fan-mode",
530
+ "Current Fan Status",
531
+ :boolean,
532
+ zone.current_fan_mode,
533
+ hass: { binary_sensor: { device_class: :running } })
301
534
  if zone.is_a?(Aurora::IZ2Zone)
302
- node.property("priority", "Zone Priority", :enum, zone.priority, format: %w[economy comfort])
303
- node.property("size", "Size", :enum, zone.size, format: %w[0 25 45 70])
304
- node.property("normalized-size", "Normalized Size", :integer, zone.normalized_size, unit: "%", format: 0..100)
535
+ node.property("priority",
536
+ "Zone Priority",
537
+ :enum,
538
+ zone.priority,
539
+ format: %w[economy comfort],
540
+ hass: { sensor: { state_class: :measurement,
541
+ entity_category: :diagnostic } })
542
+ node.property("size",
543
+ "Size",
544
+ :enum,
545
+ zone.size,
546
+ format: %w[0 25 45 70],
547
+ hass: { sensor: { state_class: :measurement,
548
+ entity_category: :diagnostic } })
549
+ node.property("normalized-size",
550
+ "Normalized Size",
551
+ :integer,
552
+ zone.normalized_size,
553
+ unit: "%",
554
+ format: 0..100,
555
+ hass: { sensor: { state_class: :measurement,
556
+ entity_category: :diagnostic } })
305
557
  end
306
- node.property("ambient-temperature", "Ambient Temperature", :float, zone.ambient_temperature, unit: "°F")
307
- node.property("heating-target-temperature", "Heating Target Temperature", :integer,
308
- zone.heating_target_temperature, unit: "°F", format: 40..90) do |value, property|
558
+ node.property("ambient-temperature",
559
+ "Ambient Temperature",
560
+ :float,
561
+ zone.ambient_temperature,
562
+ unit: "°F")
563
+ node.property("heating-target-temperature",
564
+ "Heating Target Temperature",
565
+ :integer,
566
+ zone.heating_target_temperature,
567
+ unit: "°F",
568
+ format: 40..90) do |value, property|
309
569
  @mutex.synchronize { property.value = zone.heating_target_temperature = value }
310
570
  end
311
- node.property("cooling-target-temperature", "Cooling Target Temperature", :integer,
312
- zone.cooling_target_temperature, unit: "°F", format: 54..99) do |value, property|
571
+ node.property("cooling-target-temperature",
572
+ "Cooling Target Temperature", :integer,
573
+ zone.cooling_target_temperature,
574
+ unit: "°F",
575
+ format: 54..99) do |value, property|
313
576
  @mutex.synchronize { property.value = zone.cooling_target_temperature = value }
314
577
  end
578
+ node.hass_climate(action_property: "current-mode",
579
+ current_temperature_property: "ambient-temperature",
580
+ fan_mode_property: "target-mode",
581
+ temperature_high_property: "cooling-target-temperature",
582
+ temperature_low_property: "heating-target-temperature",
583
+ templates: {
584
+ action_template: <<~JINJA
585
+ {% if value.startswith('h') %}
586
+ heating
587
+ {% elif value.startswith('c') %}
588
+ cooling
589
+ {% elif value == 'standby' %}
590
+ idle
591
+ {% endif %}
592
+ JINJA
593
+ })
315
594
  end
316
595
  end
317
596
 
@@ -319,169 +598,7 @@ class MQTTBridge
319
598
  @homie.mqtt.subscribe("#{@homie.topic}/$modbus")
320
599
  @homie.mqtt.subscribe("#{@homie.topic}/$modbus/getregs")
321
600
  @homie.mqtt.subscribe("#{@homie.topic}/$modbus/+/set")
322
- @homie.publish do
323
- # do HASS publishes in this block so they're done in bulk
324
-
325
- MQTT::HomeAssistant.publish_sensor(@homie["abc"]["current-mode"],
326
- device_class: :power)
327
- MQTT::HomeAssistant.publish_sensor(@homie["abc"]["entering-air-temperature"],
328
- device_class: :temperature,
329
- entity_category: :diagnostic)
330
- MQTT::HomeAssistant.publish_sensor(@homie["abc"]["entering-water-temperature"],
331
- device_class: :temperature,
332
- entity_category: :diagnostic)
333
- MQTT::HomeAssistant.publish_sensor(@homie["abc"]["leaving-air-temperature"],
334
- device_class: :temperature,
335
- entity_category: :diagnostic)
336
- MQTT::HomeAssistant.publish_sensor(@homie["abc"]["leaving-water-temperature"],
337
- device_class: :temperature,
338
- entity_category: :diagnostic)
339
- unless @abc.outdoor_temperature.zero?
340
- MQTT::HomeAssistant.publish_sensor(@homie["abc"]["outdoor-temperature"],
341
- device_class: :temperature)
342
- end
343
- MQTT::HomeAssistant.publish_sensor(@homie["abc"]["fp1"],
344
- device_class: :temperature,
345
- entity_category: :diagnostic)
346
- MQTT::HomeAssistant.publish_sensor(@homie["abc"]["fp2"],
347
- device_class: :temperature,
348
- entity_category: :diagnostic)
349
- MQTT::HomeAssistant.publish_sensor(@homie["abc"]["aux-heat-watts"],
350
- device_class: :power)
351
- MQTT::HomeAssistant.publish_sensor(@homie["abc"]["total-watts"],
352
- device_class: :power)
353
-
354
- MQTT::HomeAssistant.publish_sensor(@homie["compressor"]["speed"])
355
- MQTT::HomeAssistant.publish_sensor(@homie["compressor"]["watts"],
356
- device_class: :power)
357
-
358
- if @abc.compressor.is_a?(Aurora::Compressor::VSDrive)
359
- MQTT::HomeAssistant.publish_sensor(@homie["compressor"]["ambient-temperature"],
360
- device_class: :temperature,
361
- entity_category: :diagnostic)
362
-
363
- if @abc.iz2?
364
- MQTT::HomeAssistant.publish_sensor(@homie["compressor"]["iz2-desired-speed"],
365
- entity_category: :diagnostic)
366
- end
367
- end
368
-
369
- MQTT::HomeAssistant.publish_binary_sensor(@homie["blower"]["running"],
370
- device_class: :running)
371
- MQTT::HomeAssistant.publish_sensor(@homie["blower"]["speed"]) if @abc.blower.respond_to?(:speed)
372
- MQTT::HomeAssistant.publish_sensor(@homie["blower"]["watts"],
373
- device_class: :power)
374
- MQTT::HomeAssistant.publish_number(@homie["blower"]["blower-only-speed"],
375
- entity_category: :config)
376
- MQTT::HomeAssistant.publish_number(@homie["blower"]["aux-heat-speed"],
377
- entity_category: :config)
378
- if @abc.iz2?
379
- MQTT::HomeAssistant.publish_sensor(@homie["blower"]["iz2-desired-speed"])
380
- else
381
- MQTT::HomeAssistant.publish_number(@homie["blower"]["low-compressor-speed"],
382
- entity_category: :config)
383
- MQTT::HomeAssistant.publish_number(@homie["blower"]["high-compressor-speed"],
384
- entity_category: :config)
385
- end
386
-
387
- MQTT::HomeAssistant.publish_sensor(@homie["pump"]["waterflow"],
388
- entity_category: :diagnostic)
389
- MQTT::HomeAssistant.publish_sensor(@homie["pump"]["watts"],
390
- device_class: :power)
391
-
392
- if @abc.pump.is_a?(Aurora::Pump::VSPump)
393
- MQTT::HomeAssistant.publish_binary_sensor(@homie["pump"]["running"],
394
- device_class: :running)
395
- MQTT::HomeAssistant.publish_number(@homie["pump"]["speed"],
396
- entity_category: :diagnostic)
397
-
398
- MQTT::HomeAssistant.publish_switch(@homie["pump"]["manual-control"],
399
- entity_category: :diagnostic)
400
- MQTT::HomeAssistant.publish_number(@homie["pump"]["minimum-speed"],
401
- entity_category: :config)
402
- MQTT::HomeAssistant.publish_number(@homie["pump"]["maximum-speed"],
403
- entity_category: :config)
404
- end
405
-
406
- MQTT::HomeAssistant.publish_scene(@homie["faults"]["clear-history"])
407
- @homie["faults"].each do |property|
408
- next if property.id == "clear-history"
409
-
410
- MQTT::HomeAssistant.publish_sensor(property,
411
- entity_category: :diagnostic)
412
- end
413
-
414
- if @abc.dhw
415
- MQTT::HomeAssistant.publish_switch(@homie["dhw"]["enabled"],
416
- icon: "mdi:water-boiler")
417
- MQTT::HomeAssistant.publish_binary_sensor(@homie["dhw"]["running"],
418
- device_class: :running)
419
- MQTT::HomeAssistant.publish_sensor(@homie["dhw"]["water-temperature"],
420
- device_class: :temperature)
421
- MQTT::HomeAssistant.publish_number(@homie["dhw"]["set-point"])
422
- end
423
-
424
- MQTT::HomeAssistant.publish_sensor(@homie["humidistat"]["relative-humidity"],
425
- device_class: :humidity)
426
- if @abc.humidistat.humidifier?
427
- MQTT::HomeAssistant.publish_humidifier(
428
- @homie["humidistat"]["humidifier-running"],
429
- device_class: :humidifier,
430
- name: "Humidifier",
431
- id: "humidifier",
432
- target_property: @homie["humidistat"]["humidification-target"],
433
- mode_property: @homie["humidistat"]["humidifier-mode"]
434
- )
435
- end
436
- if @abc.humidistat.dehumidifier? || @abc.compressor.is_a?(Aurora::Compressor::VSDrive)
437
- MQTT::HomeAssistant.publish_humidifier(
438
- @homie["humidistat"]["dehumidifier-running"],
439
- device_class: :dehumidifier,
440
- name: "Dehumidifier",
441
- id: "dehumidifier",
442
- target_property: @homie["humidistat"]["dehumidification-target"],
443
- mode_property: @homie["humidistat"]["dehumidifier-mode"]
444
- )
445
- end
446
-
447
- @abc.zones.each_with_index do |zone, i|
448
- homie_zone = @homie["zone#{i + 1}"]
449
- MQTT::HomeAssistant.publish_climate(
450
- action_property: homie_zone["current-mode"],
451
- current_temperature_property: homie_zone["ambient-temperature"],
452
- fan_mode_property: homie_zone["target-fan-mode"],
453
- mode_property: homie_zone["target-mode"],
454
- temperature_high_property: homie_zone["cooling-target-temperature"],
455
- temperature_low_property: homie_zone["heating-target-temperature"],
456
- templates: {
457
- action_template: <<~JINJA
458
- {% if value.startswith('h') %}
459
- heating
460
- {% elif value.startswith('c') %}
461
- cooling
462
- {% elif value == 'standby' %}
463
- idle
464
- {% endif %}
465
- JINJA
466
- }
467
- )
468
- MQTT::HomeAssistant.publish_binary_sensor(homie_zone["current-fan-mode"],
469
- device_class: :running)
470
- MQTT::HomeAssistant.publish_select(homie_zone["fan-intermittent-on"],
471
- entity_category: :config)
472
- MQTT::HomeAssistant.publish_select(homie_zone["fan-intermittent-off"],
473
- entity_category: :config)
474
-
475
- next unless zone.is_a?(Aurora::IZ2Zone)
476
-
477
- MQTT::HomeAssistant.publish_sensor(homie_zone["priority"],
478
- entity_category: :diagnostic)
479
- MQTT::HomeAssistant.publish_sensor(homie_zone["size"],
480
- entity_category: :diagnostic)
481
- MQTT::HomeAssistant.publish_sensor(homie_zone["normalized-size"],
482
- entity_category: :diagnostic)
483
- end
484
- end
601
+ @homie.publish
485
602
  end
486
603
  end
487
604
 
@@ -43,6 +43,7 @@ module Aurora
43
43
  end
44
44
 
45
45
  attr_reader :modbus_slave,
46
+ :model,
46
47
  :serial_number,
47
48
  :zones,
48
49
  :compressor,
@@ -66,9 +67,10 @@ module Aurora
66
67
  @modbus_slave = self.class.open_modbus_slave(uri)
67
68
  @modbus_slave.read_retry_timeout = 15
68
69
  @modbus_slave.read_retries = 2
69
- raw_registers = @modbus_slave.holding_registers[33, 88..91, 105...110, 404, 412..413, 1103, 1114]
70
+ raw_registers = @modbus_slave.holding_registers[33, 88...110, 404, 412..413, 1103, 1114]
70
71
  registers = Aurora.transform_registers(raw_registers.dup)
71
72
  @program = registers[88]
73
+ @model = registers[92]
72
74
  @serial_number = registers[105]
73
75
  @energy_monitor = raw_registers[412]
74
76
 
@@ -1,5 +1,5 @@
1
1
  # frozen_string_literal: true
2
2
 
3
3
  module Aurora
4
- VERSION = "0.7.1"
4
+ VERSION = "0.7.2"
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.7.1
4
+ version: 0.7.2
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-12-09 00:00:00.000000000 Z
11
+ date: 2021-12-10 00:00:00.000000000 Z
12
12
  dependencies:
13
13
  - !ruby/object:Gem::Dependency
14
14
  name: ccutrer-serialport
@@ -30,20 +30,20 @@ dependencies:
30
30
  requirements:
31
31
  - - "~>"
32
32
  - !ruby/object:Gem::Version
33
- version: '0'
33
+ version: '0.1'
34
34
  - - ">="
35
35
  - !ruby/object:Gem::Version
36
- version: 0.0.2
36
+ version: 0.1.2
37
37
  type: :runtime
38
38
  prerelease: false
39
39
  version_requirements: !ruby/object:Gem::Requirement
40
40
  requirements:
41
41
  - - "~>"
42
42
  - !ruby/object:Gem::Version
43
- version: '0'
43
+ version: '0.1'
44
44
  - - ">="
45
45
  - !ruby/object:Gem::Version
46
- version: 0.0.2
46
+ version: 0.1.2
47
47
  - !ruby/object:Gem::Dependency
48
48
  name: net-telnet-rfc2217
49
49
  requirement: !ruby/object:Gem::Requirement