Skip to content

Commit

Permalink
Merge pull request #110 from Jalle19/defrosting
Browse files Browse the repository at this point in the history
Add setting switch for "defrosting allowed"
  • Loading branch information
Jalle19 authored Feb 12, 2024
2 parents 040a5fb + 7fca05c commit c953c36
Show file tree
Hide file tree
Showing 4 changed files with 15 additions and 0 deletions.
1 change: 1 addition & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -10,6 +10,7 @@
* Add optional sensors for control panel temperature, supply fan speed and exhaust fan speed (https://github.com/Jalle19/eda-modbus-bridge/issues/96)
* Remove references to "flags", use "modes" everywhere instead
* Use HTTP 500 instead of HTTP 400 for generic errors
* Add settings switch for defrosting allowed (https://github.com/Jalle19/eda-modbus-bridge/issues/109)

## 2.7.1

Expand Down
1 change: 1 addition & 0 deletions app/enervent.mjs
Original file line number Diff line number Diff line change
Expand Up @@ -35,6 +35,7 @@ export const AVAILABLE_SETTINGS = {
'awayHeatingAllowed': 18,
'longAwayCoolingAllowed': 21,
'longAwayHeatingAllowed': 20,
'defrostingAllowed': 55,
}

export const ALARM_REGISTERS_START = 385
Expand Down
5 changes: 5 additions & 0 deletions app/homeassistant.mjs
Original file line number Diff line number Diff line change
Expand Up @@ -293,6 +293,11 @@ export const configureMqttDiscovery = async (modbusClient, mqttClient) => {
// Not supported by some units
{ 'enabled_by_default': automationType !== AUTOMATION_TYPE_LEGACY_EDA }
),
'defrostingAllowed': createSettingSwitchConfiguration(
configurationBase,
'defrostingAllowed',
'Defrosting allowed'
),
}

// Binary sensors for alarms
Expand Down
8 changes: 8 additions & 0 deletions app/modbus.mjs
Original file line number Diff line number Diff line change
Expand Up @@ -220,6 +220,13 @@ export const getSettings = async (modbusClient) => {
}
}

// Defrosting allowed
result = await mutex.runExclusive(async () => tryReadCoils(modbusClient, 55, 1))
settings = {
...settings,
'defrostingAllowed': result.data[0],
}

return settings
}

Expand Down Expand Up @@ -263,6 +270,7 @@ export const setSetting = async (modbusClient, setting, value) => {
case 'awayHeatingAllowed':
case 'longAwayCoolingAllowed':
case 'longAwayHeatingAllowed':
case 'defrostingAllowed':
coil = true
break
}
Expand Down

0 comments on commit c953c36

Please sign in to comment.