Skip to content

Commit

Permalink
Merge pull request #50 from Tvalley71/dev
Browse files Browse the repository at this point in the history
Dev
  • Loading branch information
Tvalley71 authored Aug 13, 2024
2 parents c17586b + e70cfd6 commit 85a47e5
Show file tree
Hide file tree
Showing 12 changed files with 243 additions and 99 deletions.
50 changes: 34 additions & 16 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -11,7 +11,7 @@ Known supported units:
- RCV320 P1/P2

> [!NOTE]
> The listed units are known to have been tested with the integration. Basicly all unit that use the _Dantherm Residential_ app ought to work with the integration.
> The listed units are known to have been used with the integration. Basicly all units that use the _Dantherm Residential_ app ought to work with the integration
> ([Google Play](https://play.google.com/store/apps/details?id=com.dantherm.ventilation) or [Apple Store](https://apps.apple.com/dk/app/dantherm-residential/id1368468353)).
> If you know of any not included in the list, please feel free to contact me [here](https://github.com/Tvalley71/dantherm/discussions/new?category=general).
Expand All @@ -27,8 +27,8 @@ Known supported units:
| operation_mode | Operation mode sensor |
| alarm | Alarm sensor |
| fan_level | Fan level sensor |
| fan1_speed | Fan 1 speed sensor |
| fan2_speed | Fan 2 speed sensor |
| fan1_speed | Fan 1 speed sensor<sup>&dagger;<sup> |
| fan2_speed | Fan 2 speed sensor<sup>&dagger;<sup> |
| humidity | Humidity sensor<sup>\*<sup> |
| air_quality | Air quality sensor<sup>\*<sup> |
| exhaust_temperature | Exhaust temperature sensor |
Expand All @@ -54,7 +54,7 @@ _&dagger; The entity is disabled by default._
### Installation

> [!IMPORTANT]
> Installation directly through HACS is not yet available because the integration is not yet included. This process will take some time. In the meantime, please use the manual installation method or click the below **Open HACS Repository** button.
> Installation directly through HACS is not yet available because the integration is not yet official included into HACS. This process will take some time. In the meantime, please use the manual installation method or click the below **Open HACS Repository** button.
<a href="https://my.home-assistant.io/redirect/hacs_repository/?owner=Tvalley71&repository=Dantherm&category=Integration"><img src="https://my.home-assistant.io/badges/hacs_repository.svg" alt="Open your Home Assistant instance and open a repository inside the Home Assistant Community Store." width="" height=""></a>

Expand Down Expand Up @@ -86,8 +86,9 @@ After installation, add the Dantherm integration to your Home Assistant configur
3. Search for "Dantherm" and select it from the list of available integrations.
4. Follow the on-screen instructions to complete the integration setup.

![Skærmbillede 2024-05-04 090018](https://github.com/Tvalley71/dantherm/assets/83084467/f085a769-c55c-45f1-952e-6ee8884eaad1)
![Skærmbillede 2024-05-04 090125](https://github.com/Tvalley71/dantherm/assets/83084467/1a66e37c-3c0e-498d-995f-c2bb5c778f35)
![Skærmbillede 2024-05-04 090018](https://github.com/user-attachments/assets/a5c2faad-2b96-438b-a761-4e24075efbf3)
![Skærmbillede 2024-05-04 090125](https://github.com/user-attachments/assets/7869346c-04e0-4980-9536-bf2cdd27cbc0)


### Support

Expand All @@ -96,14 +97,19 @@ If you encounter any issues or have questions regarding the Dantherm integration

### Screenshots

![Skærmbillede 2024-05-04 090219](https://github.com/Tvalley71/dantherm/assets/83084467/fa9b31b6-5ec8-4c3b-a381-ef7061495560)
![Skærmbillede 2024-05-04 090219](https://github.com/user-attachments/assets/e8750622-f33c-4652-b3d5-33c2f3f13c54)

![Skærmbillede 2024-08-04 084300](https://github.com/user-attachments/assets/1f1ce55b-4a9a-4b4c-b09d-4e18e34a08a2)
![Skærmbillede 2024-08-04 084328](https://github.com/user-attachments/assets/cb4c686b-ed84-42f2-896e-6c5f0b126f52)

![Skærmbillede 2024-08-04 084347](https://github.com/user-attachments/assets/6ecca514-7595-4b64-8e1d-1e1fffa5aae4)
![Skærmbillede 2024-08-04 084404](https://github.com/user-attachments/assets/b84b9ac7-3586-40da-9a74-2808ced478e2)

![Skærmbillede 2024-08-04 084430](https://github.com/user-attachments/assets/814bafd5-e03f-496f-98ce-7faafe2e4729)

![Skærmbillede 2024-05-13 070737](https://github.com/Tvalley71/dantherm/assets/83084467/d6493c4e-ab10-493d-b2ec-c4f192383192)
![Skærmbillede 2024-05-13 070838](https://github.com/Tvalley71/dantherm/assets/83084467/8032983f-f55e-425e-8c55-c8d2ae918ea7)
![Skærmbillede 2024-05-04 090422](https://github.com/Tvalley71/dantherm/assets/83084467/4b2665b1-6abe-491b-8c3b-e5b3322402ee)

> [!NOTE]
> Preheater and HAC module functions are currently unsupported due to limited testing possibilities. If support for these functions are desired, please contact me for potential collaborative efforts to provide the support.
> The HAC module functions are currently unsupported due to limited testing possibilities. If support for these functions are desired, please contact me for potential collaborative efforts to provide the support.
### Languages

Expand Down Expand Up @@ -261,35 +267,37 @@ Next, insert the following code into your dashboard. If your Home Assistant setu
top: 45%
left: 36%
font-weight: bold
text-align: center;
font-style: italic
text-align: center
font-size: 100%
- type: state-label
entity: sensor.dantherm_humidity
style:
top: 29%
left: 38%
font-size: 125%
font-size: 100%
- type: state-label
entity: select.dantherm_fan_selection
style:
top: 29%
left: 63%
font-weight: bold
font-style: italic
font-size: 100%

```

#### Helper template sensor.

![Skærmbillede 2024-05-04 094747](https://github.com/Tvalley71/dantherm/assets/83084467/49b4e3b5-e419-458d-ada8-ffc3a92e0395)
![Skærmbillede 2024-05-04 094747](https://github.com/user-attachments/assets/5fc0c6dc-a1e5-4579-8453-7837037b3f9a)

</details>

#### Mushroom-chips card

Example of a Mushroom-chips card displaying the current state of operation and fan level, in the order automatic, week program, manual, and standby mode.
An example of a Mushroom-chips card showing the current state of operation and fan level in a single display. This can also be achieved with many of the other entities.

![Skærmbillede 2024-05-21 104804](https://github.com/Tvalley71/dantherm/assets/83084467/075df325-03e1-4855-bb74-a4cf90780266)
![Skærmbillede 2024-05-21 104804](https://github.com/user-attachments/assets/2e35c5f9-46cf-4a77-a13c-56992ecccf3e)

<details>

Expand Down Expand Up @@ -348,6 +356,16 @@ Alert chip displaying any current alert along with its descriptions. A hold acti

</details>

> [!NOTE]
> Starting from version 2024.8 of Home Assistant, the new badges can be used to achieve same results as the Mushroom chips card.
#### Dashboard Badges

Here are some examples of badges added to the dashboard. The pop-up that appears when clicking on a badge will vary depending on the selected entities, either displaying information or enabling manipulation of the Dantherm unit.

![Skærmbillede badge example](https://github.com/user-attachments/assets/77ae39a9-edb2-4648-bb88-feac6a997087)


## Disclaimer

The trademark "Dantherm" is owned by Dantherm Group A/S, a leading supplier of climate control solutions.
Expand Down
5 changes: 2 additions & 3 deletions custom_components/dantherm/__init__.py
Original file line number Diff line number Diff line change
Expand Up @@ -66,9 +66,8 @@ async def async_setup_entry(hass: HomeAssistant, entry: ConfigEntry):
raise ConfigEntryNotReady(f"Timeout while connecting {host}") from ex
hass.data[DOMAIN][entry.entry_id] = device

hass.async_create_task(
hass.config_entries.async_forward_entry_setups(entry, PLATFORMS)
)
await hass.config_entries.async_forward_entry_setups(entry, PLATFORMS)

return True


Expand Down
70 changes: 48 additions & 22 deletions custom_components/dantherm/const.py
Original file line number Diff line number Diff line change
Expand Up @@ -82,8 +82,8 @@ class DataClass(Enum):
Float32 = 8


class OpMode(int):
"""Dantherm mode of operation class."""
class CurrentUnitMode(int):
"""Dantherm current unit mode class."""

Standby = 0
Manual = 1
Expand All @@ -95,13 +95,37 @@ class OpMode(int):
Night = 16


class ActiveUnitMode(int):
"""Dantherm active unit mode class."""

Automatic = 0x0002
Manuel = 0x0004
WeekProgram = 0x0008

Away = StartAway = 0x0010
EndAway = 0x8010

Night = NightEnable = 0x0020
NightDisable = 0x8020

Fireplace = StartFireplace = 0x0040
EndFireplace = 0x8040

ManuelBypass = SelectManuelBypass = 0x0080
DeselectManuelBypass = 0x8080

Summer = StartSummer = 0x0800
EndSummer = 0x8800


STATE_STANDBY: Final = "standby"
STATE_AUTOMATIC: Final = "automatic"
STATE_MANUAL: Final = "manual"
STATE_WEEKPROGRAM: Final = "week_program"
STATE_AWAY: Final = "away"
STATE_SUMMER: Final = "summer"
STATE_FIREPLACE: Final = "fireplace"
STATE_NIGHT: Final = "night"


class BypassDamperState(int):
Expand Down Expand Up @@ -202,6 +226,7 @@ class DanthermSelectEntityDescription(SelectEntityDescription):
class DanthermSensorEntityDescription(SensorEntityDescription):
"""Dantherm Sensor Entity Description."""

icon_zero: str | None = None
data_address: int | None = None
data_getinternal: str | None = None
data_precision: int | None = None
Expand All @@ -210,7 +235,6 @@ class DanthermSensorEntityDescription(SensorEntityDescription):
data_exclude_if_above: int | None = None
data_exclude_if_below: int | None = None
data_entity: str | None = None
data_zero_icon: str | None = None
data_class: DataClass = DataClass.UInt16

component_class: ComponentClass = None
Expand Down Expand Up @@ -302,6 +326,7 @@ class DanthermSwitchEntityDescription(SwitchEntityDescription):
"away",
"summer",
"fireplace",
"night",
],
),
DanthermSelectEntityDescription(
Expand Down Expand Up @@ -330,8 +355,8 @@ class DanthermSwitchEntityDescription(SwitchEntityDescription):
DanthermSensorEntityDescription(
key="alarm",
icon="mdi:alert-circle-outline",
icon_zero="mdi:alert-circle-check-outline",
data_getinternal="get_alarm",
data_zero_icon="mdi:alert-circle-check-outline",
),
DanthermSensorEntityDescription(
key="fan_level",
Expand All @@ -340,22 +365,26 @@ class DanthermSwitchEntityDescription(SwitchEntityDescription):
DanthermSensorEntityDescription(
key="fan1_speed",
icon="mdi:fan",
icon_zero="mdi:fan-off",
data_class=DataClass.Float32,
data_address=100,
data_zero_icon="mdi:fan-off",
native_unit_of_measurement="rpm",
data_precision=0,
state_class=SensorStateClass.MEASUREMENT,
entity_registry_visible_default=True,
entity_registry_enabled_default=False,
),
DanthermSensorEntityDescription(
key="fan2_speed",
icon="mdi:fan",
icon_zero="mdi:fan-off",
data_class=DataClass.Float32,
data_address=102,
data_zero_icon="mdi:fan-off",
native_unit_of_measurement="rpm",
data_precision=0,
state_class=SensorStateClass.MEASUREMENT,
entity_registry_visible_default=True,
entity_registry_enabled_default=False,
),
DanthermSensorEntityDescription(
key="humidity",
Expand Down Expand Up @@ -466,12 +495,11 @@ class DanthermSwitchEntityDescription(SwitchEntityDescription):
DanthermSwitchEntityDescription(
key="away_mode",
data_setinternal="set_active_unit_mode",
state_seton=0x10,
state_setoff=0x8010,
data_getinternal="get_current_unit_mode",
state_on=OpMode.Away,
data_getinternal="get_away_mode",
state_suspend_for=30,
state_on=ActiveUnitMode.StartAway,
icon_on="mdi:bag-suitcase-outline",
state_off=ActiveUnitMode.EndAway,
icon_off="mdi:bag-suitcase-off-outline",
device_class=SwitchDeviceClass.SWITCH,
),
Expand All @@ -480,22 +508,21 @@ class DanthermSwitchEntityDescription(SwitchEntityDescription):
data_setinternal="set_active_unit_mode",
data_getinternal="get_active_unit_mode",
state_suspend_for=30,
state_on=0x20,
state_on=ActiveUnitMode.NightEnable,
icon_on="mdi:sleep",
state_off=0x8020,
state_off=ActiveUnitMode.NightDisable,
icon_off="mdi:sleep-off",
device_class=SwitchDeviceClass.SWITCH,
entity_category=EntityCategory.CONFIG,
),
DanthermSwitchEntityDescription(
key="fireplace_mode",
data_setinternal="set_active_unit_mode",
state_seton=0x40,
state_setoff=0x8040,
data_getinternal="get_current_unit_mode",
state_on=OpMode.Fireplace,
data_getinternal="get_fireplace_mode",
state_suspend_for=30,
state_seton=ActiveUnitMode.StartFireplace,
icon_on="mdi:fireplace",
state_setoff=ActiveUnitMode.EndFireplace,
icon_off="mdi:fireplace-off",
device_class=SwitchDeviceClass.SWITCH,
),
Expand All @@ -504,22 +531,21 @@ class DanthermSwitchEntityDescription(SwitchEntityDescription):
data_setinternal="set_active_unit_mode",
data_getinternal="get_active_unit_mode",
state_suspend_for=30,
state_on=0x80,
state_on=ActiveUnitMode.SelectManuelBypass,
icon_on="mdi:hand-back-right-outline",
state_off=0x8080,
state_off=ActiveUnitMode.DeselectManuelBypass,
icon_off="mdi:hand-back-right-off-outline",
component_class=ComponentClass.Bypass,
device_class=SwitchDeviceClass.SWITCH,
),
DanthermSwitchEntityDescription(
key="summer_mode",
data_setinternal="set_active_unit_mode",
state_seton=0x800,
state_setoff=0x8800,
data_getinternal="get_current_unit_mode",
state_on=OpMode.Summer,
data_getinternal="get_summer_mode",
state_suspend_for=30,
state_seton=ActiveUnitMode.StartSummer,
icon_on="mdi:weather-sunny",
state_setoff=ActiveUnitMode.EndSummer,
icon_off="mdi:weather-sunny-off",
device_class=SwitchDeviceClass.SWITCH,
),
Expand Down
3 changes: 1 addition & 2 deletions custom_components/dantherm/cover.py
Original file line number Diff line number Diff line change
@@ -1,6 +1,5 @@
"""Cover implementation."""

from datetime import datetime
import logging
from typing import Any

Expand Down Expand Up @@ -114,7 +113,7 @@ def native_value(self):

return self._device.data.get(self.key, None)

async def async_update(self, now: datetime | None = None) -> None:
async def async_update(self) -> None:
"""Update the state of the cover."""

if self.entity_description.data_getinternal:
Expand Down
Loading

0 comments on commit 85a47e5

Please sign in to comment.