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 all entities #77

Open
wants to merge 18 commits into
base: main
Choose a base branch
from
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
1 change: 1 addition & 0 deletions .gitignore
Original file line number Diff line number Diff line change
@@ -1,3 +1,4 @@
README.md
.DS_Store
custom_components/ithodaalderop/__pycache__
*.pyc
77 changes: 17 additions & 60 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@
- [What can be configured via this Integration](#what-can-be-configured-via-this-integration)
- [Not (yet) supported](#not-yet-supported)
- [Use-case](#use-case)
- [Available sensors](#available-sensors)
- [Why don't I see all entities?](#why-dont-i-see-all-entities)
- [Installation](#installation)
- [Prerequisites](#prerequisites)
- [Install via HACS (recommended)](#install-via-hacs-recommended)
Expand Down Expand Up @@ -41,65 +41,22 @@ Full auto-discovery from the WiFi add-on to Home Assistant is the best experienc
* CO2 concencration for supported remotes
* WPU like Pump Percentage, Boiler Temp, From / To Source Temps, Operating Mode etc

It creates a device and commonly used sensors and uses a predefined MQTT state topic to distinct the devices.

## Available sensors
| Device | Sensor | Attributes |
|---|---|---|
| **Autotemp** |||
|| Empty battery ||
|| Error | Code |
|| Mode | Code |
|| Room X power % (%) ||
|| Room X power kW (kW) ||
|| Room X setpoint ||
|| Room X temp ||
|| Status | Code |
| **CVE** |||
|| Error ||
|| Fan Setpoint (rpm) ||
|| Fan Speed (rpm) ||
|| Filter dirty ||
|| Humidity ||
|| Temperature ||
|| Total Operating Time ||
|| Ventilation setpoint (%) ||
|| Last Command (disabled by default) ||
|| Last Command Source (disabled by default) ||
| **NONCVE (HRU)** |||
|| Actual Mode | Code |
|| Air Quality (%) ||
|| Airfilter counter | Last Maintenance |
||| Next Maintenance Estimate |
|| Balance (%) ||
|| Bypass position ||
|| Exhaust fan (RPM) ||
|| Exhaust temp (°C) ||
|| Global fault code | Description |
|| Highest received CO2 value (Ppm) (disabled by default) ||
|| Highest received RH value (%RH) (disabled by default) | Error Description |
|| Remaining override timer (Sec) ||
|| Supply fan (RPM) ||
|| Supply temp (°C) ||
|| Last Command (disabled by default) ||
|| Last Command Source (disabled by default) ||
| **WPU** |||
|| Boiler pump (%) ||
|| Boiler temp up (°C) ||
|| CV pressure (Bar) ||
|| Cv pump (%) ||
|| CV return temp (°C) ||
|| Error ||
|| Flow sensor (lt_hr) ||
|| Heat demand thermost. (%) ||
|| Status ||
|| Temp from source (°C) ||
|| Temp to source (°C) ||
|| Requested room temp (°C) ||
|| Room temp (°C) ||
|| Well pump (%) ||

Missing a sensor? Feel free to create an [issue](https://github.com/jasperslits/haithowifi/issues)
It creates a device and all available sensors and uses a predefined MQTT state topic to distinct the devices.

## Why don't I see all entities?
Some sensor are disabled by default. Follow these instructions to enable an entity.

Click `xx entities not shown` within the device or just navigate to the entity directly

![image](https://github.com/user-attachments/assets/2a72a81d-7007-410e-af52-9ba43e88352c)

Click the `cogwheel` icon

![image](https://github.com/user-attachments/assets/3c7c89a8-b847-48b1-a7ae-d272da72c552)

Click `enable`

![image](https://github.com/user-attachments/assets/64f7b234-648d-4e25-adeb-996c0d6a7ef8)

# Installation

Expand Down
47 changes: 28 additions & 19 deletions custom_components/ithodaalderop/binary_sensor.py
Original file line number Diff line number Diff line change
Expand Up @@ -24,12 +24,11 @@
MQTT_STATETOPIC,
NONCVE_DEVICES,
)
from .definitions import (
AUTOTEMPBINARYSENSORS,
HRUECO350BINARYSENSORS,
HRUECOBINARYSENSORS,
IthoBinarySensorEntityDescription,
)
from .definitions.base import IthoBinarySensorEntityDescription
from .definitions.cve import CVE_BINARY_SENSORS
from .definitions.hru350 import HRU_ECO_350_BINARY_SENSORS
from .definitions.hrueco import HRU_ECO_BINARY_SENSORS
from .definitions.wpu import WPU_BINARY_SENSORS


async def async_setup_entry(
Expand All @@ -44,21 +43,28 @@ async def async_setup_entry(
return

sensors = []
if config_entry.data[CONF_ADDON_TYPE] == "autotemp":
for description in AUTOTEMPBINARYSENSORS:
description.key = (
f"{MQTT_BASETOPIC["autotemp"]}/{MQTT_STATETOPIC["autotemp"]}"
)
if config_entry.data[CONF_ADDON_TYPE] == "cve":
for description in CVE_BINARY_SENSORS:
description.topic = f"{MQTT_BASETOPIC["cve"]}/{MQTT_STATETOPIC["cve"]}"
sensors.append(IthoBinarySensor(description, config_entry))

if config_entry.data[CONF_ADDON_TYPE] == "noncve":
if config_entry.data[CONF_ADDON_TYPE] == "noncve" and config_entry.data[
CONF_NONCVE_MODEL
] in ["hru_eco", "hru_eco_350"]:
if config_entry.data[CONF_NONCVE_MODEL] == "hru_eco":
hru_sensors = HRUECOBINARYSENSORS
hru_sensors = HRU_ECO_BINARY_SENSORS
if config_entry.data[CONF_NONCVE_MODEL] == "hru_eco_350":
hru_sensors = HRUECO350BINARYSENSORS
hru_sensors = HRU_ECO_350_BINARY_SENSORS

for description in hru_sensors:
description.key = f"{MQTT_BASETOPIC["noncve"]}/{MQTT_STATETOPIC["noncve"]}"
description.topic = (
f"{MQTT_BASETOPIC["noncve"]}/{MQTT_STATETOPIC["noncve"]}"
)
sensors.append(IthoBinarySensor(description, config_entry))

if config_entry.data[CONF_ADDON_TYPE] == "wpu":
for description in WPU_BINARY_SENSORS:
description.topic = f"{MQTT_BASETOPIC["wpu"]}/{MQTT_STATETOPIC["wpu"]}"
sensors.append(IthoBinarySensor(description, config_entry))

async_add_entities(sensors)
Expand All @@ -77,19 +83,22 @@ def __init__(
) -> None:
"""Initialize the binary sensor."""
self.entity_description = description
self.entity_description.translation_key = self.entity_description.key

model = ADDON_TYPES[config_entry.data[CONF_ADDON_TYPE]]
if config_entry.data[CONF_ADDON_TYPE] == "noncve":
model = model + " - " + NONCVE_DEVICES[config_entry.data[CONF_NONCVE_MODEL]]
model = f"{model} - {NONCVE_DEVICES[config_entry.data[CONF_NONCVE_MODEL]]}"

self._attr_device_info = DeviceInfo(
identifiers={(DOMAIN, config_entry.data[CONF_ADDON_TYPE])},
manufacturer=MANUFACTURER,
model=model,
name="Itho Daalderop " + ADDON_TYPES[config_entry.data[CONF_ADDON_TYPE]],
name=f"Itho Daalderop {ADDON_TYPES[config_entry.data[CONF_ADDON_TYPE]]}",
)

self._attr_unique_id = f"itho_{ADDON_TYPES[config_entry.data[CONF_ADDON_TYPE]]}_{description.translation_key}"
self._attr_unique_id = (
f"itho_{ADDON_TYPES[config_entry.data[CONF_ADDON_TYPE]]}_{description.key}"
)
self.entity_id = f"binary_sensor.{self._attr_unique_id}"

@property
Expand Down Expand Up @@ -123,5 +132,5 @@ def message_received(message):
self.async_write_ha_state()

await mqtt.async_subscribe(
self.hass, self.entity_description.key, message_received, 1
self.hass, self.entity_description.topic, message_received, 1
)
6 changes: 2 additions & 4 deletions custom_components/ithodaalderop/config_flow.py
Original file line number Diff line number Diff line change
Expand Up @@ -66,8 +66,7 @@ async def async_step_user(self, user_input: Mapping[str, Any] | None = None):
)
self._abort_if_unique_id_configured()
return self.async_create_entry(
title="Itho WiFi Add-on for "
+ ADDON_TYPES[self.config[CONF_ADDON_TYPE]],
title=f"Itho WiFi Add-on for {ADDON_TYPES[self.config[CONF_ADDON_TYPE]]}",
data=user_input,
)

Expand Down Expand Up @@ -97,8 +96,7 @@ async def async_step_rooms(self, user_input: Mapping[str, Any] | None = None):
)
self._abort_if_unique_id_configured()
return self.async_create_entry(
title="Itho WiFi Add-on for "
+ ADDON_TYPES[self.config[CONF_ADDON_TYPE]],
title=f"Itho WiFi Add-on for {ADDON_TYPES[self.config[CONF_ADDON_TYPE]]}",
data=self.config,
)

Expand Down
10 changes: 5 additions & 5 deletions custom_components/ithodaalderop/const.py
Original file line number Diff line number Diff line change
Expand Up @@ -90,7 +90,7 @@
5: "Manual operation",
}

HRUECO250300_ERROR_CODE = {
HRU_ECO_250_300_ERROR_CODE = {
0: "No error",
1: "W01 - Clean Filter",
2: "W02 - Replace Filter",
Expand All @@ -103,7 +103,7 @@
101: "E01 - Fan is't working",
}

HRUECO350_ACTUAL_MODE = {
HRU_ECO_350_ACTUAL_MODE = {
1: "Low",
2: "Medium",
3: "High",
Expand All @@ -114,13 +114,13 @@

# Based on user-experience. No codelist availble in the Itho Servicetool
# For any additions/feedback, please create an issue in the repo of the integration
HRUECO350_GLOBAL_FAULT_CODE = {
HRU_ECO_350_GLOBAL_FAULT_CODE = {
0: "No error",
7: "Filters dirty",
11: "(External) Sensor error",
}

HRUECO350_RH_ERROR_CODE = {
HRU_ECO_350_RH_ERROR_CODE = {
239: "Not Available",
240: "Shorted Sensor",
241: "Open Sensor",
Expand All @@ -140,7 +140,7 @@
255: "Unknown Error",
}

HRUECO_STATUS = {
HRU_ECO_STATUS = {
0: "Normal",
1: "Adjust frost valve",
2: "Decelerate Supply fan",
Expand Down
Loading
Loading