Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Add Z-wave climate sensor override for Heatit Z-TRM6 #103896

Merged
merged 13 commits into from
Nov 24, 2023
61 changes: 61 additions & 0 deletions homeassistant/components/zwave_js/discovery.py
Original file line number Diff line number Diff line change
Expand Up @@ -530,6 +530,67 @@ class ZWaveDiscoverySchema:
primary_value=SWITCH_BINARY_CURRENT_VALUE_SCHEMA,
assumed_state=True,
),
# Heatit Z-TRM6
ZWaveDiscoverySchema(
platform=Platform.CLIMATE,
hint="dynamic_current_temp",
manufacturer_id={0x019B},
product_id={0x3001},
product_type={0x0030},
primary_value=ZWaveValueDiscoverySchema(
command_class={CommandClass.THERMOSTAT_MODE},
property={THERMOSTAT_MODE_PROPERTY},
type={ValueType.NUMBER},
),
data_template=DynamicCurrentTempClimateDataTemplate(
lookup_table={
# Floor sensor
"Floor": ZwaveValueID(
property_=THERMOSTAT_CURRENT_TEMP_PROPERTY,
command_class=CommandClass.SENSOR_MULTILEVEL,
endpoint=4,
),
# Internal sensor
"Internal": ZwaveValueID(
property_=THERMOSTAT_CURRENT_TEMP_PROPERTY,
command_class=CommandClass.SENSOR_MULTILEVEL,
endpoint=2,
),
# Internal with limit by floor sensor
"Internal with floor limit": ZwaveValueID(
property_=THERMOSTAT_CURRENT_TEMP_PROPERTY,
command_class=CommandClass.SENSOR_MULTILEVEL,
endpoint=2,
),
# External sensor (connected to device)
"External": ZwaveValueID(
property_=THERMOSTAT_CURRENT_TEMP_PROPERTY,
command_class=CommandClass.SENSOR_MULTILEVEL,
endpoint=3,
),
# External sensor (connected to device) with limit by floor sensor (2x sensors)
"External with floor limit": ZwaveValueID(
property_=THERMOSTAT_CURRENT_TEMP_PROPERTY,
command_class=CommandClass.SENSOR_MULTILEVEL,
endpoint=3,
),
# PWER - Power regulator mode (no sensor used).
# This mode does not does not support climate entity.
# Heating is set by adjusting parameter 25
# P25: Set the % of time the relay should be active when using PWER mode.
# (30-minute duty cycle)
# Set Sensor to use Air: To indicate the temperature in the room as we have nothing else
geirra marked this conversation as resolved.
Show resolved Hide resolved
"Power regulator": ZwaveValueID(
property_=THERMOSTAT_CURRENT_TEMP_PROPERTY,
command_class=CommandClass.SENSOR_MULTILEVEL,
endpoint=2,
),
},
dependent_value=ZwaveValueID(
property_=2, command_class=CommandClass.CONFIGURATION, endpoint=0
),
),
),
# Heatit Z-TRM3
ZWaveDiscoverySchema(
platform=Platform.CLIMATE,
Expand Down
14 changes: 14 additions & 0 deletions tests/components/zwave_js/conftest.py
Original file line number Diff line number Diff line change
Expand Up @@ -385,6 +385,12 @@ def climate_eurotronic_spirit_z_state_fixture():
return json.loads(load_fixture("zwave_js/climate_eurotronic_spirit_z_state.json"))


@pytest.fixture(name="climate_heatit_z_trm6_state", scope="session")
def climate_heatit_z_trm6_state_fixture():
"""Load the climate HEATIT Z-TRM6 thermostat node state fixture data."""
return json.loads(load_fixture("zwave_js/climate_heatit_z_trm6_state.json"))


@pytest.fixture(name="climate_heatit_z_trm3_state", scope="session")
def climate_heatit_z_trm3_state_fixture():
"""Load the climate HEATIT Z-TRM3 thermostat node state fixture data."""
Expand Down Expand Up @@ -903,6 +909,14 @@ def climate_eurotronic_spirit_z_fixture(client, climate_eurotronic_spirit_z_stat
return node


@pytest.fixture(name="climate_heatit_z_trm6")
def climate_heatit_z_trm6_fixture(client, climate_heatit_z_trm6_state):
"""Mock a climate radio HEATIT Z-TRM6 node."""
node = Node(client, copy.deepcopy(climate_heatit_z_trm6_state))
client.driver.controller.nodes[node.node_id] = node
return node


@pytest.fixture(name="climate_heatit_z_trm3_no_value")
def climate_heatit_z_trm3_no_value_fixture(
client, climate_heatit_z_trm3_no_value_state
Expand Down