Skip to content

Commit

Permalink
Browse files Browse the repository at this point in the history
…e-Assistant-Integration into 80-bug-data-for-key-data-does-not-exist
  • Loading branch information
jontofront committed Dec 17, 2024
2 parents 357ffa3 + 80c3593 commit ad373d3
Show file tree
Hide file tree
Showing 13 changed files with 528 additions and 195 deletions.
9 changes: 8 additions & 1 deletion CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -176,4 +176,11 @@ Thank for @pblxptr add new code line from him

**Full Changelog**: [https://github.com/jontofront/ecoNET-300-Home-Assistant-Integration/compare/v0.3.3...v1.0.5](https://github.com/jontofront/ecoNET-300-Home-Assistant-Integration/compare/v0.3.3...v1.0.5)

## [v1.0.5]
## [v1.0.11]

Additions and Updates to Sensors:
Added boilerPowerKW as a new sensor type in custom_components/econet300/const.py and updated its unit, device class, and icon. [1] [2] [3] [4] [5]
Added feederWorks as a new binary sensor in custom_components/econet300/const.py and updated its icon. [1] [2] [3]
Updates to Existing Sensors:
Renamed the lighter sensor to lighterWorks in custom_components/econet300/const.py and updated its icon. [1] [2]
Updated the names of the lighter, boilerPower, and feeder sensors in custom_components/econet300/strings.json and custom_components/econet300/translations/en.json. [1] [2] [3] [4] [5] [6]
98 changes: 75 additions & 23 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -24,6 +24,22 @@ he **ecoNET300 Home Assistant Integration** allows local control and monitoring
- **Easy Configuration**: Integrate directly via Home Assistant UI.
- **Tested With**: ecoMAX810P-L TOUCH controller from [Plum Sp. z o.o.](https://www.plum.pl/)

## Table of Contents
1. [ecoNET300 Home Assistant Integration](#econet300-home-assistant-integration)
2. [Overview](#overview)
3. [Versions](#versions)
- [Migrating to v1.0.0_beta](#migrating-to-v100_beta)
4. [Example](#example)
5. [Installation](#installation)
- [HACS (Recommended)](#hacs-recommended)
- [Manual Installation](#manual-installation)
6. [Configuration](#configuration)
7. [Entities](#entities)
- [Sensors](#sensors)
- [Binary Sensors](#binary-sensors)
8. [Contributing](#contributing)
9. [Acknowledgments](#acknowledgments)
10. [Disclaimer](#disclaimer)

## versions
* v0.3.3 - version is stable. Most of the work was done by @pblxpt, for which we're very thankful as the community.
Expand Down Expand Up @@ -103,36 +119,72 @@ __Password__: Local password (NOT the password that you use to login to econet24
<br>

## Entities

### Sensors

These sensors are retrieved from the `../econet/regParams` endpoint. Below is the list of available entity keys and their descriptions:
These sensors are retrieved from the `../econet/regParams` and `../econet/sysParams` endpoints. Below is the list of available entity keys, their descriptions, and the corresponding API endpoint keys:
<details>
<summary>**👉 Click here to expand the table**</summary>


| Entity Key | Description | Endpoint |
|----------------------|-----------------------------------------------------------|-----------------------|
| `tempFeeder` | Temperature of the feeder mechanism | `../econet/regParams` |
| `fuelLevel` | Current fuel level in the system | `../econet/regParams` |
| `tempCO` | Current fireplace temperature | `../econet/regParams` |
| `tempCOSet` | Desired fireplace set temperature | `../econet/regParams` |
| `statusCWU` | Status of the hot water (CWU) system | `../econet/regParams` |
| `tempCWU` | Current hot water (CWU) temperature | `../econet/regParams` |
| `tempCWUSet` | Desired hot water (CWU) temperature | `../econet/regParams` |
| `tempFlueGas` | Exhaust temperature reading | `../econet/regParams` |
| `mode` | Current operational mode of the device | `../econet/regParams` |
| `fanPower` | Current fan power usage | `../econet/regParams` |
| `thermostat` | Thermostat status or set temperature | `../econet/regParams` |
| `tempExternalSensor` | Outside (external) temperature | `../econet/regParams` |
| `tempLowerBuffer` | Temperature of the lower thermal buffer | `../econet/regParams` |
| `tempUpperBuffer` | Temperature of the upper thermal buffer | `../econet/regParams` |
| `boilerPower` | Current power output of the boiler | `../econet/regParams` |
| `quality` | Fuel quality or system quality indicator (if applicable) | `../econet/sysParams` |
| `signal` | Signal strength or communication status | `../econet/sysParams` |
| `softVer` | Software version of the controller | `../econet/sysParams` |
| `controllerID` | Unique identifier for the controller | `../econet/sysParams` |
| `moduleASoftVer` | Software version of Module A | `../econet/sysParams` |
| `moduleBSoftVer` | Software version of Module B | `../econet/sysParams` |
| `moduleCSoftVer` | Software version of Module C | `../econet/sysParams` |
| `moduleLambdaSoftVer`| Software version of the lambda module | `../econet/sysParams` |
| `modulePanelSoftVer` | Software version of the control panel | `../econet/sysParams` |
</details>

### Binary Sensors

| sensor Key | Description |
|----------------------|------------------------------------------|
| `tempFeeder` | Temperature of the feeder mechanism |
| `fuelLevel` | Current fuel level in the system |
| `tempCO` | Current fireplace temperature |
| `tempCOSet` | Desired fireplace set temperature |
| `statusCWU` | Status of the hot water (CWU) system |
| `tempCWUSet` | Desired hot water (CWU) temperature |
| `tempFlueGas` | Exhaust temperature reading |
| `mode` | Current operational mode of the device |
| `fanPower` | Current fan power usage |
| `thermostat` | Thermostat status or set temperature |
| `tempExternalSensor` | Outside (external) temperature |
These binary sensors are retrieved from the `../econet/regParams` and `../econet/sysParams` endpoints. Below is the list of available entity keys, their descriptions, and the corresponding API endpoint keys:
<details>
<summary>**👉 Click here to expand the table**</summary>

| Entity Key | Description | Endpoint |
|----------------------|--------------------------------------------------|-----------------------|
| `lighter` | Indicates if the lighter is active | `../econet/regParams` |
| `pumpCOWorks` | Indicates if the fireplace pump is working | `../econet/regParams` |
| `fanWorks` | Indicates if the fan is currently active | `../econet/regParams` |
| `pumpFireplaceWorks` | Indicates if the fireplace pump is working | `../econet/regParams` |
| `pumpCWUWorks` | Indicates if the hot water (CWU) pump is active | `../econet/regParams` |
| `mainSrv` | Indicates if the main server is operational | `../econet/sysParams` |
| `wifi` | Indicates if the Wi-Fi connection is active | `../econet/sysParams` |
| `lan` | Indicates if the LAN connection is active | `../econet/sysParams` |
</details>

### Number Entities

### Binary Sensors
These number entities are retrieved from the `../econet/rmCurrentDataParamsEdits` endpoint. Below is the list of available entity keys, their descriptions, and the corresponding API endpoint keys:

These binary sensors are retrieved from the `../econet/regParams` endpoint. Below is the list of available entity keys and their descriptions:
| Entity Key | Description |
|----------------------|---------------------------------------------|
| `lighter` | Indicates if the lighter is active |
| `pumpCOWorks` | Indicates if the fireplace pump is working |
| `fanWorks` | Indicates if the fan is currently active |
| `pumpFireplaceWorks` | Indicates if the fireplace pump is working |
| `pumpCWUWorks` | Indicates if the hot water (CWU) pump is active |
<details>
<summary>**👉 Click here to expand the table**</summary>

| Entity Key | Description | Endpoint |
|----------------------|----------------------------------------------|--------------------------------------|
| `tempCOSet` | Desired fireplace set temperature | `../econet/rmCurrentDataParamsEdits` |
| `tempCWUSet` | Desired hot water (CWU) set temperature | `../econet/rmCurrentDataParamsEdits` |
</details>

## Contributing

Expand Down
26 changes: 20 additions & 6 deletions custom_components/econet300/binary_sensor.py
Original file line number Diff line number Diff line change
Expand Up @@ -4,6 +4,7 @@
import logging

from homeassistant.components.binary_sensor import (
BinarySensorDeviceClass,
BinarySensorEntity,
BinarySensorEntityDescription,
)
Expand Down Expand Up @@ -84,7 +85,9 @@ def create_binary_entity_description(key: str) -> EconetBinarySensorEntityDescri
entity_description = EconetBinarySensorEntityDescription(
key=key,
translation_key=camel_to_snake(key),
device_class=ENTITY_BINARY_DEVICE_CLASS_MAP.get(key, None),
device_class=ENTITY_BINARY_DEVICE_CLASS_MAP.get(
key, BinarySensorDeviceClass.RUNNING
),
icon=ENTITY_ICON.get(key, None),
icon_off=ENTITY_ICON_OFF.get(key, None),
)
Expand All @@ -95,20 +98,31 @@ def create_binary_entity_description(key: str) -> EconetBinarySensorEntityDescri
def create_binary_sensors(coordinator: EconetDataCoordinator, api: Econet300Api):
"""Create binary sensors."""
entities: list[EconetBinarySensor] = []
coordinator_data = coordinator.data["regParams"]
data_regParams = coordinator.data.get("regParams", {})
data_sysParams = coordinator.data.get("sysParams", {})

for data_key in BINARY_SENSOR_MAP_KEY["_default"]:
_LOGGER.debug("Processing binary sensor data_key: %s", data_key)
if data_key in coordinator_data:
_LOGGER.debug(
"Processing binary sensor data_key: %s from regParams & sysParams", data_key
)
if data_key in data_regParams:
entity = EconetBinarySensor(
create_binary_entity_description(data_key), coordinator, api
)
entities.append(entity)
_LOGGER.debug("Created and appended entity from regParams: %s", entity)
elif data_key in data_sysParams:
entity = EconetBinarySensor(
create_binary_entity_description(data_key), coordinator, api
)
entities.append(entity)
_LOGGER.debug("Created and appended entity: %s", entity)
_LOGGER.debug("Created and appended entity from sysParams: %s", entity)
else:
_LOGGER.warning(
"key: %s is not mapped, binary sensor entity will not be added",
"key: %s is not mapped in regParams, binary sensor entity will not be added",
data_key,
)
_LOGGER.info("Total entities created: %d", len(entities))
return entities


Expand Down
2 changes: 1 addition & 1 deletion custom_components/econet300/common.py
Original file line number Diff line number Diff line change
Expand Up @@ -60,7 +60,7 @@ async def _async_update_data(self):
try:
# Note: asyncio.TimeoutError and aiohttp.ClientError are already
# handled by the data update coordinator.
async with asyncio.timeout(10):
async with asyncio.timeout(20):
data = await self._api.fetch_sys_params()
reg_params = await self._api.fetch_reg_params()
params_edits = await self._api.fetch_param_edit_data()
Expand Down
Loading

0 comments on commit ad373d3

Please sign in to comment.