waterfurnace_aurora 0.7.7 → 1.1.0

Sign up to get free protection for your applications and to get access to all the features.
@@ -90,29 +90,33 @@ class MQTTBridge
90
90
  loop do
91
91
  begin
92
92
  @mutex.synchronize do
93
- @abc.refresh
94
-
95
- components = { @homie_abc => @abc,
96
- @compressor => @abc.compressor,
97
- @blower => @abc.blower,
98
- @pump => @abc.pump,
99
- @dhw => @abc.dhw,
100
- @humidistat => @abc.humidistat }.compact
101
- @abc.zones.each_with_index do |z, idx|
102
- homie_zone = @homie["zone#{idx + 1}"]
103
- components[homie_zone] = z
104
- end
93
+ @homie.mqtt.batch_publish do
94
+ @abc.refresh
95
+
96
+ components = { @homie_abc => @abc,
97
+ @aux_heat => @abc.aux_heat,
98
+ @compressor => @abc.compressor,
99
+ @blower => @abc.blower,
100
+ @pump => @abc.pump,
101
+ @dhw => @abc.dhw,
102
+ @humidistat => @abc.humidistat }.compact
103
+ @abc.zones.each_with_index do |z, idx|
104
+ homie_zone = @homie["zone#{idx + 1}"]
105
+ components[homie_zone] = z
106
+ end
105
107
 
106
- components.each do |(node, object)|
107
- node.each do |property|
108
- property.value = object.public_send(property.id.tr("-", "_"))
108
+ components.each do |(node, object)|
109
+ node.each do |property|
110
+ property.value = object.public_send(property.id.tr("-", "_"))
111
+ end
109
112
  end
110
- end
111
113
 
112
- @abc.faults.each_with_index do |fault_count, i|
113
- next if fault_count == 0xffff
114
+ @faults["current"].value = @abc.current_fault
115
+ @abc.faults.each_with_index do |fault_count, i|
116
+ next if fault_count == 0xffff
114
117
 
115
- @faults["e#{i + 1}"].value = fault_count
118
+ @faults["e#{i + 1}"].value = fault_count
119
+ end
116
120
  end
117
121
  end
118
122
  rescue => e
@@ -131,7 +135,7 @@ class MQTTBridge
131
135
  }
132
136
 
133
137
  @homie_abc = @homie.node("abc", "Heat Pump", "ABC") do |node|
134
- allowed_modes = %w[lockout standby blower heating cooling eh1 eh2 emergency waiting]
138
+ allowed_modes = %w[lockout standby blower heating heating_with_aux emergency_heat cooling waiting]
135
139
  allowed_modes << "dehumidify" if @abc.compressor.is_a?(Aurora::Compressor::VSDrive)
136
140
  node.property("current-mode",
137
141
  "Current Heating/Cooling Mode",
@@ -139,6 +143,31 @@ class MQTTBridge
139
143
  @abc.current_mode,
140
144
  format: allowed_modes,
141
145
  hass: { sensor: { state_class: :measurement } })
146
+ node.property("emergency-shutdown",
147
+ "Emergency Shutdown Requested",
148
+ :boolean,
149
+ @abc.emergency_shutdown?,
150
+ hass: :binary_sensor)
151
+ node.property("load-shed",
152
+ "Load Shed Requested",
153
+ :boolean,
154
+ @abc.load_shed?,
155
+ hass: :binary_sensor)
156
+ node.property("locked-out",
157
+ "Is the heat pump currently locked out?",
158
+ :boolean,
159
+ @abc.locked_out?,
160
+ hass: :binary_sensor)
161
+ node.property("derated",
162
+ "Is the compressor currently running at a derated level?",
163
+ :boolean,
164
+ @abc.derated?,
165
+ hass: :binary_sensor)
166
+ node.property("safe-mode",
167
+ "Is the heat pump currently in safe mode?",
168
+ :boolean,
169
+ @abc.safe_mode?,
170
+ hass: :binary_sensor)
142
171
  node.property("entering-air-temperature",
143
172
  "Entering Air Temperature",
144
173
  :float,
@@ -155,14 +184,27 @@ class MQTTBridge
155
184
  hass: { sensor: { device_class: :temperature,
156
185
  state_class: :measurement,
157
186
  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 } })
187
+ node.property("low-pressure-switch",
188
+ "Low Pressure Switch Status",
189
+ :enum,
190
+ @abc.low_pressure_switch,
191
+ format: %w[open closed])
192
+ node.property("high-pressure-switch",
193
+ "High Pressure Switch Status",
194
+ :enum,
195
+ @abc.high_pressure_switch,
196
+ format: %w[open closed])
197
+
198
+ if @abc.awl_communicating?
199
+ node.property("leaving-air-temperature",
200
+ "Leaving Air Temperature",
201
+ :float,
202
+ @abc.leaving_air_temperature,
203
+ unit: "°F",
204
+ hass: { sensor: { device_class: :temperature,
205
+ state_class: :measurement,
206
+ entity_category: :diagnostic } })
207
+ end
166
208
  node.property("leaving-water-temperature",
167
209
  "Leaving Water Temperature",
168
210
  :float,
@@ -171,7 +213,8 @@ class MQTTBridge
171
213
  hass: { sensor: { device_class: :temperature,
172
214
  state_class: :measurement,
173
215
  entity_category: :diagnostic } })
174
- unless @abc.outdoor_temperature.zero? # TODO: figure out the config if this actually exists
216
+ # TODO: figure out the config if this actually exists
217
+ if @abc.awl_communicating? && !@abc.outdoor_temperature.zero?
175
218
  node.property("outdoor-temperature",
176
219
  "Outdoor Temperature",
177
220
  :float,
@@ -186,8 +229,8 @@ class MQTTBridge
186
229
  :integer,
187
230
  @abc.line_voltage,
188
231
  format: 90..635,
189
- unit: "V") do |value, property|
190
- @mutex.synchronize { property.value = @abc.line_voltage = value }
232
+ unit: "V") do |value|
233
+ @mutex.synchronize { @abc.line_voltage = value }
191
234
  end
192
235
  node.property("fp1",
193
236
  "FP1 Sensor",
@@ -205,12 +248,11 @@ class MQTTBridge
205
248
  hass: { sensor: { device_class: :temperature,
206
249
  state_class: :measurement,
207
250
  entity_category: :diagnostic } })
208
- %i[aux_heat total].each do |component|
209
- component = "#{component}_watts"
210
- node.property(component.tr("_", "-"),
211
- component.sub("_watts", " Power Usage").tr("_", " ").titleize,
251
+ if @abc.energy_monitoring?
252
+ node.property("watts",
253
+ "Total Power Usage",
212
254
  :integer,
213
- @abc.public_send(component),
255
+ @abc.watts,
214
256
  unit: "W",
215
257
  hass: { sensor: { device_class: :power,
216
258
  state_class: :measurement } })
@@ -224,6 +266,14 @@ class MQTTBridge
224
266
  @abc.compressor.speed,
225
267
  format: @abc.compressor.speed_range,
226
268
  hass: { sensor: { state_class: :measurement } })
269
+ node.property("saturated-condensor-discharge-temperature",
270
+ "Saturated Condensor Discharge Temperature",
271
+ :float,
272
+ @abc.compressor.saturated_condensor_discharge_temperature,
273
+ unit: "°F",
274
+ hass: { sensor: { device_class: :temperature,
275
+ state_class: :measurement,
276
+ entity_category: :diagnostic } })
227
277
  if @abc.energy_monitoring?
228
278
  node.property("watts",
229
279
  "Power Usage",
@@ -244,6 +294,86 @@ class MQTTBridge
244
294
  hass: { sensor: { device_class: :temperature,
245
295
  state_class: :measurement,
246
296
  entity_category: :diagnostic } })
297
+ node.property("drive-temperature",
298
+ "Drive Temperature",
299
+ :float,
300
+ @abc.compressor.drive_temperature,
301
+ unit: "°F",
302
+ hass: { sensor: { device_class: :temperature,
303
+ state_class: :measurement,
304
+ entity_category: :diagnostic } })
305
+ node.property("inverter-temperature",
306
+ "Inverter Temperature",
307
+ :float,
308
+ @abc.compressor.inverter_temperature,
309
+ unit: "°F",
310
+ hass: { sensor: { device_class: :temperature,
311
+ state_class: :measurement,
312
+ entity_category: :diagnostic } })
313
+ node.property("fan-speed",
314
+ "Fan Speed",
315
+ :integer,
316
+ @abc.compressor.fan_speed,
317
+ unit: "%",
318
+ format: 0..100,
319
+ hass: { sensor: { state_class: :measurement,
320
+ entity_category: :diagnostic } })
321
+ node.property("discharge-temperature",
322
+ "Discharge Temperature",
323
+ :float,
324
+ @abc.compressor.discharge_temperature,
325
+ unit: "°F",
326
+ hass: { sensor: { device_class: :temperature,
327
+ state_class: :measurement,
328
+ entity_category: :diagnostic } })
329
+ node.property("discharge-pressure",
330
+ "Discharge Pressure",
331
+ :float,
332
+ @abc.compressor.discharge_pressure,
333
+ unit: "psi",
334
+ hass: { sensor: { device_class: :pressure,
335
+ state_class: :measurement,
336
+ entity_category: :diagnostic } })
337
+ node.property("suction-temperature",
338
+ "Suction Temperature",
339
+ :float,
340
+ @abc.compressor.suction_temperature,
341
+ unit: "°F",
342
+ hass: { sensor: { device_class: :temperature,
343
+ state_class: :measurement,
344
+ entity_category: :diagnostic } })
345
+ node.property("suction-pressure",
346
+ "Suction Pressure",
347
+ :float,
348
+ @abc.compressor.suction_pressure,
349
+ unit: "psi",
350
+ hass: { sensor: { device_class: :pressure,
351
+ state_class: :measurement,
352
+ entity_category: :diagnostic } })
353
+ node.property("saturated-evaporator-discharge-temperature",
354
+ "Saturated Evaporator Discharge Temperature",
355
+ :float,
356
+ @abc.compressor.saturated_evaporator_discharge_temperature,
357
+ unit: "°F",
358
+ hass: { sensor: { device_class: :temperature,
359
+ state_class: :measurement,
360
+ entity_category: :diagnostic } })
361
+ node.property("superheat-temperature",
362
+ "SuperHeat Temperature",
363
+ :float,
364
+ @abc.compressor.superheat_temperature,
365
+ unit: "°F",
366
+ hass: { sensor: { device_class: :temperature,
367
+ state_class: :measurement,
368
+ entity_category: :diagnostic } })
369
+ node.property("superheat-percentage",
370
+ "SuperHeat Percentage",
371
+ :integer,
372
+ @abc.compressor.superheat_percentage,
373
+ unit: "%",
374
+ format: 0..100,
375
+ hass: { sensor: { state_class: :measurement,
376
+ entity_category: :diagnostic } })
247
377
 
248
378
  next unless @abc.iz2?
249
379
 
@@ -256,6 +386,25 @@ class MQTTBridge
256
386
  entity_category: :diagnostic } })
257
387
  end
258
388
 
389
+ @aux_heat = @homie.node("aux-heat", "Aux Heater", "Aux Heater") do |node|
390
+ node.property("stage",
391
+ "Current Stage",
392
+ :integer,
393
+ @abc.aux_heat.stage,
394
+ format: 0..2,
395
+ hass: { sensor: { state_class: :measurement } })
396
+
397
+ if @abc.energy_monitoring?
398
+ node.property("watts",
399
+ "Power Usage",
400
+ :integer,
401
+ @abc.aux_heat.watts,
402
+ unit: "W",
403
+ hass: { sensor: { device_class: :power,
404
+ state_class: :measurement } })
405
+ end
406
+ end
407
+
259
408
  @blower = @homie.node("blower", "Blower", @abc.blower.type) do |node|
260
409
  node.property("running",
261
410
  "Running",
@@ -291,8 +440,8 @@ class MQTTBridge
291
440
  :integer,
292
441
  @abc.blower.public_send(field),
293
442
  format: 1..12,
294
- hass: { number: { entity_category: :config } }) do |value, property|
295
- @mutex.synchronize { property.value = @abc.blower.public_send("#{field}=", value) }
443
+ hass: { number: { entity_category: :config } }) do |value|
444
+ @mutex.synchronize { @abc.blower.public_send("#{field}=", value) }
296
445
  end
297
446
  end
298
447
 
@@ -333,21 +482,12 @@ class MQTTBridge
333
482
  :boolean,
334
483
  @abc.pump.running,
335
484
  hass: { binary_sensor: { device_class: :running } })
336
- node.property("speed",
337
- "Speed",
338
- :integer,
339
- @abc.pump.speed,
340
- format: 0..100,
341
- unit: "%",
342
- hass: { number: { entity_category: :diagnostic } }) do |value, property|
343
- @mutex.synchronize { property.value = @abc.pump.speed = value }
344
- end
345
485
  node.property("manual-control",
346
486
  "Manual Control",
347
487
  :boolean,
348
488
  @abc.pump.manual_control?,
349
- hass: { switch: { entity_category: :diagnostic } }) do |value, property|
350
- @mutex.synchronize { property.value = @abc.pump.manual_control = value }
489
+ hass: { switch: { entity_category: :diagnostic } }) do |value|
490
+ @mutex.synchronize { @abc.pump.manual_control = value }
351
491
  end
352
492
  node.property("minimum-speed",
353
493
  "Actual Minimum Speed",
@@ -355,8 +495,8 @@ class MQTTBridge
355
495
  @abc.pump.minimum_speed,
356
496
  format: 0..100,
357
497
  unit: "%",
358
- hass: { number: { entity_category: :config } }) do |value, property|
359
- @mutex.synchronize { property.value = @abc.pump.minimum_speed = value }
498
+ hass: { number: { entity_category: :config } }) do |value|
499
+ @mutex.synchronize { @abc.pump.minimum_speed = value }
360
500
  end
361
501
  node.property("maximum-speed",
362
502
  "Actual Maximum Speed",
@@ -364,8 +504,19 @@ class MQTTBridge
364
504
  @abc.pump.minimum_speed,
365
505
  format: 0..100,
366
506
  unit: "%",
367
- hass: { number: { entity_category: :config } }) do |value, property|
368
- @mutex.synchronize { property.value = @abc.pump.maximum_speed = value }
507
+ hass: { number: { entity_category: :config } }) do |value|
508
+ @mutex.synchronize { @abc.pump.maximum_speed = value }
509
+ end
510
+ next unless @abc.awl_axb?
511
+
512
+ node.property("speed",
513
+ "Speed",
514
+ :integer,
515
+ @abc.pump.speed,
516
+ format: 0..100,
517
+ unit: "%",
518
+ hass: { number: { entity_category: :diagnostic } }) do |value|
519
+ @mutex.synchronize { @abc.pump.speed = value }
369
520
  end
370
521
  end
371
522
 
@@ -375,8 +526,8 @@ class MQTTBridge
375
526
  "Enabled",
376
527
  :boolean,
377
528
  @abc.dhw.enabled,
378
- hass: { switch: { icon: "mdi:water-boiler" } }) do |value, property|
379
- @mutex.synchronize { property.value = @abc.dhw.enabled = value }
529
+ hass: { switch: { icon: "mdi:water-boiler" } }) do |value|
530
+ @mutex.synchronize { @abc.dhw.enabled = value }
380
531
  end
381
532
  node.property("running",
382
533
  "Pump Running",
@@ -396,47 +547,41 @@ class MQTTBridge
396
547
  @abc.dhw.set_point,
397
548
  format: 100..140,
398
549
  unit: "°F",
399
- hass: :number) do |value, property|
400
- @mutex.synchronize { property.value = @abc.dhw.set_point = value }
550
+ hass: { number: { step: 5 } }) do |value|
551
+ @mutex.synchronize { @abc.dhw.set_point = value }
401
552
  end
402
553
  end
403
554
  end
404
555
 
405
556
  @humidistat = @homie.node("humidistat", "Humidistat", "Humidistat") do |node|
406
- node.property("relative-humidity",
407
- "Relative Humidity",
408
- :integer,
409
- @abc.humidistat.relative_humidity,
410
- unit: "%",
411
- format: 0..100,
412
- hass: { sensor: { device_class: :humidity,
413
- state_class: :measurement } })
414
557
  if @abc.humidistat.humidifier?
415
558
  node.property("humidifier-running",
416
559
  "Humidifier Running",
417
560
  :boolean,
418
561
  @abc.humidistat.humidifier_running?)
419
- node.property("humidifier-mode",
420
- "Humidifier Mode",
421
- :enum,
422
- @abc.humidistat.humidifier_mode,
423
- format: %i[auto manual]) do |value, property|
424
- @mutex.synchronize { property.value = @abc.humidistat.humidifier_mode = value.to_sym }
425
- end
426
- node.property("humidification-target",
427
- "Humidification Target Relative Humidity",
428
- :integer,
429
- @abc.humidistat.humidification_target,
430
- unit: "%",
431
- format: 15..50) do |value, property|
432
- @mutex.synchronize { property.value = @abc.humidistat.humidification_target = value }
562
+ if @abc.awl_communicating?
563
+ node.property("humidifier-mode",
564
+ "Humidifier Mode",
565
+ :enum,
566
+ @abc.humidistat.humidifier_mode,
567
+ format: %i[auto manual]) do |value|
568
+ @mutex.synchronize { @abc.humidistat.humidifier_mode = value.to_sym }
569
+ end
570
+ node.property("humidification-target",
571
+ "Humidification Target Relative Humidity",
572
+ :integer,
573
+ @abc.humidistat.humidification_target,
574
+ unit: "%",
575
+ format: 15..50) do |value|
576
+ @mutex.synchronize { @abc.humidistat.humidification_target = value }
577
+ end
578
+ node.hass_humidifier("humidifier-running",
579
+ target_property: "humidification-target",
580
+ mode_property: "humidifier-mode",
581
+ id: "humidifier",
582
+ name: "Humidifier",
583
+ device_class: :humidifier)
433
584
  end
434
- node.hass_humidifier("humidifier-running",
435
- target_property: "humidification-target",
436
- mode_property: "humidifier-mode",
437
- id: "humidifier",
438
- name: "Humidifier",
439
- device_class: :humidifier)
440
585
  end
441
586
 
442
587
  # VSDrive can perform active dehumidification, even without a dedicated dehumidifier
@@ -446,31 +591,49 @@ class MQTTBridge
446
591
  "Dehumidifier Running",
447
592
  :boolean,
448
593
  @abc.humidistat.dehumidifier_running?)
449
- node.property("dehumidifier-mode",
450
- "Dehumidifier Mode",
451
- :enum,
452
- @abc.humidistat.dehumidifier_mode,
453
- format: %i[auto manual]) do |value, property|
454
- @mutex.synchronize { property.value = @abc.humidistat.dehumidifier_mode = value.to_sym }
455
- end
456
- node.property("dehumidification-target",
457
- "Dehumidification Target Relative Humidity",
458
- :integer,
459
- @abc.humidistat.dehumidification_target,
460
- unit: "%",
461
- format: 35..65) do |value, property|
462
- @mutex.synchronize { property.value = @abc.humidistat.dehumidification_target = value }
594
+ if @abc.awl_communicating?
595
+ node.property("dehumidifier-mode",
596
+ "Dehumidifier Mode",
597
+ :enum,
598
+ @abc.humidistat.dehumidifier_mode,
599
+ format: %i[auto manual]) do |value|
600
+ @mutex.synchronize { @abc.humidistat.dehumidifier_mode = value.to_sym }
601
+ end
602
+ node.property("dehumidification-target",
603
+ "Dehumidification Target Relative Humidity",
604
+ :integer,
605
+ @abc.humidistat.dehumidification_target,
606
+ unit: "%",
607
+ format: 35..65) do |value|
608
+ @mutex.synchronize { @abc.humidistat.dehumidification_target = value }
609
+ end
610
+ node.hass_humidifier("dehumidifier-running",
611
+ target_property: "dehumidification-target",
612
+ mode_property: "dehumidifier-mode",
613
+ id: "dehumidifier",
614
+ name: "Dehumidifier",
615
+ device_class: :dehumidifier)
463
616
  end
464
- node.hass_humidifier("dehumidifier-running",
465
- target_property: "dehumidification-target",
466
- mode_property: "dehumidifier-mode",
467
- id: "dehumidifier",
468
- name: "Dehumidifier",
469
- device_class: :dehumidifier)
470
617
  end
618
+ next unless @abc.awl_communicating?
619
+
620
+ node.property("relative-humidity",
621
+ "Relative Humidity",
622
+ :integer,
623
+ @abc.humidistat.relative_humidity,
624
+ unit: "%",
625
+ format: 0..100,
626
+ hass: { sensor: { device_class: :humidity,
627
+ state_class: :measurement } })
471
628
  end
472
629
 
473
630
  @faults = @homie.node("faults", "Fault History", "ABC") do |node|
631
+ node.property("current",
632
+ "Current fault",
633
+ :integer,
634
+ @abc.current_fault,
635
+ format: 0..99,
636
+ hass: :sensor)
474
637
  node.property("clear-history",
475
638
  "Reset Fault Counts",
476
639
  :enum,
@@ -495,26 +658,29 @@ class MQTTBridge
495
658
  @abc.zones.each_with_index do |zone, i|
496
659
  type = zone.is_a?(Aurora::IZ2Zone) ? "IntelliZone 2 Zone" : "Thermostat"
497
660
  @homie.node("zone#{i + 1}", "Zone #{i + 1}", type) do |node|
661
+ node.property("current-mode",
662
+ "Current Heating/Cooling Mode Requested",
663
+ :enum,
664
+ zone.current_mode,
665
+ format: %w[standby h1 h2 h3 c1 c2])
666
+
667
+ next unless @abc.awl_communicating?
668
+
498
669
  allowed_modes = %w[off auto cool heat]
499
670
  allowed_modes << "eheat" if i.zero?
500
671
  node.property("target-mode",
501
672
  "Target Heating/Cooling Mode",
502
673
  :enum,
503
674
  zone.target_mode,
504
- format: allowed_modes) do |value, property|
505
- @mutex.synchronize { property.value = zone.target_mode = value.to_sym }
675
+ format: allowed_modes) do |value|
676
+ @mutex.synchronize { zone.target_mode = value.to_sym }
506
677
  end
507
- node.property("current-mode",
508
- "Current Heating/Cooling Mode Requested",
509
- :enum,
510
- zone.current_mode,
511
- format: %w[standby h1 h2 h3 c1 c2])
512
678
  node.property("target-fan-mode",
513
679
  "Target Fan Mode",
514
680
  :enum,
515
681
  zone.target_fan_mode,
516
- format: %w[auto continuous intermittent]) do |value, property|
517
- @mutex.synchronize { property.value = zone.target_fan_mode = value.to_sym }
682
+ format: %w[auto continuous intermittent]) do |value|
683
+ @mutex.synchronize { zone.target_fan_mode = value.to_sym }
518
684
  end
519
685
  node.property("fan-intermittent-on",
520
686
  "Fan Intermittent Mode On Duration",
@@ -522,8 +688,8 @@ class MQTTBridge
522
688
  zone.fan_intermittent_on,
523
689
  unit: "M",
524
690
  format: %w[0 5 10 15 20],
525
- hass: { select: { entity_category: :config } }) do |value, property|
526
- @mutex.synchronize { property.value = zone.fan_intermittent_on = value.to_i }
691
+ hass: { select: { entity_category: :config } }) do |value|
692
+ @mutex.synchronize { zone.fan_intermittent_on = value.to_i }
527
693
  end
528
694
  node.property("fan-intermittent-off",
529
695
  "Fan Intermittent Mode Off Duration",
@@ -531,8 +697,8 @@ class MQTTBridge
531
697
  zone.fan_intermittent_on,
532
698
  unit: "M",
533
699
  format: %w[0 5 10 15 20 25 30 35 40],
534
- hass: { select: { entity_category: :config } }) do |value, property|
535
- @mutex.synchronize { property.value = zone.fan_intermittent_on = value.to_i }
700
+ hass: { select: { entity_category: :config } }) do |value|
701
+ @mutex.synchronize { zone.fan_intermittent_on = value.to_i }
536
702
  end
537
703
  node.property("current-fan-mode",
538
704
  "Current Fan Status",
@@ -573,15 +739,15 @@ class MQTTBridge
573
739
  :integer,
574
740
  zone.heating_target_temperature,
575
741
  unit: "°F",
576
- format: 40..90) do |value, property|
577
- @mutex.synchronize { property.value = zone.heating_target_temperature = value }
742
+ format: 40..90) do |value|
743
+ @mutex.synchronize { zone.heating_target_temperature = value }
578
744
  end
579
745
  node.property("cooling-target-temperature",
580
746
  "Cooling Target Temperature", :integer,
581
747
  zone.cooling_target_temperature,
582
748
  unit: "°F",
583
- format: 54..99) do |value, property|
584
- @mutex.synchronize { property.value = zone.cooling_target_temperature = value }
749
+ format: 54..99) do |value|
750
+ @mutex.synchronize { zone.cooling_target_temperature = value }
585
751
  end
586
752
  node.hass_climate(action_property: "current-mode",
587
753
  current_temperature_property: "ambient-temperature",
@@ -612,12 +778,12 @@ class MQTTBridge
612
778
  end
613
779
 
614
780
  log_level = ARGV.include?("--debug") ? :debug : :warn
615
- logger = Logger.new($stdout)
616
- logger.level = log_level
617
- abc.modbus_slave.logger = logger
781
+ Aurora.logger = Logger.new($stdout)
782
+ Aurora.logger.level = log_level
783
+ abc.modbus_slave.logger = Aurora.logger
618
784
 
619
785
  device = "aurora-#{abc.serial_number}"
620
786
  homie = MQTT::Homie::Device.new(device, "WaterFurnace", mqtt: mqtt_uri)
621
- homie.logger = logger
787
+ homie.logger = Aurora.logger
622
788
 
623
789
  MQTTBridge.new(abc, homie)
data/exe/web_aid_tool CHANGED
@@ -7,13 +7,17 @@ require "logger"
7
7
  require "optparse"
8
8
  require "yaml"
9
9
 
10
- debug_modbus = monitor = false
10
+ debug_modbus = monitor = ignore_missing_registers = false
11
11
 
12
12
  options = OptionParser.new do |opts|
13
13
  opts.banner = "Usage: web_aid_tool /path/to/serial/port [options]"
14
14
 
15
15
  opts.on("--debug-modbus", "Print actual protocol bytes") { debug_modbus = true }
16
16
  opts.on("--monitor", "Print interpreted registers as they are requested, like aurora_monitor") { monitor = true }
17
+ opts.on("--ignore-missing-registers",
18
+ "For YAML input only, just log a warning when a register doesn't exist, instead of failing") do
19
+ ignore_missing_registers = true
20
+ end
17
21
  opts.on("-v", "--version", "Print version") do
18
22
  puts Aurora::VERSION
19
23
  exit
@@ -31,7 +35,7 @@ unless ARGV.length == 1
31
35
  exit 1
32
36
  end
33
37
 
34
- slave = Aurora::ABCClient.open_modbus_slave(ARGV[0])
38
+ slave = Aurora::ABCClient.open_modbus_slave(ARGV[0], ignore_missing_registers: ignore_missing_registers)
35
39
  slave.logger = Logger.new($stdout)
36
40
  slave.logger.level = debug_modbus ? :debug : :warn
37
41