Skip to content

Commit

Permalink
Merge pull request #8 from Tom-Bom-badil/develop
Browse files Browse the repository at this point in the history
Correct / improve behaviour of switches
  • Loading branch information
Tom-Bom-badil authored Jan 31, 2025
2 parents f706a77 + 4cef7ae commit 74c1e9c
Show file tree
Hide file tree
Showing 8 changed files with 109 additions and 117 deletions.
File renamed without changes.
2 changes: 1 addition & 1 deletion custom_components/helios_vallox_ventilation/__init__.py
Original file line number Diff line number Diff line change
Expand Up @@ -45,7 +45,7 @@ async def update_data(_):
await coordinator._coordinator.async_request_refresh()
except Exception as e:
_LOGGER.error(f"Error during data refresh: {e}", exc_info=True)
async_track_time_interval(hass, update_data, timedelta(seconds=58))
async_track_time_interval(hass, update_data, timedelta(seconds=57))

# Register the write service
async def handle_write_service(call):
Expand Down
12 changes: 6 additions & 6 deletions custom_components/helios_vallox_ventilation/const.py
Original file line number Diff line number Diff line change
Expand Up @@ -31,7 +31,7 @@
"FB*": 0x20, # alle remote controls
"FB1": 0x21, # remote control 1
"LON": 0x28, # LON bus module (if any)
"_HA": 0x2E, # this HA Python script; we are simulating a remote
"_HA": 0x2D, # this HA Python script; we are simulating a remote
"_SH": 0x2F # SmartHomeNG Python script; also simulating a remote
}

Expand Down Expand Up @@ -78,11 +78,11 @@
# 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 },
# FB LED2: CO2 warning
"co2_indicator": {"varid": 0xA3, 'type': 'bit', 'bitposition': 1, 'read': True, 'write': False},
"co2_indicator": {"varid": 0xA3, 'type': 'bit', 'bitposition': 1, 'read': True, 'write': True },
# FB LED3: Humidity warning
"rh_indicator": {"varid": 0xA3, 'type': 'bit', 'bitposition': 2, 'read': True, 'write': False},
"rh_indicator": {"varid": 0xA3, 'type': 'bit', 'bitposition': 2, 'read': True, 'write': True },
# FB LED4: 0 = summer mode with bypass, 1 = wintermode with heat regeneration (LED is on in winter mode)
"summer_winter_mode": {"varid": 0xA3, 'type': 'bit', 'bitposition': 3, 'read': True, 'write': False},
"winter_mode": {"varid": 0xA3, 'type': 'bit', 'bitposition': 3, 'read': True, 'write': True },
# FB icon 1: "Clean filter" warning
"clean_filter": {"varid": 0xA3, 'type': 'bit', 'bitposition': 4, 'read': True, 'write': False},
# FB icon 2 2: Pre-/Post heating active
Expand All @@ -103,8 +103,8 @@
"defrost_hysteresis": {"varid": 0xB2, 'type': 'dec', 'bitposition': -1, 'read': True, 'write': True },
# Boost mode: 0=fireplace (ignition - no exhaust air in the first 15 minutes of boost); 1=normal boost mode
"boost_mode": {"varid": 0xAA, 'type': 'bit', 'bitposition': 5, 'read': True, 'write': True },
# Switch boost on for 45 minutes (set to 1; will be reset automatically)
"boost_on_switch": {"varid": 0x71, 'type': 'bit', 'bitposition': 5, 'read': True, 'write': True },
# Switch boost on for 45 minutes (set to 1; will be reset by mainboard automatically)
"activate_boost": {"varid": 0x71, 'type': 'bit', 'bitposition': 5, 'read': True, 'write': True },
# Current boost status (off/on)
"boost_status": {"varid": 0x71, 'type': 'bit', 'bitposition': 6, 'read': True, 'write': False},
# Remaining minutes of boost if on
Expand Down
8 changes: 8 additions & 0 deletions custom_components/helios_vallox_ventilation/coordinator.py
Original file line number Diff line number Diff line change
Expand Up @@ -88,3 +88,11 @@ def write_value(self, variable, value):
return False
finally:
self.disconnect()


async def turn_on(self, variable):
self._hass.async_add_executor_job(self.write_value, variable, 1)


async def turn_off(self, variable):
self._hass.async_add_executor_job(self.write_value, variable, 0)
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": "2025.01.1"
"version": "2025.01.2"
}
79 changes: 43 additions & 36 deletions custom_components/helios_vallox_ventilation/vent_conf.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -12,12 +12,14 @@

sensors:

# DE Lüftungsstufe
- name: fanspeed
description: "Fan speed"
min_value: 1
max_value: 8
icon: "mdi:speedometer-medium"

# DE Einschaltstufe
- name: "initial_fanspeed"
description: "Initial fan speed after switching on"
unit_of_measurement: "level"
Expand All @@ -26,6 +28,7 @@
default_value: 1
icon: "mdi:speedometer-slow"

# DE Maximalstufe
- name: "max_fanspeed"
description: "Maximum fan speed availabe to remotes"
unit_of_measurement: "level"
Expand All @@ -34,7 +37,6 @@
default_value: 8
icon: "mdi:speedometer"

# now using the ISO names for temperatures
# DE: Außenlufttemperatur
- name: "temperature_outdoor_air"
unit_of_measurement: "°C"
Expand Down Expand Up @@ -70,18 +72,20 @@
default_value: 10
icon: "mdi:thermometer"

# set to +5 to activate with pre-heating with defrost defaults below
- name: "preheat_setpoint"
unit_of_measurement: "°C"
min_value: -10 # none according to manual, but limiting input options
max_value: 10 # none according to manual, but limiting input options
default_value: -3 # set to +5 to activate with defrost defaults below
min_value: -10
max_value: 10
default_value: -3
icon: "mdi:thermometer"

# can be reduced below 0 in case of enthalpy exchanger
- name: "defrost_setpoint"
unit_of_measurement: "°C"
min_value: -6
max_value: 15
default_value: 3 # can be reduced below 0 in case of enthalpy exchanger
default_value: 3
icon: "mdi:thermometer"

- name: "defrost_hysteresis"
Expand All @@ -91,12 +95,6 @@
default_value: 3
icon: "mdi:thermometer"

- name: "boost_mode"
min_value: 0 # Fireplace mode
max_value: 1 # Boost mode
default_value: 1
icon: "mdi:fan-speed-2"

- name: "boost_remaining"
device_class: "duration"
state_class: "measurement"
Expand Down Expand Up @@ -134,81 +132,90 @@
unit_of_measurement: ""
icon: "mdi:alert"

# no reading - set by vent_functions.py, see also const.py
- name: "fault_text"
# state_class: "measurement"
icon: "mdi:alert"

# calculated by ventcontrol.py
# no reading - calculated by vent_functions.py
- name: "temperature_reduction"
description: "Heat recovery - reduction of outgoing air temperature"
unit_of_measurement: "°C"
device_class: "temperature"
state_class: "measurement"
icon: "mdi:thermometer"

# calculated by ventcontrol.py
# no reading - calculated by vent_functions.py
- name: "temperature_gain"
description: "Heat recovery - gain of incoming air temperature"
unit_of_measurement: "°C"
device_class: "temperature"
state_class: "measurement"
icon: "mdi:thermometer"

# calculated by ventcontrol.py
# no reading - calculated by vent_functions.py
- name: "temperature_balance"
description: "Difference temperature reduction ./. temperature gain"
unit_of_measurement: "°C"
device_class: "temperature"
state_class: "measurement"
icon: "mdi:thermometer"

# calculated by ventcontrol.py
# no reading - calculated by vent_functions.py
- name: "efficiency"
unit_of_measurement: "%"
state_class: "measurement"
icon: "mdi:percent"

- name: "preheat_status" # ??????????????? --> binary_sensor???
min_value: 0
max_value: 1
icon: "mdi:tooltip-question"

binary_sensors:

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

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

- name: "boost_status"
icon: "mdi:tooltip-question"

- name: "co2_indicator"
- name: "fault_detected"
device_class: "problem"
icon: "mdi:alert"

- name: "rh_indicator"
- name: "clean_filter"
device_class: "problem"
icon: "mdi:alert"

- name: "clean_filter"
- name: "service_requested"
device_class: "problem"
icon: "mdi:alert"

- name: "fault_detected"
- name: "post_heating_on"
device_class: "heat"
icon: "mdi:heating-coil"

switches:

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

- name: "co2_indicator"
device_class: "problem"
icon: "mdi:alert"

- name: "service_requested"
- name: "rh_indicator"
device_class: "problem"
icon: "mdi:alert"

switches:
- name: "winter_mode"
device_class: "switch"
icon: "mdi:alert"

- name: "preheat_status"
device_class: "switch"
icon: "mdi:tooltip-question"

# 0=Fireplace mode, 1=Normal boost
- name: "boost_mode"
device_class: "switch"
icon: "mdi:fan-speed-2"

- name: "boost_on_switch"
- name: "activate_boost"
device_class: "switch"
icon: "mdi:fan"

Expand Down
Loading

0 comments on commit 74c1e9c

Please sign in to comment.