Skip to content

Commit

Permalink
Added Central Heating Setpoint Sensor
Browse files Browse the repository at this point in the history
Added CH Setpoint Sensor
Changed Min Bus Version On CH select
  • Loading branch information
veista committed Dec 22, 2022
1 parent 84ba0d4 commit 352c0e8
Show file tree
Hide file tree
Showing 4 changed files with 39 additions and 5 deletions.
15 changes: 15 additions & 0 deletions custom_components/nilan/device.py
Original file line number Diff line number Diff line change
Expand Up @@ -592,6 +592,21 @@ async def get_room_master_temperature(self) -> float:
_LOGGER.error("Could not read get_room_master_temperature")
return None

async def get_central_heating_setpoint(self) -> float:
"""get Central Heating Temperature Setpoint."""
result = await self._modbus.async_pymodbus_call(
self._unit_id, CTS602InputRegisters.central_heat_heat_ext_set, 1, "input"
)
if result is not None:
value = int.from_bytes(
result.registers[0].to_bytes(2, "little", signed=False),
"little",
signed=True,
)
return float(value) / 100
_LOGGER.error("Could not read get_central_heating_setpoint")
return None

async def get_exchanger_efficiency(self) -> float:
"""get AirTemp Efficiency Pct"""
result = await self._modbus.async_pymodbus_call(
Expand Down
16 changes: 12 additions & 4 deletions custom_components/nilan/device_map.py
Original file line number Diff line number Diff line change
Expand Up @@ -115,7 +115,7 @@
),
},
"get_t11_electric_water_heater_temperature": {
"entity_type": "sensor",
"entity_type": "water_heater",
"min_bus_version": 1,
"supported_devices": (
19,
Expand All @@ -124,7 +124,7 @@
),
},
"get_t12_compressor_water_heater_temperature": {
"entity_type": "sensor",
"entity_type": "water_heater",
"min_bus_version": 1,
"supported_devices": (
19,
Expand Down Expand Up @@ -236,6 +236,14 @@
"min_bus_version": 1,
"supported_devices": (None,),
},
"get_central_heating_setpoint": {
"entity_type": "sensor",
"min_bus_version": 1,
"supported_devices": (
20,
21,
),
},
"get_display_led_1_state": {
"entity_type": "binary_sensor",
"min_bus_version": 1,
Expand Down Expand Up @@ -561,7 +569,7 @@
},
"get_central_heat_select": {
"entity_type": "select",
"min_bus_version": 22,
"min_bus_version": 19, # PH
"supported_devices": (
20,
21,
Expand Down Expand Up @@ -714,7 +722,7 @@
},
"get_supply_air_after_heating": {
"entity_type": "switch",
"min_bus_version": 20,
"min_bus_version": 19, # PH
"supported_devices": (None,),
},
"get_min_supply_step": {
Expand Down
2 changes: 1 addition & 1 deletion custom_components/nilan/manifest.json
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
{
"domain": "nilan",
"name": "Nilan",
"version": "1.1.5",
"version": "1.1.6",
"config_flow": true,
"documentation": "https://github.com/veista/nilan",
"requirements": ["pymodbus==2.5.3"],
Expand Down
11 changes: 11 additions & 0 deletions custom_components/nilan/sensor.py
Original file line number Diff line number Diff line change
Expand Up @@ -241,6 +241,17 @@
None,
)
],
"get_central_heating_setpoint": [
Map(
"Central Heating Setpoint",
TEMP_CELSIUS,
SensorDeviceClass.TEMPERATURE,
SensorStateClass.MEASUREMENT,
None,
None,
None,
)
],
"get_humidity": [
Map(
"Humidity",
Expand Down

0 comments on commit 352c0e8

Please sign in to comment.