Skip to content

Commit

Permalink
Merge pull request #6 from Tom-Bom-badil/develop
Browse files Browse the repository at this point in the history
 use standardized ISO names for temperatures
  • Loading branch information
Tom-Bom-badil authored Dec 30, 2024
2 parents 0fb0c7e + a07d694 commit d823a73
Show file tree
Hide file tree
Showing 5 changed files with 36 additions and 34 deletions.
19 changes: 12 additions & 7 deletions custom_components/helios_vallox_ventilation/configuration.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -34,25 +34,30 @@
default_value: 8
icon: "mdi:speedometer"

- name: "temperature_outside"
# now using the ISO names for temperatures
# DE: Außenlufttemperatur
- name: "temperature_outdoor_air"
unit_of_measurement: "°C"
device_class: "temperature"
state_class: "measurement" # this means "read-only"
state_class: "measurement" # ="read-only"
icon: "mdi:thermometer"

- name: "temperature_inlet"
# DE: Zulufttemperatur
- name: "temperature_supply_air"
unit_of_measurement: "°C"
device_class: "temperature"
state_class: "measurement"
icon: "mdi:thermometer"

- name: "temperature_outlet"
# DE: Ablufttemperatur
- name: "temperature_extract_air"
unit_of_measurement: "°C"
device_class: "temperature"
state_class: "measurement"
icon: "mdi:thermometer"

- name: "temperature_exhaust"
# DE: Fortlufttemperatur
- name: "temperature_exhaust_air"
unit_of_measurement: "°C"
device_class: "temperature"
state_class: "measurement"
Expand Down Expand Up @@ -170,11 +175,11 @@

binary_sensors:

- name: "powerstate" # switch ???? --> wirft zZ Fehler
- name: "powerstate" # switch ???? --> throws errors on writing
device_class: "power"
icon: "mdi:power-settings"

- name: "post_heating_on" # Vallox only
- name: "post_heating_on" # Vallox only?
device_class: "heat"
icon: "mdi:heating-coil"

Expand Down
18 changes: 9 additions & 9 deletions custom_components/helios_vallox_ventilation/const.py
Original file line number Diff line number Diff line change
Expand Up @@ -49,12 +49,12 @@

# mapping error messages / faults
COMPONENT_FAULTS = {
5: 'Inlet air sensor fault',
5: 'Supply air sensor fault',
6: 'CO2 Alarm',
7: 'Outside air sensor fault',
7: 'Outdoor air sensor fault',
8: 'Exhaust air sensor fault',
9: 'Water coil frost warning',
10: 'Outlet air sensor fault'
10: 'Extract air sensor fault'
}

# mapping for registers and coils
Expand All @@ -66,13 +66,13 @@
# Maximum settable fanspeed
"max_fanspeed" : {"varid" : 0xA5, 'type': 'fanspeed', 'bitposition': -1, 'read': True, 'write': True },
# NTC5K sensors: outside air temperature
"temperature_outside" : {"varid" : 0x32, 'type': 'temperature', 'bitposition': -1, 'read': True, 'write': False },
"temperature_outdoor_air" : {"varid" : 0x32, 'type': 'temperature', 'bitposition': -1, 'read': True, 'write': False },
# NTC5K sensors: supply air temperature
"temperature_inlet" : {"varid" : 0x35, 'type': 'temperature', 'bitposition': -1, 'read': True, 'write': False },
# NTC5K sensors: extract / inside air temperature
"temperature_outlet" : {"varid" : 0x34, 'type': 'temperature', 'bitposition': -1, 'read': True, 'write': False },
# NTC5K sensors: exhaust air temperature
"temperature_exhaust" : {"varid" : 0x33, 'type': 'temperature', 'bitposition': -1, 'read': True, 'write': False },
"temperature_supply_air" : {"varid" : 0x35, 'type': 'temperature', 'bitposition': -1, 'read': True, 'write': False },
# NTC5K sensors: return air temperature
"temperature_extract_air" : {"varid" : 0x34, 'type': 'temperature', 'bitposition': -1, 'read': True, 'write': False },
# NTC5K sensors: discharge air temperature
"temperature_exhaust_air" : {"varid" : 0x33, 'type': 'temperature', 'bitposition': -1, 'read': True, 'write': False },
# various coils in register 0xA3 that are displayed on the remote controls (0..3 read/write, 4..7 readonly)
# FB LED1: on/off Caution: Remotes will not be switched back on automatically; initial_fanspeed set if done manually.
"powerstate" : {"varid" : 0xA3, 'type': 'bit', 'bitposition': 0, 'read': True, 'write': True },
Expand Down
2 changes: 1 addition & 1 deletion custom_components/helios_vallox_ventilation/manifest.json
Original file line number Diff line number Diff line change
Expand Up @@ -7,5 +7,5 @@
"iot_class": "local_polling",
"issue_tracker": "https://github.com/Tom-Bom-badil/home-assistant_helios-vallox/issues",
"requirements": [],
"version": "2024.12.8"
"version": "2024.12.9"
}
27 changes: 12 additions & 15 deletions custom_components/helios_vallox_ventilation/ventcontrol.py
Original file line number Diff line number Diff line change
Expand Up @@ -122,7 +122,7 @@ def _readTelegram(self, sender, receiver, datapoint):
data = self._socket.recv(6)
if len(data) == 6:
buffer = data
if buffer[0] != 0x01: # lots of noise on the RS485
if buffer[0] != 0x01: # sometimes lots of noise on the RS485
logger.debug(f"Ignoring jitter data: {' '.join(f'{byte:02X}' for byte in buffer)}")
continue
if (buffer[0] == 0x01 and
Expand Down Expand Up @@ -332,10 +332,10 @@ def calculate_derived_values(self, measured_values):
try:

# get temperatures
temp_outside = measured_values.get("temperature_outside")
temp_inlet = measured_values.get("temperature_inlet")
temp_outlet = measured_values.get("temperature_outlet")
temp_exhaust = measured_values.get("temperature_exhaust")
temp_outside = measured_values.get("temperature_outdoor_air")
temp_inlet = measured_values.get("temperature_supply_air")
temp_outlet = measured_values.get("temperature_extract_air")
temp_exhaust = measured_values.get("temperature_exhaust_air")

# calculate reduction / gain / (dis-)balance
temperature_reduction = (
Expand Down Expand Up @@ -363,7 +363,7 @@ def calculate_derived_values(self, measured_values):
):
delta_outside = temp_outlet - temp_outside
if delta_outside == 0:
# temp_outlet == temp_outside would lead to div/0
# temp_extract == temp_outdoor would lead to div/0
efficiency = 0
elif delta_outside > 0:
efficiency = (temperature_gain / delta_outside) * 100
Expand All @@ -381,7 +381,7 @@ def calculate_derived_values(self, measured_values):
}

except Exception as e:
logger.error(f"Fehler bei der Berechnung der abgeleiteten Werte: {e}")
logger.error(f"Error in temperature/efficiency calculations: {e}")
return {
"temperature_reduction": None,
"temperature_gain": None,
Expand Down Expand Up @@ -417,14 +417,11 @@ def readAllValues(self, textoutput=True):
if textoutput==True:
print(f"{var_name}: {var_value}")

# neu
# store some values for later calculation
if var_name in ["temperature_outside", "temperature_inlet", "temperature_outlet", "temperature_exhaust"]:
if var_name in ["temperature_outdoor_air", "temperature_supply_air", "temperature_extract_air", "temperature_exhaust_air"]:
measured_values[var_name] = var_value
# neu

if var_name == "fault_number":
error_text = COMPONENT_FAULTS.get(var_value, "none")
error_text = COMPONENT_FAULTS.get(var_value, "")
if textoutput==True:
print(f"fault_text: {error_text}")
self.GLOBAL_VALUES['fault_text'] = error_text
Expand All @@ -433,16 +430,16 @@ def readAllValues(self, textoutput=True):
print(f"{var_name}: Failed to resolve value")


# neu
if all(key in measured_values for key in ["temperature_outside", "temperature_inlet", "temperature_outlet", "temperature_exhaust"]):
if all(key in measured_values for key in ["temperature_outdoor_air", "temperature_supply_air", "temperature_extract_air", "temperature_exhaust_air"]):
calculated_values = self.calculate_derived_values(measured_values)
for calc_name, calc_value in calculated_values.items():
if calc_value is not None:
self.GLOBAL_VALUES[calc_name] = calc_value
logger.debug(f"{calc_name}: {calc_value}")
if textoutput:
print(f"{calc_name}: {calc_value}")
# neu
else:
logger.warning(f"Failed to calculate temperatures/efficiency - not all temps available.")

else:
logger.warning(f"Failed to read value for varid: {varid:02X}")
Expand Down
4 changes: 2 additions & 2 deletions readme.md
Original file line number Diff line number Diff line change
@@ -1,8 +1,8 @@
[![Home Assistant](https://img.shields.io/badge/Home%20Assistant-%2341BDF5.svg)](https://www.home-assistant.io)
[![Custom integration](https://img.shields.io/badge/custom%20integration-%2341BDF5.svg)](https://www.home-assistant.io/getting-started/concepts-terminology)
[![HACS](https://img.shields.io/badge/HACS%20listed-not_yet-red.svg)](https://github.com/hacs)
[![HACS](https://img.shields.io/badge/HACS%20manual%20install-verified-green.svg)](https://github.com/hacs)
[![Version](https://img.shields.io/badge/Version-v2024.12.8-green.svg)](https://github.com/Tom-Bom-badil/home-assistant_helios-vallox/releases)
[![HACS](https://img.shields.io/badge/HACS%20install-verified-green.svg)](https://github.com/hacs)
[![Version](https://img.shields.io/badge/Version-v2024.12.9-green.svg)](https://github.com/Tom-Bom-badil/home-assistant_helios-vallox/releases)
[![Maintenance](https://img.shields.io/badge/Maintained%3F-yes-green.svg)](https://GitHub.com/Tom-Bom-badil/home-assistant_helios-vallox/graphs/commit-activity)

# Integration for Helios / Vallox central house ventilation systems with RS-485 bus (pre-EasyControls aka pre-2014 models)
Expand Down

0 comments on commit d823a73

Please sign in to comment.