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
57 changes: 57 additions & 0 deletions homeassistant/components/zwave_js/discovery.py
Original file line number Diff line number Diff line change
Expand Up @@ -530,6 +530,63 @@ 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,
),
# This mode is a hack, changing climate entity does not change operating mode - Use Internal temp.
MartinHjelmare marked this conversation as resolved.
Show resolved Hide resolved
# Heating is set by adjusting param 25
"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
10 changes: 10 additions & 0 deletions tests/components/zwave_js/conftest.py
Original file line number Diff line number Diff line change
Expand Up @@ -384,6 +384,10 @@ def climate_eurotronic_spirit_z_state_fixture():
"""Load the climate Eurotronic Spirit Z thermostat node state fixture data."""
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():
Expand Down Expand Up @@ -902,6 +906,12 @@ def climate_eurotronic_spirit_z_fixture(client, climate_eurotronic_spirit_z_stat
client.driver.controller.nodes[node.node_id] = node
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(
Expand Down