diff --git a/README.md b/README.md index 67065ef..e5e4f34 100644 --- a/README.md +++ b/README.md @@ -14,9 +14,10 @@ Home Assistant integration for [Haier's mobile app hOn](https://hon-smarthome.co - [Dish Washer](https://github.com/Andre0512/hon#dish-washer) - [Air conditioner](https://github.com/Andre0512/hon#air-conditioner) - [Fridge](https://github.com/Andre0512/hon#fridge) -- [Hob](https://github.com/Andre0512/hon#hob) [BETA] +- [Induction Hob](https://github.com/Andre0512/hon#induction-hob) [BETA] - [Hood](https://github.com/Andre0512/hon#hood) [BETA] - [Wine Cellar](https://github.com/Andre0512/hon#wine-cellar) [BETA] +- [Air Purifier](https://github.com/Andre0512/hon#air-purifier) [BETA] ## Installation **Method 1:** [![Open your Home Assistant instance and open a repository inside the Home Assistant Community Store.](https://my.home-assistant.io/badges/hacs_repository.svg)](https://my.home-assistant.io/redirect/hacs_repository/?owner=Andre0512&repository=hon&category=integration) @@ -37,18 +38,18 @@ _If the integration is not in the list, you need to clear the browser cache._ ## Supported Models Support has been confirmed for these models, but many more will work. Please add already supported devices [with this form to complete the list](https://forms.gle/bTSD8qFotdZFytbf8). -| | **Haier** | **Hoover** | **Candy** | -|---------------------|----------------------------------------------------------------------------------------------------------------------------------------------------|-----------------------------------------------------------------------------------------------------------------------|----------------------------------------------------------------------------------| -| **Washing Machine** | HW90-B14TEAM5
HW100-B14959U1 | H-WASH 500
H7W4 48MBC-S | CO4 107T1/2-07
RO44 1286DWMC4-07
HW 68AMC/1-80
HWPD 69AMBC/1-S | -| **Tumble Dryer** | HD80-A3959 | H-DRY 500
H9A3TCBEXS-S
HLE C10DCE-80
NDE H10A2TCE-80
NDE H9A2TSBEXS-S
NDPHY10A2TCBEXSS | BCTDH7A1TE
CSOE C10DE-80
ROE H9A3TCEX-S | -| **Washer Dryer** | HWD100-B14979 | HWPS4954DAMR-11 | RPW41066BWMR/1-S | -| **Oven** | HWO60SM2F3XH | HSOT3161WG | | -| **Dish Washer** | XIB 3B2SFS-80
XIB 6B2D3FB | HFB 6B2S3FX | | -| **Air conditioner** | AD105S2SM3FA
AS20HPL1HRA
AS25PBAHRA
AS25S2SF1FA-WH
AS25TADHRA-2
AS35S2SF2FA-3
AS35TADHRA-2
AS35TAMHRA-C | | | -| **Fridge** | HFW7720ENMB | | CCE4T620EWU | -| **Hob** | HA2MTSJ68MC | | CIS633SCTTWIFI | -| **Hood** | HADG6DS46BWIFI | | | -| **Wine Cellar** | HWS247FDU1 | | | +| | **Haier** | **Hoover** | **Candy** | +|---------------------|----------------------------------------------------------------------------------------------------------------------------------------------------|-----------------------------------------------------------------------------------------------------------------------|-----------------------------------------------------------------------------------------------------| +| **Washing Machine** | HW90-B14TEAM5
HW100-B14959U1 | H-WASH 500
H7W4 48MBC-S | CO4 107T1/2-07
CBWO49TWME-S
RO44 1286DWMC4-07
HW 68AMC/1-80
HWPD 69AMBC/1-S | +| **Tumble Dryer** | HD80-A3959 | H-DRY 500
H9A3TCBEXS-S
HLE C10DCE-80
NDE H10A2TCE-80
NDE H9A2TSBEXS-S
NDPHY10A2TCBEXSS | BCTDH7A1TE
CSOE C10DE-80
ROE H9A3TCEX-S | +| **Washer Dryer** | HWD100-B14979 | HWPS4954DAMR-11 | RPW41066BWMR/1-S | +| **Oven** | HWO60SM2F3XH | HSOT3161WG | | +| **Dish Washer** | XIB 3B2SFS-80
XIB 6B2D3FB | HFB 6B2S3FX | | +| **Air Conditioner** | AD105S2SM3FA
AS20HPL1HRA
AS25PBAHRA
AS25S2SF1FA-WH
AS25TADHRA-2
AS35S2SF2FA-3
AS35TADHRA-2
AS35TAMHRA-C | | | +| **Fridge** | HFW7720ENMB | | CCE4T620EWU | +| **Hob** | HA2MTSJ68MC | | CIS633SCTTWIFI | +| **Hood** | HADG6DS46BWIFI | | | +| **Wine Cellar** | HWS247FDU1 | | | ## Supported Languages Translation of internal names like programs are available for all languages which are official supported by the hOn app: @@ -137,7 +138,7 @@ For every device exists a hidden button which can be used to log all infos of yo ## Appliance Features -### Air conditioner +### Air Conditioner #### Controls | Name | Icon | Entity | Key | | --- | --- | --- | --- | @@ -171,7 +172,36 @@ For every device exists a hidden button which can be used to log all infos of yo | Program | `play` | `sensor` | `programName` | | Selected Temperature | `thermometer` | `sensor` | `tempSel` | -### Dish washer +### Air Purifier +#### Controls +| Name | Icon | Entity | Key | +| --- | --- | --- | --- | +| Aroma Time Off | `thermometer` | `number` | `settings.aromaTimeOff` | +| Aroma Time On | `thermometer` | `number` | `settings.aromaTimeOn` | +| Diffuser Level | | `select` | `settings.aromaStatus` | +| Light status | `lightbulb` | `number` | `settings.lightStatus` | +| Lock Status | | `switch` | `lockStatus` | +| Mode | `run` | `select` | `settings.machMode` | +| Pollen Level | | `number` | `settings.pollenLevel` | +| Touch Tone | | `switch` | `touchToneStatus` | +#### Sensors +| Name | Icon | Entity | Key | +| --- | --- | --- | --- | +| Air Quality | | `sensor` | `airQuality` | +| CO Level | | `sensor` | `coLevel` | +| Error | `math-log` | `sensor` | `errors` | +| Humidity | | `sensor` | `humidityIndoor` | +| Main Filter Status | | `sensor` | `mainFilterStatus` | +| On | `power-cycle` | `binary_sensor` | `attributes.parameters.onOffStatus` | +| Pre Filter Status | | `sensor` | `preFilterStatus` | +| Temperature | | `sensor` | `temp` | +| Total Work Time | | `sensor` | `totalWorkTime` | +| VOC | | `sensor` | `vocValueIndoor` | +| Wind Speed | | `sensor` | `windSpeed` | +| pm10 | | `sensor` | `pm10ValueIndoor` | +| pm2p5 | | `sensor` | `pm2p5ValueIndoor` | + +### Dish Washer #### Controls | Name | Icon | Entity | Key | | --- | --- | --- | --- | @@ -217,10 +247,6 @@ For every device exists a hidden button which can be used to log all infos of yo | Start Program | `hvac` | `button` | `startProgram` | | Stop Program | `hvac-off` | `button` | `stopProgram` | | Wind Speed | | `fan` | `settings.windSpeed` | -#### Configs -| Name | Icon | Entity | Key | -| --- | --- | --- | --- | -| Light status | `lightbulb` | `number` | `startProgram.lightStatus` | #### Sensors | Name | Icon | Entity | Key | | --- | --- | --- | --- | @@ -231,13 +257,14 @@ For every device exists a hidden button which can be used to log all infos of yo | Filter Cleaning Status | | `sensor` | `filterCleaningStatus` | | Last Work Time | `clock-start` | `sensor` | `lastWorkTime` | | Light Status | `lightbulb` | `sensor` | `lightStatus` | +| Light status | `lightbulb` | `number` | `startProgram.lightStatus` | | Mach Mode | | `sensor` | `machMode` | | On / Off Status | `lightbulb` | `sensor` | `onOffStatus` | | Quick Delay Time Status | | `sensor` | `quickDelayTimeStatus` | | RGB Light Color | `lightbulb` | `sensor` | `rgbLightColors` | | RGB Light Status | `lightbulb` | `sensor` | `rgbLightStatus` | -### Hob +### Induction Hob #### Controls | Name | Icon | Entity | Key | | --- | --- | --- | --- | @@ -321,7 +348,7 @@ For every device exists a hidden button which can be used to log all infos of yo | Temperature Freezer | `snowflake-thermometer` | `sensor` | `tempZ2` | | Temperature Fridge | `thermometer` | `sensor` | `tempZ1` | -### Tumble dryer +### Tumble Dryer #### Controls | Name | Icon | Entity | Key | | --- | --- | --- | --- | @@ -380,7 +407,7 @@ For every device exists a hidden button which can be used to log all infos of yo | Temperature | `thermometer` | `sensor` | `temp` | | Temperature 2 | `thermometer` | `sensor` | `tempZ2` | -### Washer dryer +### Washer Dryer #### Controls | Name | Icon | Entity | Key | | --- | --- | --- | --- | @@ -455,7 +482,7 @@ For every device exists a hidden button which can be used to log all infos of yo | Total Wash Cycle | `counter` | `sensor` | `totalWashCycle` | | Total Water | | `sensor` | `totalWaterUsed` | -### Washing machine +### Washing Machine #### Controls | Name | Icon | Entity | Key | | --- | --- | --- | --- | diff --git a/custom_components/hon/binary_sensor.py b/custom_components/hon/binary_sensor.py index c30e02d..2ff945f 100644 --- a/custom_components/hon/binary_sensor.py +++ b/custom_components/hon/binary_sensor.py @@ -242,6 +242,16 @@ BINARY_SENSORS: dict[str, tuple[HonBinarySensorEntityDescription, ...]] = { translation_key="holiday_mode", ), ), + "AP": ( + HonBinarySensorEntityDescription( + key="attributes.parameters.onOffStatus", + name="On", + device_class=BinarySensorDeviceClass.RUNNING, + on_value="1", + icon="mdi:power-cycle", + translation_key="on", + ), + ), } diff --git a/custom_components/hon/const.py b/custom_components/hon/const.py index 9290eaa..bf2f85e 100644 --- a/custom_components/hon/const.py +++ b/custom_components/hon/const.py @@ -188,3 +188,18 @@ AC_HUMAN_SENSE = { "2": "follow_touch", "3": "unknown", } + +AP_MACH_MODE = { + "0": "standby", + "1": "sleep", + "2": "auto", + "3": "allergens", + "4": "max", +} + +AP_DIFFUSER_LEVEL = { + "1": "soft", + "2": "mid", + "3": "h_biotics", + "4": "custom", +} diff --git a/custom_components/hon/number.py b/custom_components/hon/number.py index 43f3761..bec5c17 100644 --- a/custom_components/hon/number.py +++ b/custom_components/hon/number.py @@ -167,7 +167,29 @@ NUMBERS: dict[str, tuple[NumberEntityDescription, ...]] = { key="startProgram.lightStatus", name="Light status", icon="mdi:lightbulb", - entity_category=EntityCategory.CONFIG, + ), + ), + "AP": ( + HonNumberEntityDescription( + key="settings.aromaTimeOn", + name="Aroma Time On", + icon="mdi:thermometer", + native_unit_of_measurement=UnitOfTime.SECONDS, + ), + HonNumberEntityDescription( + key="settings.aromaTimeOff", + name="Aroma Time Off", + icon="mdi:thermometer", + native_unit_of_measurement=UnitOfTime.SECONDS, + ), + HonNumberEntityDescription( + key="settings.lightStatus", + name="Light status", + icon="mdi:lightbulb", + ), + HonNumberEntityDescription( + key="settings.pollenLevel", + name="Pollen Level", ), ), } @@ -206,7 +228,7 @@ class HonNumberEntity(HonEntity, NumberEntity): @property def native_value(self) -> float | None: - return self._device.get(self.entity_description.key) + return self._device.get(self.entity_description.key.split(".")[-1]) async def async_set_native_value(self, value: float) -> None: setting = self._device.settings[self.entity_description.key] @@ -223,7 +245,7 @@ class HonNumberEntity(HonEntity, NumberEntity): self._attr_native_max_value = setting.max self._attr_native_min_value = setting.min self._attr_native_step = setting.step - self._attr_native_value = setting.value + self._attr_native_value = self.native_value if update: self.async_write_ha_state() diff --git a/custom_components/hon/select.py b/custom_components/hon/select.py index 2bee890..046630c 100644 --- a/custom_components/hon/select.py +++ b/custom_components/hon/select.py @@ -133,6 +133,19 @@ SELECTS = { translation_key="ref_zones", ), ), + "AP": ( + HonSelectEntityDescription( + key="settings.aromaStatus", + name="Diffuser Level", + option_list=const.AP_DIFFUSER_LEVEL, + ), + HonSelectEntityDescription( + key="settings.machMode", + name="Mode", + icon="mdi:run", + option_list=const.AP_MACH_MODE, + ), + ), } SELECTS["WD"] = unique_entities(SELECTS["WM"], SELECTS["TD"]) diff --git a/custom_components/hon/sensor.py b/custom_components/hon/sensor.py index 0286811..7582db5 100644 --- a/custom_components/hon/sensor.py +++ b/custom_components/hon/sensor.py @@ -9,7 +9,12 @@ from homeassistant.components.sensor import ( SensorEntityDescription, ) from homeassistant.config_entries import ConfigEntry -from homeassistant.const import PERCENTAGE +from homeassistant.const import ( + PERCENTAGE, + CONCENTRATION_MICROGRAMS_PER_CUBIC_METER, + CONCENTRATION_PARTS_PER_BILLION, + CONCENTRATION_PARTS_PER_MILLION, +) from homeassistant.const import ( REVOLUTIONS_PER_MINUTE, UnitOfEnergy, @@ -637,6 +642,7 @@ SENSORS: dict[str, tuple[SensorEntityDescription, ...]] = { name="Temperature", icon="mdi:thermometer", state_class=SensorStateClass.MEASUREMENT, + device_class=SensorDeviceClass.TEMPERATURE, native_unit_of_measurement=UnitOfTemperature.CELSIUS, translation_key="temperature", ), @@ -673,6 +679,7 @@ SENSORS: dict[str, tuple[SensorEntityDescription, ...]] = { icon="mdi:thermometer", state_class=SensorStateClass.MEASUREMENT, native_unit_of_measurement=UnitOfTemperature.CELSIUS, + device_class=SensorDeviceClass.TEMPERATURE, translation_key="temperature", ), HonSensorEntityDescription( @@ -683,6 +690,76 @@ SENSORS: dict[str, tuple[SensorEntityDescription, ...]] = { translation_key="programs_wc", ), ), + "AP": ( + HonSensorEntityDescription( + key="errors", name="Error", icon="mdi:math-log", translation_key="errors" + ), + HonSensorEntityDescription( + key="mainFilterStatus", + name="Main Filter Status", + native_unit_of_measurement=PERCENTAGE, + ), + HonSensorEntityDescription( + key="preFilterStatus", + name="Pre Filter Status", + native_unit_of_measurement=PERCENTAGE, + ), + HonSensorEntityDescription( + key="totalWorkTime", + name="Total Work Time", + native_unit_of_measurement=UnitOfTime.MINUTES, + device_class=SensorDeviceClass.DURATION, + ), + HonSensorEntityDescription( + key="coLevel", + name="CO Level", + state_class=SensorStateClass.MEASUREMENT, + device_class=SensorDeviceClass.CO, + native_unit_of_measurement=CONCENTRATION_PARTS_PER_MILLION, + ), + HonSensorEntityDescription( + key="pm10ValueIndoor", + name="pm10", + state_class=SensorStateClass.MEASUREMENT, + device_class=SensorDeviceClass.PM10, + native_unit_of_measurement=CONCENTRATION_MICROGRAMS_PER_CUBIC_METER, + ), + HonSensorEntityDescription( + key="pm2p5ValueIndoor", + name="pm2p5", + state_class=SensorStateClass.MEASUREMENT, + device_class=SensorDeviceClass.PM25, + native_unit_of_measurement=CONCENTRATION_MICROGRAMS_PER_CUBIC_METER, + ), + HonSensorEntityDescription( + key="vocValueIndoor", + name="VOC", + state_class=SensorStateClass.MEASUREMENT, + device_class=SensorDeviceClass.VOLATILE_ORGANIC_COMPOUNDS, + native_unit_of_measurement=CONCENTRATION_PARTS_PER_BILLION, + ), + HonSensorEntityDescription( + key="humidityIndoor", + name="Humidity", + state_class=SensorStateClass.MEASUREMENT, + device_class=SensorDeviceClass.HUMIDITY, + native_unit_of_measurement=PERCENTAGE, + translation_key="humidity", + ), + HonSensorEntityDescription( + key="temp", + name="Temperature", + state_class=SensorStateClass.MEASUREMENT, + device_class=SensorDeviceClass.TEMPERATURE, + native_unit_of_measurement=UnitOfTemperature.CELSIUS, + translation_key="temperature", + ), + HonSensorEntityDescription(key="windSpeed", name="Wind Speed"), + HonSensorEntityDescription( + key="airQuality", + name="Air Quality", + ), + ), } SENSORS["WD"] = unique_entities(SENSORS["WM"], SENSORS["TD"]) diff --git a/custom_components/hon/switch.py b/custom_components/hon/switch.py index 7351a08..fbd4b65 100644 --- a/custom_components/hon/switch.py +++ b/custom_components/hon/switch.py @@ -333,6 +333,16 @@ SWITCHES: dict[str, tuple[HonSwitchEntityDescription, ...]] = { key="lightStatus", name="Light", icon="mdi:lightbulb" ), ), + "AP": ( + HonSwitchEntityDescription( + key="touchToneStatus", + name="Touch Tone", + ), + HonSwitchEntityDescription( + key="lockStatus", + name="Lock Status", + ), + ), } SWITCHES["WD"] = unique_entities(SWITCHES["WD"], SWITCHES["WM"]) diff --git a/info.md b/info.md index 1972063..26f76b2 100644 --- a/info.md +++ b/info.md @@ -10,11 +10,12 @@ Support for home appliances of [Haier's mobile app hOn](https://hon-smarthome.co - [Washer Dryer](https://github.com/Andre0512/hon#washer-dryer) - [Oven](https://github.com/Andre0512/hon#oven) - [Dish Washer](https://github.com/Andre0512/hon#dish-washer) -- [Air conditioner](https://github.com/Andre0512/hon#air-conditioner) +- [Air Conditioner](https://github.com/Andre0512/hon#air-conditioner) - [Fridge](https://github.com/Andre0512/hon#fridge) -- [Hob](https://github.com/Andre0512/hon#hob) [BETA] +- [Induction Hob](https://github.com/Andre0512/hon#induction-hob) [BETA] - [Hood](https://github.com/Andre0512/hon#hood) [BETA] - [Wine Cellar](https://github.com/Andre0512/hon#wine-cellar) [BETA] +- [Air Purifier](https://github.com/Andre0512/hon#air-purifier) [BETA] ## Configuration @@ -26,18 +27,18 @@ _If the integration is not in the list, you need to clear the browser cache._ ## Supported Models Support has been confirmed for these models, but many more will work. Please add already supported devices [with this form to complete the list](https://forms.gle/bTSD8qFotdZFytbf8). -| | **Haier** | **Hoover** | **Candy** | -|---------------------|----------------------------------------------------------------------------------------------------------------------------------------------------|-----------------------------------------------------------------------------------------------------------------------|----------------------------------------------------------------------------------| -| **Washing Machine** | HW90-B14TEAM5
HW100-B14959U1 | H-WASH 500
H7W4 48MBC-S | CO4 107T1/2-07
RO44 1286DWMC4-07
HW 68AMC/1-80
HWPD 69AMBC/1-S | -| **Tumble Dryer** | HD80-A3959 | H-DRY 500
H9A3TCBEXS-S
HLE C10DCE-80
NDE H10A2TCE-80
NDE H9A2TSBEXS-S
NDPHY10A2TCBEXSS | BCTDH7A1TE
CSOE C10DE-80
ROE H9A3TCEX-S | -| **Washer Dryer** | HWD100-B14979 | HWPS4954DAMR-11 | RPW41066BWMR/1-S | -| **Oven** | HWO60SM2F3XH | HSOT3161WG | | -| **Dish Washer** | XIB 3B2SFS-80
XIB 6B2D3FB | HFB 6B2S3FX | | -| **Air conditioner** | AD105S2SM3FA
AS20HPL1HRA
AS25PBAHRA
AS25S2SF1FA-WH
AS25TADHRA-2
AS35S2SF2FA-3
AS35TADHRA-2
AS35TAMHRA-C | | | -| **Fridge** | HFW7720ENMB | | CCE4T620EWU | -| **Hob** | HA2MTSJ68MC | | CIS633SCTTWIFI | -| **Hood** | HADG6DS46BWIFI | | | -| **Wine Cellar** | HWS247FDU1 | | | +| | **Haier** | **Hoover** | **Candy** | +|---------------------|----------------------------------------------------------------------------------------------------------------------------------------------------|-----------------------------------------------------------------------------------------------------------------------|-----------------------------------------------------------------------------------------------------| +| **Washing Machine** | HW90-B14TEAM5
HW100-B14959U1 | H-WASH 500
H7W4 48MBC-S | CO4 107T1/2-07
CBWO49TWME-S
RO44 1286DWMC4-07
HW 68AMC/1-80
HWPD 69AMBC/1-S | +| **Tumble Dryer** | HD80-A3959 | H-DRY 500
H9A3TCBEXS-S
HLE C10DCE-80
NDE H10A2TCE-80
NDE H9A2TSBEXS-S
NDPHY10A2TCBEXSS | BCTDH7A1TE
CSOE C10DE-80
ROE H9A3TCEX-S | +| **Washer Dryer** | HWD100-B14979 | HWPS4954DAMR-11 | RPW41066BWMR/1-S | +| **Oven** | HWO60SM2F3XH | HSOT3161WG | | +| **Dish Washer** | XIB 3B2SFS-80
XIB 6B2D3FB | HFB 6B2S3FX | | +| **Air Conditioner** | AD105S2SM3FA
AS20HPL1HRA
AS25PBAHRA
AS25S2SF1FA-WH
AS25TADHRA-2
AS35S2SF2FA-3
AS35TADHRA-2
AS35TAMHRA-C | | | +| **Fridge** | HFW7720ENMB | | CCE4T620EWU | +| **Hob** | HA2MTSJ68MC | | CIS633SCTTWIFI | +| **Hood** | HADG6DS46BWIFI | | | +| **Wine Cellar** | HWS247FDU1 | | | ## Supported Languages Translation of internal names like programs are available for all languages which are official supported by the hOn app: diff --git a/scripts/sensor_docs.py b/scripts/sensor_docs.py index e009186..ddc32b8 100755 --- a/scripts/sensor_docs.py +++ b/scripts/sensor_docs.py @@ -22,21 +22,21 @@ from custom_components.hon.switch import ( ) APPLIANCES = { - "AC": "Air conditioner", - "AP": "Air purifier", - "AS": "Air scanner", - "DW": "Dish washer", + "AC": "Air Conditioner", + "AP": "Air Purifier", + "AS": "Air Scanner", + "DW": "Dish Washer", "HO": "Hood", - "IH": "Hob", + "IH": "Induction Hob", "MW": "Microwave", "OV": "Oven", "REF": "Fridge", - "RVC": "Robot vacuum cleaner", - "TD": "Tumble dryer", + "RVC": "Robot Vacuum Cleaner", + "TD": "Tumble Dryer", "WC": "Wine Cellar", - "WD": "Washer dryer", + "WD": "Washer Dryer", "WH": "Water Heater", - "WM": "Washing machine", + "WM": "Washing Machine", } ENTITY_CATEGORY_SORT = ["control", "config", "sensor"]