Skip to content

Commit

Permalink
expose detected line voltage
Browse files Browse the repository at this point in the history
fixes #37
  • Loading branch information
ccutrer committed Sep 17, 2023
1 parent d4aeaaf commit 6b0c140
Show file tree
Hide file tree
Showing 4 changed files with 16 additions and 7 deletions.
2 changes: 1 addition & 1 deletion Gemfile.lock
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
PATH
remote: .
specs:
waterfurnace_aurora (1.4.7)
waterfurnace_aurora (1.4.8)
ccutrer-serialport (~> 1.0)
mqtt-homeassistant (~> 0.1, >= 0.1.5)
net-telnet-rfc2217 (~> 1.0, >= 1.0.1)
Expand Down
11 changes: 9 additions & 2 deletions exe/aurora_mqtt_bridge
Original file line number Diff line number Diff line change
Expand Up @@ -236,13 +236,13 @@ class MQTTBridge
state_class: :measurement } })
end

node.property("line-voltage",
node.property("line-voltage-setting",
"Line Voltage Setting",
:integer,
@abc.line_voltage,
format: 90..635,
unit: "V") do |value|
@mutex.synchronize { @abc.line_voltage = value }
@mutex.synchronize { @abc.line_voltage_setting = value }
end
if (-999..999).cover?(@abc.air_coil_temperature)
node.property("air-coil-temperature",
Expand All @@ -255,6 +255,13 @@ class MQTTBridge
entity_category: :diagnostic } })
end
if @abc.energy_monitoring?
node.property("line-voltage",
"Line Voltage",
:integer,
@abc.line_voltage,
format: 90..635,
unit: "V")

node.property("watts",
"Total Power Usage",
:integer,
Expand Down
8 changes: 5 additions & 3 deletions lib/aurora/abc_client.rb
Original file line number Diff line number Diff line change
Expand Up @@ -141,6 +141,7 @@ def log_query(last_log_time, query)
:outdoor_temperature,
:air_coil_temperature,
:line_voltage,
:line_voltage_setting,
:watts

alias_method :emergency_shutdown?, :emergency_shutdown
Expand Down Expand Up @@ -201,7 +202,7 @@ def initialize(uri)
@registers_to_read << 1104 if axb?
@registers_to_read.push(741, 31_003) if awl_communicating?
@registers_to_read << (1110..1111) if performance_monitoring?
@registers_to_read << (1150..1153) if energy_monitoring?
@registers_to_read.push(16, 1150..1153) if energy_monitoring?
@registers_to_read << 900 if awl_axb?
zones.each do |z|
@registers_to_read.concat(z.registers_to_read)
Expand Down Expand Up @@ -243,7 +244,8 @@ def refresh
@high_pressure_switch = registers[31][:hps]
@emergency_shutdown = !!registers[31][:emergency_shutdown]
@load_shed = !!registers[31][:load_shed]
@line_voltage = registers[112]
@line_voltage = registers[16] if energy_monitoring?
@line_voltage_setting = registers[112]
@watts = registers[1153]

@current_mode = if outputs.include?(:lockout)
Expand Down Expand Up @@ -285,7 +287,7 @@ def loop_pressure_trip=(value)
@modbus_slave.holding_registers[419] = (value * 10).to_i
end

def line_voltage=(value)
def line_voltage_setting=(value)
raise ArgumentError unless (90..635).cover?(value)

@modbus_slave.holding_registers[112] = value
Expand Down
2 changes: 1 addition & 1 deletion lib/aurora/version.rb
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
# frozen_string_literal: true

module Aurora
VERSION = "1.4.7"
VERSION = "1.4.8"
end

0 comments on commit 6b0c140

Please sign in to comment.