From 897c56aba57f51b495902bc0ae02bae18834e627 Mon Sep 17 00:00:00 2001 From: OStrama <66820413+OStrama@users.noreply.github.com> Date: Thu, 10 Oct 2024 15:02:22 +0200 Subject: [PATCH 1/5] Update README.md --- README.md | 11 +---------- 1 file changed, 1 insertion(+), 10 deletions(-) diff --git a/README.md b/README.md index 28d0289..b76b2b5 100644 --- a/README.md +++ b/README.md @@ -4,23 +4,14 @@ I started to build a structure that finally will allow loading of the modbus str As a first step, all modbus parameters will be concentrated in the file hpconst.py as a set of object lists. This allows generic setup of all entities and a more easy completion of messages and entity behavior -#### not yet ready #### - -For production, please use https://github.com/MadOne/weishaupt_modbus/ for now. -When it's ready, I'll distribute this fork via HACS - # Weishaupt_modbus This integration lets you monitor and controll your weishaupt heatpump through modbus. This is how it might look: -![Bildschirmfoto vom 2024-07-31 21-41-56](https://github.com/user-attachments/assets/3fde9b18-f9ea-4e75-94ee-25ef6f799dcf) +![image](https://github.com/user-attachments/assets/00e7b8fa-1779-428d-9361-7c66e228c2c6) ## Installation -### Install through HACS - -- Not working yet - ### HACS (manually add Repository) Add this repository to HACS. From 07168c180fa4a7a15100a8f6ca49dc94d87fbe7a Mon Sep 17 00:00:00 2001 From: OStrama <66820413+OStrama@users.noreply.github.com> Date: Thu, 10 Oct 2024 15:05:07 +0200 Subject: [PATCH 2/5] Delete custom_components/weishaupt_modbus/entities - Kopie.py --- .../weishaupt_modbus/entities - Kopie.py | 196 ------------------ 1 file changed, 196 deletions(-) delete mode 100644 custom_components/weishaupt_modbus/entities - Kopie.py diff --git a/custom_components/weishaupt_modbus/entities - Kopie.py b/custom_components/weishaupt_modbus/entities - Kopie.py deleted file mode 100644 index 88a12df..0000000 --- a/custom_components/weishaupt_modbus/entities - Kopie.py +++ /dev/null @@ -1,196 +0,0 @@ -from homeassistant.config_entries import ConfigEntry -from homeassistant.const import CONF_PORT -from homeassistant.components.sensor import SensorDeviceClass, SensorEntity, SensorStateClass -from homeassistant.components.select import SelectEntity -from homeassistant.components.number import NumberEntity -from homeassistant.const import UnitOfEnergy, UnitOfTemperature -from homeassistant.helpers.device_registry import DeviceInfo -from .const import CONST, FORMATS, TYPES -from .modbusobject import ModbusObject - -def BuildEntityList(entries, config_entry, modbusitems, type): - # this builds a list of entities that can be used as parameter by async_setup_entry() - # type of list is defined by the ModbusItem's type flag - # so the app only holds one list of entities that is build from a list of ModbusItem - # stored in hpconst.py so far, will be provided by an external file in future - for index, item in enumerate(modbusitems): - if item.type == type: - match type: - # here the entities are created with the parameters provided by the ModbusItem object - case TYPES.SENSOR: - entries.append(MySensorEntity(config_entry, modbusitems[index])) - case TYPES.SELECT: - entries.append(MySelectEntity(config_entry, modbusitems[index])) - case TYPES.NUMBER: - entries.append(MyNumberEntity(config_entry, modbusitems[index])) - - return entries - -class MyEntity(): - # The base class for entities that hold general parameters - _config_entry = None - _modbus_item = None - _attr_name = "" - _attr_unique_id = "" - _attr_should_poll = True - _dev_device = "" - - def __init__(self, config_entry, modbus_item) -> None: - self._config_entry = config_entry - self._modbus_item = modbus_item - self._attr_name = self._modbus_item.name - self._attr_unique_id = CONST.DOMAIN + self._attr_name - self._dev_device = self._modbus_item.device - - if self._modbus_item._format != FORMATS.STATUS: - self._attr_native_unit_of_measurement = self._modbus_item._format - self._attr_state_class = SensorStateClass.MEASUREMENT - - if self._modbus_item.resultlist != None: - self._attr_native_min_value = self._modbus_item.getNumberFromText("min") - self._attr_native_max_value = self._modbus_item.getNumberFromText("max") - self._attr_native_step = self._modbus_item.getNumberFromText("step") - - if self._modbus_item._format == FORMATS.TEMPERATUR: - self._attr_device_class = SensorDeviceClass.TEMPERATURE - - def calcTemperature(self,val: float): - if val == None: - return None - if val == -32768: - return -1 - if val == -32767: - return -2 - if val == 32768: - return None - return val / 10.0 - - def calcPercentage(self,val: float): - if val == 65535: - return None - return val - - @property - def translateVal(self): - # reads an translates a value from the modbua - mbo = ModbusObject(self._config_entry, self._modbus_item) - val = mbo.value - match self._modbus_item.format: - case FORMATS.TEMPERATUR: - return self.calcTemperature(val) - case FORMATS.PERCENTAGE: - return self.calcPercentage(val) - case FORMATS.STATUS: - return self._modbus_item.getTextFromNumber(val) - case FORMATS.KENNLINIE: - return val / 100.0 - case _: - return val - - @translateVal.setter - def translateVal(self,value): - # translates and writes a value to the modbus - mbo = ModbusObject(self._config_entry, self._modbus_item) - val = None - match self._modbus_item.format: - # logically, this belongs to the ModbusItem, but doing it here - # maybe adding a translate function in MyEntity? - # currently it saves a lot of code lines ;-) - case FORMATS.TEMPERATUR: - val = value * 10 - case FORMATS.KENNLINIE: - val = value * 100 - case FORMATS.STATUS: - val = self._modbus_item.getNumberFromText(value) - case _: - val = value - mbo.value = val - - def my_device_info(self) -> DeviceInfo: - # helper to build the device info - return { - "identifiers": {(CONST.DOMAIN, self._dev_device)}, - "name": self._dev_device, - "sw_version": "Device_SW_Version", - "model": "Device_model", - "manufacturer": "Weishaupt", - } - -class MySensorEntity(SensorEntity, MyEntity): - # class that represents a sensor entity derived from Sensorentity - # and decorated with general parameters from MyEntity - _attr_native_unit_of_measurement = None - _attr_device_class = None - _attr_state_class = None - - def __init__(self, config_entry, modbus_item) -> None: - MyEntity.__init__(self, config_entry, modbus_item) - - async def async_update(self) -> None: - # the synching is done by the ModbusObject of the entity - self._attr_native_value = self.translateVal - - @property - def device_info(self) -> DeviceInfo: - return MyEntity.my_device_info(self) - -class MyNumberEntity(NumberEntity, MyEntity): - # class that represents a sensor entity derived from Sensorentity - # and decorated with general parameters from MyEntity - _attr_native_unit_of_measurement = None - _attr_device_class = None - _attr_state_class = None - _attr_native_min_value = 10 - _attr_native_max_value = 60 - - - def __init__(self, config_entry, modbus_item) -> None: - MyEntity.__init__(self, config_entry, modbus_item) - - if self._modbus_item.resultlist != None: - self._attr_native_min_value = self._modbus_item.getNumberFromText("min") - self._attr_native_max_value = self._modbus_item.getNumberFromText("max") - self._attr_native_step = self._modbus_item.getNumberFromText("step") - - async def async_set_native_value(self, value: float) -> None: - self.translateVal = value - self._attr_native_value = self.translateVal - self.async_write_ha_state() - - async def async_update(self) -> None: - # the synching is done by the ModbusObject of the entity - self._attr_native_value = self.translateVal - - @property - def device_info(self) -> DeviceInfo: - return MyEntity.my_device_info(self) - - -class MySelectEntity(SelectEntity, MyEntity): - # class that represents a sensor entity derived from Sensorentity - # and decorated with general parameters from MyEntity - options = [] - _attr_current_option = "FEHLER" - - def __init__(self, config_entry, modbus_item) -> None: - MyEntity.__init__(self, config_entry, modbus_item) - self.async_internal_will_remove_from_hass_port = self._config_entry.data[CONF_PORT] - # option list build from the status list of the ModbusItem - self.options = [] - for index, item in enumerate(self._modbus_item._resultlist): - self.options.append(item.text) - - async def async_select_option(self, option: str) -> None: - # the synching is done by the ModbusObject of the entity - self.translateVal = option - self._attr_current_option = self.translateVal - self.async_write_ha_state() - - async def async_update(self) -> None: - # the synching is done by the ModbusObject of the entity - # await self.coordinator.async_request_refresh() - self._attr_current_option = self.translateVal - - @property - def device_info(self) -> DeviceInfo: - return MyEntity.my_device_info(self) From 321c4c0ec8e2c2722211de5f495490078b4d4ee4 Mon Sep 17 00:00:00 2001 From: OStrama <66820413+OStrama@users.noreply.github.com> Date: Thu, 10 Oct 2024 15:05:20 +0200 Subject: [PATCH 3/5] Delete custom_components/weishaupt_modbus/hpconst - Kopie.py --- .../weishaupt_modbus/hpconst - Kopie.py | 338 ------------------ 1 file changed, 338 deletions(-) delete mode 100644 custom_components/weishaupt_modbus/hpconst - Kopie.py diff --git a/custom_components/weishaupt_modbus/hpconst - Kopie.py b/custom_components/weishaupt_modbus/hpconst - Kopie.py deleted file mode 100644 index 01419d0..0000000 --- a/custom_components/weishaupt_modbus/hpconst - Kopie.py +++ /dev/null @@ -1,338 +0,0 @@ -from dataclasses import dataclass -from .const import TYPES, FORMATS -from .items import ModbusItem, StatusItem - -@dataclass(frozen=True) -class DeviceConstants: - SYS = "System" - WP = "Wärmepumpe" - WW = "Warmwasser" - HZ = "Heizkreis" - W2 = "2. Wärmeerzeuger" - ST = "Statistik" - -DEVICES = DeviceConstants() - -############################################################################################################################## -# Listen mit Fehlermeldungen, Warnmeldungen und Statustexte -# Beschreibungstext ist ebenfalls m�glich -# class StatusItem(): def __init__(self, number, text, description = None): -############################################################################################################################## - -SYS_FEHLER = [ - StatusItem(65535,"kein Fehler"), -] - -SYS_WARNUNG = [ - StatusItem(65535,"keine Warnung"), - StatusItem(32,"Fehler Kältesatz (32)"), -] - -SYS_FEHLERFREI = [ - StatusItem(0,"Fehler aktiv"), - StatusItem(1,"Störungsfreier Betrieb"), -] - -SYS_BETRIEBSANZEIGE = [ - StatusItem(0,"undefiniert"), - StatusItem(1,"Relaistest"), - StatusItem(2,"Notaus"), - StatusItem(3,"Diagnose"), - StatusItem(4,"Handbetrieb"), - StatusItem(5,"Handbetrieb Heizen"), - StatusItem(6,"Handbetrieb Kühlen"), - StatusItem(7,"Manueller Abtaubetrieb"), - StatusItem(8,"Abtauen"), - StatusItem(9,"2. WEZ"), - StatusItem(10,"EVU_SPERRE"), - StatusItem(11,"SG Tarif"), - StatusItem(12,"SG Maximal"), - StatusItem(13,"Tarifladung"), - StatusItem(14,"Erhöhter Betrieb"), - StatusItem(15,"Standzeit"), - StatusItem(16,"Standby"), - StatusItem(17,"Spülen"), - StatusItem(18,"Frostschutz"), - StatusItem(19,"Heizbetrieb"), - StatusItem(20,"Warmwasserbetrieb"), - StatusItem(21,"Legionellenschutz"), - StatusItem(22,"Umschaltung HZ KU"), - StatusItem(23,"Kühlbetrieb"), - StatusItem(24,"Passive Kühlung"), - StatusItem(25,"Sommerbetrieb"), - StatusItem(26,"Schwimmbadbetrieb"), - StatusItem(27,"Urlaub"), - StatusItem(28,"Estrichprogramm"), - StatusItem(29,"Gesperrt"), - StatusItem(30,"Sperre AT"), - StatusItem(31,"Sperre Sommer"), - StatusItem(32,"Sperre Winter"), - StatusItem(33,"Einsatzgrenze"), - StatusItem(34,"HK Sperre"), - StatusItem(35,"Absenkbetrieb"), - StatusItem(43,"Ölrückführung"), -] - -SYS_BETRIEBSART = [ - StatusItem(0,"Automatik"), - StatusItem(1,"Heizen"), - StatusItem(2,"Kühlen"), - StatusItem(3,"Sommer"), - StatusItem(4,"Standby"), - StatusItem(5,"2.WEZ"), -] - -HP_BETRIEB = [ - StatusItem(0,"Undefiniert"), - StatusItem(1,"Relaistest"), - StatusItem(2,"Notaus"), - StatusItem(3,"Diagnose"), - StatusItem(4,"Handbetrieb"), - StatusItem(5,"Handbetrieb Heizen"), - StatusItem(6,"Handbetrieb Kühlen"), - StatusItem(7,"Manueller Abtaubetrieb"), - StatusItem(8,"Abtauen"), - StatusItem(9,"WEZ2"), - StatusItem(10,"EVU_SPERRE"), - StatusItem(11,"SG Tarif"), - StatusItem(12,"SG Maximal"), - StatusItem(13,"Tarifladung"), - StatusItem(14,"Erhöhter Betrieb"), - StatusItem(15,"Standzeit"), - StatusItem(16,"Standbybetrieb"), - StatusItem(17,"Spülbetrieb"), - StatusItem(18,"Frostschutz"), - StatusItem(19,"Heizbetrieb"), - StatusItem(20,"Warmwasserbetrieb"), - StatusItem(21,"Legionellenschutz"), - StatusItem(22,"Umschaltung HZ KU"), - StatusItem(23,"Kühlbetrieb"), - StatusItem(24,"Passive Kühlung"), - StatusItem(25,"Sommerbetrieb"), - StatusItem(26,"Schwimmbad"), - StatusItem(27,"Urlaub"), - StatusItem(28,"Estrich"), - StatusItem(29,"Gesperrt"), - StatusItem(30,"Sperre AT"), - StatusItem(31,"Sperre Sommer"), - StatusItem(32,"Sperre Winter"), - StatusItem(33,"Einsatzgrenze"), - StatusItem(34,"HK Sperre"), - StatusItem(35,"Absenk"), - StatusItem(43,"Ölrückführung"), -] - -HP_STOERMELDUNG = [ - StatusItem(0,"Störung"), - StatusItem(1,"Störungsfrei"), -] - -HP_RUHEMODUS = [ - StatusItem(0,"aus"), - StatusItem(1,"80 %"), - StatusItem(2,"60 %"), - StatusItem(3,"40 %"), -] - -RANGE_PERCENTAGE = [ - StatusItem(0,"min"), - StatusItem(100,"max"), - StatusItem(1,"step"), -] - -TEMPRANGE_ROOM = [ - StatusItem(16,"min"), - StatusItem(30,"max"), - StatusItem(0.5,"step"), -] - -TEMPRANGE_WATER = [ - StatusItem(30,"min"), - StatusItem(60,"max"), - StatusItem(0.5,"step"), -] - -TEMPRANGE_SGREADY = [ - StatusItem(0,"min"), - StatusItem(10,"max"), - StatusItem(0.5,"step"), -] - -TEMPRANGE_BIVALENZ = [ - StatusItem(-20,"min"), - StatusItem(10,"max"), - StatusItem(0.5,"step"), -] - - -RANGE_HZKENNLINIE = [ - StatusItem(0,"min"), - StatusItem(3,"max"), - StatusItem(0.05,"step"), -] - -TIMERANGE_WWPUSH = [ - StatusItem(0,"min"), - StatusItem(240,"max"), - StatusItem(5,"step"), -] - -HZ_KONFIGURATION = [ - StatusItem(0,"aus"), - StatusItem(1,"Pumpenkreis"), - StatusItem(2,"Mischkreis"), - StatusItem(3,"Sollwert (Pumpe M1)"), -] - -HZ_ANFORDERUNG = [ - StatusItem(0,"aus"), - StatusItem(1,"witterungsgeführt"), - StatusItem(2,"konstant"), -] - -HZ_BETRIEBSART = [ - StatusItem(0,"Automatik"), - StatusItem(1,"Komfort"), - StatusItem(2,"Normal"), - StatusItem(3,"Absenkbetrieb"), - StatusItem(4,"Standby"), -] - -HZ_PARTY_PAUSE = [ - StatusItem(1,"Pause 12.0h"), - StatusItem(2,"Pause 11.5h"), - StatusItem(3,"Pause 11.0h"), - StatusItem(4,"Pause 10.5h"), - StatusItem(5,"Pause 10.0h"), - StatusItem(6,"Pause 9.5h"), - StatusItem(7,"Pause 9.0h"), - StatusItem(8,"Pause 8.5h"), - StatusItem(9,"Pause 8.0h"), - StatusItem(10,"Pause 7.5h"), - StatusItem(11,"Pause 7.0h"), - StatusItem(12,"Pause 6.5h"), - StatusItem(13,"Pause 6.0h"), - StatusItem(14,"Pause 5.5h"), - StatusItem(15,"Pause 5.0h"), - StatusItem(16,"Pause 4.5h"), - StatusItem(17,"Pause 4.0h"), - StatusItem(18,"Pause 3.5h"), - StatusItem(19,"Pause 3.0h"), - StatusItem(20,"Pause 2.5h"), - StatusItem(21,"Pause 2.0h"), - StatusItem(22,"Pause 1.5h"), - StatusItem(23,"Pause 1.0h"), - StatusItem(24,"Pause 0.5h"), - StatusItem(25,"Automatik"), - StatusItem(26,"Party 0.5h"), - StatusItem(27,"Party 1.0h"), - StatusItem(28,"Party 1.5h"), - StatusItem(29,"Party 2.0h"), - StatusItem(30,"Party 2.5h"), - StatusItem(31,"Party 3.0h"), - StatusItem(32,"Party 3.5h"), - StatusItem(33,"Party 4.0h"), - StatusItem(34,"Party 4.5h"), - StatusItem(35,"Party 5.0h"), - StatusItem(36,"Party 5.5h"), - StatusItem(37,"Party 6.0h"), - StatusItem(38,"Party 6.5h"), - StatusItem(39,"Party 7.0h"), - StatusItem(40,"Party 7.5h"), - StatusItem(41,"Party 8.0h"), - StatusItem(42,"Party 8.5h"), - StatusItem(43,"Party 9.0h"), - StatusItem(44,"Party 9.5h"), - StatusItem(45,"Party 10.0h"), - StatusItem(46,"Party 10.5h"), - StatusItem(47,"Party 11.0h"), - StatusItem(48,"Party 11.5h"), - StatusItem(49,"Party 12.0h"), -] - -WW_KONFIGURATION = [ - StatusItem(0,"aus"), - StatusItem(1,"Umlenkventil"), - StatusItem(2,"Pumpe"), -] - -W2_STATUS = [ - StatusItem(0,"aus"), - StatusItem(1,"ein"), -] - -W2_KONFIG = [ - StatusItem(0,"0"), - StatusItem(1,"1"), -] - - -############################################################################################################################## -# Modbus Register List: # -# https://docs.google.com/spreadsheets/d/1EZ3QgyB41xaXo4B5CfZe0Pi8KPwzIGzK/edit?gid=1730751621#gid=1730751621 # -############################################################################################################################## - -MODBUS_SYS_ITEMS = [ - ModbusItem(30001,"Aussentemperatur",FORMATS.TEMPERATUR,TYPES.SENSOR,DEVICES.SYS), - ModbusItem(30002,"Luftansaugtemperatur",FORMATS.TEMPERATUR,TYPES.SENSOR,DEVICES.SYS), - ModbusItem(30003,"Fehler",FORMATS.STATUS,TYPES.SENSOR,DEVICES.SYS, SYS_FEHLER), - ModbusItem(30004,"Warnung",FORMATS.STATUS,TYPES.SENSOR,DEVICES.SYS, SYS_WARNUNG), - ModbusItem(30005,"Fehlerfrei",FORMATS.STATUS,TYPES.SENSOR,DEVICES.SYS, SYS_FEHLERFREI), - ModbusItem(30006,"Betriebsanzeige",FORMATS.STATUS,TYPES.SENSOR,DEVICES.SYS, SYS_BETRIEBSANZEIGE), - ModbusItem(40001,"Systembetriebsart",FORMATS.STATUS,TYPES.SELECT,DEVICES.SYS, SYS_BETRIEBSART), - - ModbusItem(33101,"Betrieb",FORMATS.STATUS,TYPES.SENSOR,DEVICES.WP, HP_BETRIEB), - ModbusItem(33102,"Störmeldung",FORMATS.STATUS,TYPES.SENSOR,DEVICES.WP, HP_STOERMELDUNG), - ModbusItem(33103,"Leistungsanforderung",FORMATS.PERCENTAGE,TYPES.SENSOR,DEVICES.WP), - ModbusItem(33104,"Vorlauftemperatur",FORMATS.TEMPERATUR,TYPES.SENSOR,DEVICES.WP), - ModbusItem(33105,"Rücklauftemperatur",FORMATS.TEMPERATUR,TYPES.SENSOR,DEVICES.WP), - ModbusItem(43101,"Konfiguration ",FORMATS.NUMBER,TYPES.NUMBER,DEVICES.WP), - ModbusItem(43102,"Ruhemodus",FORMATS.STATUS,TYPES.SELECT,DEVICES.WP,HP_RUHEMODUS), - ModbusItem(43103,"Pumpe Einschaltart",FORMATS.NUMBER,TYPES.NUMBER,DEVICES.WP), - ModbusItem(43104,"Pumpe Leistung Heizen",FORMATS.PERCENTAGE,TYPES.NUMBER,DEVICES.WP,RANGE_PERCENTAGE), - ModbusItem(43105,"Pumpe Leistung Kühlen",FORMATS.PERCENTAGE,TYPES.NUMBER,DEVICES.WP,RANGE_PERCENTAGE), - ModbusItem(43106,"Pumpe Leistung Warmwasser",FORMATS.PERCENTAGE,TYPES.NUMBER,DEVICES.WP,RANGE_PERCENTAGE), - ModbusItem(43107,"Pumpe Leistung Abtaubetrieb",FORMATS.PERCENTAGE,TYPES.NUMBER,DEVICES.WP,RANGE_PERCENTAGE), - ModbusItem(43108,"Volumenstrom Heizen",FORMATS.VOLUMENSTROM,TYPES.NUMBER,DEVICES.WP), - ModbusItem(43109,"Volumenstrom Kühlen",FORMATS.VOLUMENSTROM,TYPES.NUMBER,DEVICES.WP), - ModbusItem(43110,"Volumenstrom Warmwasser",FORMATS.VOLUMENSTROM,TYPES.NUMBER,DEVICES.WP), - - ModbusItem(31101,"Raumsolltemperatur",FORMATS.TEMPERATUR,TYPES.SENSOR,DEVICES.HZ), - ModbusItem(31102,"Raumtemperatur",FORMATS.TEMPERATUR,TYPES.SENSOR,DEVICES.HZ), - ModbusItem(31103,"Raumfeuchte",FORMATS.PERCENTAGE,TYPES.SENSOR,DEVICES.HZ), - ModbusItem(31104,"Vorlaufsolltemperatur",FORMATS.TEMPERATUR,TYPES.SENSOR,DEVICES.HZ), - ModbusItem(31105,"HZ_Vorlauftemperatur",FORMATS.TEMPERATUR,TYPES.SENSOR,DEVICES.HZ), - ModbusItem(41101,"HZ_Konfiguration",FORMATS.STATUS,TYPES.SELECT,DEVICES.HZ, HZ_KONFIGURATION), - ModbusItem(41102,"Anforderung Typ",FORMATS.STATUS,TYPES.SELECT,DEVICES.HZ, HZ_ANFORDERUNG), - ModbusItem(41103,"Betriebsart",FORMATS.STATUS,TYPES.SELECT,DEVICES.HZ, HZ_BETRIEBSART), - ModbusItem(41104,"Pause / Party",FORMATS.STATUS,TYPES.SELECT,DEVICES.HZ, HZ_PARTY_PAUSE), - ModbusItem(41105,"Raumsolltemperatur Komfort",FORMATS.TEMPERATUR,TYPES.NUMBER,DEVICES.HZ,TEMPRANGE_ROOM), - ModbusItem(41106,"Raumsolltemperatur Normal",FORMATS.TEMPERATUR,TYPES.NUMBER,DEVICES.HZ,TEMPRANGE_ROOM), - ModbusItem(41107,"Raumsolltemperatur Absenk",FORMATS.TEMPERATUR,TYPES.NUMBER,DEVICES.HZ,TEMPRANGE_ROOM), - ModbusItem(41108,"Heizkennlinie",FORMATS.KENNLINIE,TYPES.NUMBER,DEVICES.HZ,RANGE_HZKENNLINIE), - ModbusItem(41109,"Sommer Winter Umschaltung",FORMATS.TEMPERATUR,TYPES.NUMBER,DEVICES.HZ,TEMPRANGE_ROOM), - ModbusItem(41110,"Heizen Konstanttemperatur",FORMATS.TEMPERATUR,TYPES.NUMBER,DEVICES.HZ,TEMPRANGE_ROOM), - ModbusItem(41111,"Heizen Konstanttemp Absenk",FORMATS.TEMPERATUR,TYPES.NUMBER,DEVICES.HZ,TEMPRANGE_ROOM), - ModbusItem(41112,"Kühlen Konstanttemperatur",FORMATS.TEMPERATUR,TYPES.NUMBER,DEVICES.HZ,TEMPRANGE_ROOM), - - ModbusItem(32101,"Warmwassersolltemperatur",FORMATS.TEMPERATUR,TYPES.NUMBER,DEVICES.WW,TEMPRANGE_WATER), - ModbusItem(32102,"Warmwassertemepratur",FORMATS.TEMPERATUR,TYPES.NUMBER,DEVICES.WW,TEMPRANGE_WATER), - ModbusItem(42101,"WW_Konfiguration",FORMATS.STATUS,TYPES.SELECT,DEVICES.WW,WW_KONFIGURATION), - ModbusItem(42102,"Warmwasser Push",FORMATS.TIME_MIN,TYPES.NUMBER,DEVICES.WW,TIMERANGE_WWPUSH), - ModbusItem(42103,"Warmwasser Normal",FORMATS.TEMPERATUR,TYPES.NUMBER,DEVICES.WW,TEMPRANGE_WATER), - ModbusItem(42104,"Warmwasser Absenk",FORMATS.TEMPERATUR,TYPES.NUMBER,DEVICES.WW,TEMPRANGE_WATER), - ModbusItem(42105,"SG Ready Anhebung",FORMATS.TEMPERATUR,TYPES.NUMBER,DEVICES.WW,TEMPRANGE_SGREADY), - - ModbusItem(34101,"Status 2. WEZ",FORMATS.STATUS,TYPES.SENSOR,DEVICES.W2,W2_STATUS), - ModbusItem(34102,"Betriebsstunden 2. WEZ",FORMATS.TIME_H,TYPES.SENSOR,DEVICES.W2), - ModbusItem(34103,"Schaltspiele 2. WEZ",FORMATS.NUMBER,TYPES.SENSOR,DEVICES.W2), - ModbusItem(34104,"Status E-Heizung 1",FORMATS.STATUS,TYPES.SENSOR,DEVICES.W2,W2_STATUS), - ModbusItem(34105,"Status E-Heizung 2",FORMATS.STATUS,TYPES.SENSOR,DEVICES.W2,W2_STATUS), - ModbusItem(34106,"Betriebsstunden E1",FORMATS.TIME_H,TYPES.SENSOR,DEVICES.W2), - ModbusItem(34107,"Betriebsstunden E2",FORMATS.TIME_H,TYPES.SENSOR,DEVICES.W2), - ModbusItem(44101,"W2_Konfiguration",FORMATS.STATUS,TYPES.SENSOR,DEVICES.W2,W2_KONFIG), - ModbusItem(44102,"Grenztemperatur",FORMATS.TEMPERATUR,TYPES.NUMBER,DEVICES.W2,TEMPRANGE_BIVALENZ), - ModbusItem(44103,"Bivalenztemperatur",FORMATS.TEMPERATUR,TYPES.NUMBER,DEVICES.W2,TEMPRANGE_BIVALENZ), - ModbusItem(44104,"Bivalenztemperatur WW",FORMATS.TEMPERATUR,TYPES.NUMBER,DEVICES.W2,TEMPRANGE_BIVALENZ), - -] From 84ed863c0b3d1cda8f633aefec8c7a9862ac633b Mon Sep 17 00:00:00 2001 From: OStrama <66820413+OStrama@users.noreply.github.com> Date: Thu, 10 Oct 2024 15:05:31 +0200 Subject: [PATCH 4/5] Delete custom_components/weishaupt_modbus/items - Kopie.py --- .../weishaupt_modbus/items - Kopie.py | 99 ------------------- 1 file changed, 99 deletions(-) delete mode 100644 custom_components/weishaupt_modbus/items - Kopie.py diff --git a/custom_components/weishaupt_modbus/items - Kopie.py b/custom_components/weishaupt_modbus/items - Kopie.py deleted file mode 100644 index 417934a..0000000 --- a/custom_components/weishaupt_modbus/items - Kopie.py +++ /dev/null @@ -1,99 +0,0 @@ -from .const import TYPES - -# An item of a status, e.g. error code and error text along with a precise description -# A class is intentionally defined here because the assignment via dictionaries would not work so elegantly in the end, -# especially when searching backwards. (At least I don't know how...) -class StatusItem(): - _number = -1 - _text = "" - _description = "" - - def __init__(self, number, text, description = None): - self._number = number - self._text = text - self._description = description - - @property - def number(self): - return self._number - - @number.setter - def number(self, value) -> None: - self._number = value - - @property - def text(self): - return self._text - - @text.setter - def text(self, value) -> None: - self._text = value - - @property - def description(self): - return self._description - - @description.setter - def description(self, value) -> None: - self._description = value - -# A Modbus item, consisting of address, name, -# format (temperature, status, ..), -# type (sensor, number, ..), -# device (System, Heatpump, ..) and -# optional result list from status items -# (number entities: status = limits? -class ModbusItem(): - _address = None - _name = "empty" - _format = None - _type = TYPES.SENSOR - _resultlist = None - _device = None - - def __init__(self, address, name, format, type, device, resultlist = None): - self._address = address - self._name = name - self._format = format - self._type = type - self._device = device - self._resultlist = resultlist - - @property - def address(self): - return self._address - @property - def name(self): - return self._name - - @property - def format(self): - return self._format - - @property - def type(self): - return self._type - - @property - def device(self): - return self._device - - @property - def resultlist(self): - return self._resultlist - - def getTextFromNumber(self, val): - if self._resultlist == None: - return None - for index, item in enumerate(self._resultlist): - if val == item.number: - return item.text - return "unbekannt <" + str(val) + ">" - - def getNumberFromText(self, val): - if self._resultlist == None: - return None - for index, item in enumerate(self._resultlist): - if val == item.text: - return item.number - return -1 From db926a620547f698b67a4a32422ed8e8982dc975 Mon Sep 17 00:00:00 2001 From: OStrama <66820413+OStrama@users.noreply.github.com> Date: Thu, 10 Oct 2024 18:17:59 +0200 Subject: [PATCH 5/5] Update issue templates --- .github/ISSUE_TEMPLATE/bug_report.md | 38 +++++++++++++++++++++++ .github/ISSUE_TEMPLATE/feature_request.md | 20 ++++++++++++ 2 files changed, 58 insertions(+) create mode 100644 .github/ISSUE_TEMPLATE/bug_report.md create mode 100644 .github/ISSUE_TEMPLATE/feature_request.md diff --git a/.github/ISSUE_TEMPLATE/bug_report.md b/.github/ISSUE_TEMPLATE/bug_report.md new file mode 100644 index 0000000..dd84ea7 --- /dev/null +++ b/.github/ISSUE_TEMPLATE/bug_report.md @@ -0,0 +1,38 @@ +--- +name: Bug report +about: Create a report to help us improve +title: '' +labels: '' +assignees: '' + +--- + +**Describe the bug** +A clear and concise description of what the bug is. + +**To Reproduce** +Steps to reproduce the behavior: +1. Go to '...' +2. Click on '....' +3. Scroll down to '....' +4. See error + +**Expected behavior** +A clear and concise description of what you expected to happen. + +**Screenshots** +If applicable, add screenshots to help explain your problem. + +**Desktop (please complete the following information):** + - OS: [e.g. iOS] + - Browser [e.g. chrome, safari] + - Version [e.g. 22] + +**Smartphone (please complete the following information):** + - Device: [e.g. iPhone6] + - OS: [e.g. iOS8.1] + - Browser [e.g. stock browser, safari] + - Version [e.g. 22] + +**Additional context** +Add any other context about the problem here. diff --git a/.github/ISSUE_TEMPLATE/feature_request.md b/.github/ISSUE_TEMPLATE/feature_request.md new file mode 100644 index 0000000..bbcbbe7 --- /dev/null +++ b/.github/ISSUE_TEMPLATE/feature_request.md @@ -0,0 +1,20 @@ +--- +name: Feature request +about: Suggest an idea for this project +title: '' +labels: '' +assignees: '' + +--- + +**Is your feature request related to a problem? Please describe.** +A clear and concise description of what the problem is. Ex. I'm always frustrated when [...] + +**Describe the solution you'd like** +A clear and concise description of what you want to happen. + +**Describe alternatives you've considered** +A clear and concise description of any alternative solutions or features you've considered. + +**Additional context** +Add any other context or screenshots about the feature request here.