Compare commits
15 Commits
v0.6.0-bet
...
v0.6.1
Author | SHA1 | Date | |
---|---|---|---|
2c6def8f57 | |||
b723744948 | |||
e0081bf75e | |||
554ce1d7ff | |||
256c691213 | |||
7fb68be033 | |||
72c83527d5 | |||
75622e18a2 | |||
a2d0257410 | |||
e2c7ca36db | |||
b33b6a40b2 | |||
75859543aa | |||
891ae51832 | |||
5dbf508519 | |||
7d3813b8fd |
40
README.md
40
README.md
@ -1,8 +1,8 @@
|
||||
# Haier hOn
|
||||
[](https://hacs.xyz)
|
||||
[](https://github.com/Andre0512/hon/releases/latest)
|
||||

|
||||
[](https://analytics.home-assistant.io/)
|
||||
[](https://github.com/Andre0512/hon/blob/main/LICENSE)
|
||||
[](https://tooomm.github.io/github-release-stats/?username=Andre0512&repository=hon)
|
||||
Home Assistant integration for Haier hOn: support for Haier/Candy/Hoover home appliances like washing machines.
|
||||
|
||||
## Supported Appliances
|
||||
@ -98,6 +98,9 @@ For every device exists a hidden button which can be used to log all info of you
|
||||
- Haier HD80-A3959
|
||||
- Haier HWO60SM2F3XH
|
||||
- Hoover H-WASH 500
|
||||
- Candy CIS633SCTTWIFI
|
||||
- Haier XIB 3B2SFS-80
|
||||
- Haier XIB 6B2D3FB
|
||||
|
||||
## About this Repo
|
||||
The existing integrations missed some features from the app I liked to have in HomeAssistant.
|
||||
@ -105,11 +108,12 @@ I tried to create a pull request, but in the structures of these existing repos,
|
||||
I moved the api related stuff into the package [pyhOn](https://github.com/Andre0512/pyhOn).
|
||||
|
||||
## Appliance Features
|
||||
|
||||
### Dish washer
|
||||
#### Controls
|
||||
| Name | Icon | Entity | Key |
|
||||
| --- | --- | --- | --- |
|
||||
| Dish Washer | `mdi:dishwasher` | `switch` | `active` |
|
||||
| Dish Washer | `mdi:dishwasher` | `switch` | `startProgram` / `stopProgram` |
|
||||
#### Configs
|
||||
| Name | Icon | Entity | Key |
|
||||
| --- | --- | --- | --- |
|
||||
@ -138,6 +142,7 @@ I moved the api related stuff into the package [pyhOn](https://github.com/Andre0
|
||||
| Remaining Time | `mdi:timer` | `sensor` | `remainingTimeMM` |
|
||||
| Rinse Aid | `mdi:spray-bottle` | `binary_sensor` | `rinseAidStatus` |
|
||||
| Salt | `mdi:shaker-outline` | `binary_sensor` | `saltStatus` |
|
||||
|
||||
### Hob
|
||||
#### Controls
|
||||
| Name | Icon | Entity | Key |
|
||||
@ -157,20 +162,22 @@ I moved the api related stuff into the package [pyhOn](https://github.com/Andre0
|
||||
| Hob Lock | | `binary_sensor` | `hobLockStatus` |
|
||||
| Hot Status | | `binary_sensor` | `hotStatus` |
|
||||
| On | `mdi:power-cycle` | `binary_sensor` | `attributes.parameters.onOffStatus` |
|
||||
| Pan Status | `mdi:pot-mix` | `binary_sensor` | `panStatus` |
|
||||
| Power | `mdi:lightning-bolt` | `sensor` | `power` |
|
||||
| Remaining Time | `mdi:timer` | `sensor` | `remainingTimeMM` |
|
||||
| Remote Control | `mdi:remote` | `binary_sensor` | `attributes.parameters.remoteCtrValid` |
|
||||
| Temperature | `mdi:thermometer` | `sensor` | `temp` |
|
||||
|
||||
### Oven
|
||||
#### Controls
|
||||
| Name | Icon | Entity | Key |
|
||||
| --- | --- | --- | --- |
|
||||
| Start Program | `mdi:power-cycle` | `button` | `startProgram` |
|
||||
| Stop Program | `mdi:power-off` | `button` | `stopProgram` |
|
||||
| Oven | `mdi:toaster-oven` | `switch` | `startProgram` / `stopProgram` |
|
||||
#### Configs
|
||||
| Name | Icon | Entity | Key |
|
||||
| --- | --- | --- | --- |
|
||||
| Delay time | `mdi:timer-plus` | `number` | `startProgram.delayTime` |
|
||||
| Preheat | | `select` | `startProgram.preheatStatus` |
|
||||
| Preheat | `mdi:thermometer-chevron-up` | `switch` | `startProgram.preheatStatus` |
|
||||
| Program | | `select` | `startProgram.program` |
|
||||
| Program Duration | `mdi:timelapse` | `number` | `startProgram.prTime` |
|
||||
| Target Temperature | `mdi:thermometer` | `number` | `startProgram.tempSel` |
|
||||
@ -184,12 +191,13 @@ I moved the api related stuff into the package [pyhOn](https://github.com/Andre0
|
||||
| Start Time | `mdi:clock-start` | `sensor` | `delayTime` |
|
||||
| Temperature | `mdi:thermometer` | `sensor` | `temp` |
|
||||
| Temperature Selected | `mdi:thermometer` | `sensor` | `tempSel` |
|
||||
|
||||
### Tumble dryer
|
||||
#### Controls
|
||||
| Name | Icon | Entity | Key |
|
||||
| --- | --- | --- | --- |
|
||||
| Pause Tumble Dryer | `mdi:pause` | `switch` | `pause` |
|
||||
| Tumble Dryer | `mdi:tumble-dryer` | `switch` | `active` |
|
||||
| Pause Tumble Dryer | `mdi:pause` | `switch` | `pauseProgram` / `resumeProgram` |
|
||||
| Tumble Dryer | `mdi:tumble-dryer` | `switch` | `startProgram` / `stopProgram` |
|
||||
#### Configs
|
||||
| Name | Icon | Entity | Key |
|
||||
| --- | --- | --- | --- |
|
||||
@ -213,24 +221,28 @@ I moved the api related stuff into the package [pyhOn](https://github.com/Andre0
|
||||
| Remaining Time | `mdi:timer` | `sensor` | `remainingTimeMM` |
|
||||
| Start Time | `mdi:clock-start` | `sensor` | `delayTime` |
|
||||
| Temperature level | `mdi:thermometer` | `sensor` | `tempLevel` |
|
||||
|
||||
### Washer dryer
|
||||
#### Controls
|
||||
| Name | Icon | Entity | Key |
|
||||
| --- | --- | --- | --- |
|
||||
| Pause Washing Machine | `mdi:pause` | `switch` | `pause` |
|
||||
| Washing Machine | `mdi:washing-machine` | `switch` | `active` |
|
||||
| Pause Washing Machine | `mdi:pause` | `switch` | `pauseProgram` / `resumeProgram` |
|
||||
| Washing Machine | `mdi:washing-machine` | `switch` | `startProgram` / `stopProgram` |
|
||||
#### Configs
|
||||
| Name | Icon | Entity | Key |
|
||||
| --- | --- | --- | --- |
|
||||
| Delay Time | `mdi:timer-plus` | `number` | `startProgram.delayTime` |
|
||||
| Program | | `select` | `startProgram.program` |
|
||||
| Suggested weight | `mdi:weight-kilogram` | `sensor` | `startProgram.weight` |
|
||||
#### Sensors
|
||||
| Name | Icon | Entity | Key |
|
||||
| --- | --- | --- | --- |
|
||||
| Acqua Plus | | `binary_sensor` | `acquaplus` |
|
||||
| Anti-Crease | | `binary_sensor` | `anticrease` |
|
||||
| Current Electricity Used | `mdi:lightning-bolt` | `sensor` | `currentElectricityUsed` |
|
||||
| Current Program | `mdi:tumble-dryer` | `sensor` | `prCode` |
|
||||
| Current Temperature | `mdi:thermometer` | `sensor` | `temp` |
|
||||
| Current Water Used | `mdi:water` | `sensor` | `currentWaterUsed` |
|
||||
| Dirt level | `mdi:liquid-spot` | `sensor` | `dirtyLevel` |
|
||||
| Dry level | `mdi:hair-dryer` | `sensor` | `dryLevel` |
|
||||
| Extra Rinse 1 | | `binary_sensor` | `extraRinse1` |
|
||||
@ -244,12 +256,16 @@ I moved the api related stuff into the package [pyhOn](https://github.com/Andre0
|
||||
| Remote Control | `mdi:remote` | `binary_sensor` | `attributes.lastConnEvent.category` |
|
||||
| Spin Speed | `mdi:fast-forward-outline` | `sensor` | `spinSpeed` |
|
||||
| Steam level | `mdi:smoke` | `sensor` | `steamLevel` |
|
||||
| Total Power | | `sensor` | `totalElectricityUsed` |
|
||||
| Total Wash Cycle | `mdi:counter` | `sensor` | `totalWashCycle` |
|
||||
| Total Water | | `sensor` | `totalWaterUsed` |
|
||||
|
||||
### Washing machine
|
||||
#### Controls
|
||||
| Name | Icon | Entity | Key |
|
||||
| --- | --- | --- | --- |
|
||||
| Pause Washing Machine | `mdi:pause` | `switch` | `pause` |
|
||||
| Washing Machine | `mdi:washing-machine` | `switch` | `active` |
|
||||
| Pause Washing Machine | `mdi:pause` | `switch` | `pauseProgram` / `resumeProgram` |
|
||||
| Washing Machine | `mdi:washing-machine` | `switch` | `startProgram` / `stopProgram` |
|
||||
#### Configs
|
||||
| Name | Icon | Entity | Key |
|
||||
| --- | --- | --- | --- |
|
||||
|
@ -152,6 +152,9 @@ BINARY_SENSORS: dict[str, tuple[HonBinarySensorEntityDescription, ...]] = {
|
||||
device_class=BinarySensorDeviceClass.HEAT,
|
||||
on_value="1",
|
||||
),
|
||||
HonBinarySensorEntityDescription(
|
||||
key="panStatus", name="Pan Status", on_value="1", icon="mdi:pot-mix"
|
||||
),
|
||||
HonBinarySensorEntityDescription(
|
||||
key="hobLockStatus",
|
||||
name="Hob Lock",
|
||||
|
@ -14,18 +14,6 @@ from .hon import HonCoordinator, HonEntity
|
||||
_LOGGER = logging.getLogger(__name__)
|
||||
|
||||
BUTTONS: dict[str, tuple[ButtonEntityDescription, ...]] = {
|
||||
"OV": (
|
||||
ButtonEntityDescription(
|
||||
key="startProgram",
|
||||
name="Start Program",
|
||||
icon="mdi:power-cycle",
|
||||
),
|
||||
ButtonEntityDescription(
|
||||
key="stopProgram",
|
||||
name="Stop Program",
|
||||
icon="mdi:power-off",
|
||||
),
|
||||
),
|
||||
"IH": (
|
||||
ButtonEntityDescription(
|
||||
key="startProgram",
|
||||
|
@ -6,6 +6,6 @@
|
||||
"documentation": "https://github.com/Andre0512/hon/",
|
||||
"iot_class": "cloud_polling",
|
||||
"issue_tracker": "https://github.com/Andre0512/hon/issues",
|
||||
"requirements": ["pyhOn==0.8.0b6"],
|
||||
"version": "0.6.0-beta.6"
|
||||
"requirements": ["pyhOn==0.8.1"],
|
||||
"version": "0.6.1"
|
||||
}
|
||||
|
@ -70,11 +70,6 @@ SELECTS = {
|
||||
entity_category=EntityCategory.CONFIG,
|
||||
translation_key="programs",
|
||||
),
|
||||
SelectEntityDescription(
|
||||
key="startProgram.preheatStatus",
|
||||
name="Preheat",
|
||||
entity_category=EntityCategory.CONFIG,
|
||||
),
|
||||
),
|
||||
"IH": (
|
||||
SelectEntityDescription(
|
||||
|
@ -55,7 +55,7 @@ SENSORS: dict[str, tuple[SensorEntityDescription, ...]] = {
|
||||
name="Current Electricity Used",
|
||||
state_class=SensorStateClass.MEASUREMENT,
|
||||
device_class=SensorDeviceClass.POWER,
|
||||
native_unit_of_measurement=UnitOfPower.KILO_WATT,
|
||||
native_unit_of_measurement=UnitOfEnergy.KILO_WATT_HOUR,
|
||||
icon="mdi:lightning-bolt",
|
||||
),
|
||||
SensorEntityDescription(
|
||||
@ -146,6 +146,48 @@ SENSORS: dict[str, tuple[SensorEntityDescription, ...]] = {
|
||||
),
|
||||
),
|
||||
"WD": (
|
||||
SensorEntityDescription(
|
||||
key="totalElectricityUsed",
|
||||
name="Total Power",
|
||||
device_class=SensorDeviceClass.ENERGY,
|
||||
state_class=SensorStateClass.TOTAL_INCREASING,
|
||||
native_unit_of_measurement=UnitOfEnergy.KILO_WATT_HOUR,
|
||||
),
|
||||
SensorEntityDescription(
|
||||
key="totalWaterUsed",
|
||||
name="Total Water",
|
||||
device_class=SensorDeviceClass.WATER,
|
||||
state_class=SensorStateClass.TOTAL_INCREASING,
|
||||
native_unit_of_measurement=UnitOfVolume.LITERS,
|
||||
),
|
||||
SensorEntityDescription(
|
||||
key="totalWashCycle",
|
||||
name="Total Wash Cycle",
|
||||
state_class=SensorStateClass.TOTAL_INCREASING,
|
||||
icon="mdi:counter",
|
||||
),
|
||||
SensorEntityDescription(
|
||||
key="currentElectricityUsed",
|
||||
name="Current Electricity Used",
|
||||
state_class=SensorStateClass.MEASUREMENT,
|
||||
device_class=SensorDeviceClass.POWER,
|
||||
native_unit_of_measurement=UnitOfEnergy.KILO_WATT_HOUR,
|
||||
icon="mdi:lightning-bolt",
|
||||
),
|
||||
SensorEntityDescription(
|
||||
key="currentWaterUsed",
|
||||
name="Current Water Used",
|
||||
state_class=SensorStateClass.MEASUREMENT,
|
||||
icon="mdi:water",
|
||||
),
|
||||
SensorEntityDescription(
|
||||
key="startProgram.weight",
|
||||
name="Suggested weight",
|
||||
state_class=SensorStateClass.MEASUREMENT,
|
||||
entity_category=EntityCategory.CONFIG,
|
||||
native_unit_of_measurement=UnitOfMass.KILOGRAMS,
|
||||
icon="mdi:weight-kilogram",
|
||||
),
|
||||
SensorEntityDescription(
|
||||
key="machMode",
|
||||
name="Machine Status",
|
||||
@ -237,6 +279,12 @@ SENSORS: dict[str, tuple[SensorEntityDescription, ...]] = {
|
||||
native_unit_of_measurement=UnitOfTemperature.CELSIUS,
|
||||
),
|
||||
SensorEntityDescription(key="errors", name="Error", icon="mdi:math-log"),
|
||||
SensorEntityDescription(
|
||||
key="power",
|
||||
name="Power",
|
||||
icon="mdi:lightning-bolt",
|
||||
state_class=SensorStateClass.MEASUREMENT,
|
||||
),
|
||||
),
|
||||
"DW": (
|
||||
SensorEntityDescription(
|
||||
|
@ -73,6 +73,21 @@ SWITCHES: dict[str, tuple[HonSwitchEntityDescription, ...]] = {
|
||||
turn_off_key="resumeProgram",
|
||||
),
|
||||
),
|
||||
"OV": (
|
||||
HonSwitchEntityDescription(
|
||||
key="active",
|
||||
name="Oven",
|
||||
icon="mdi:toaster-oven",
|
||||
turn_on_key="startProgram",
|
||||
turn_off_key="stopProgram",
|
||||
),
|
||||
HonSwitchEntityDescription(
|
||||
key="startProgram.preheatStatus",
|
||||
name="Preheat",
|
||||
icon="mdi:thermometer-chevron-up",
|
||||
entity_category=EntityCategory.CONFIG,
|
||||
),
|
||||
),
|
||||
"WD": (
|
||||
HonSwitchEntityDescription(
|
||||
key="active",
|
||||
|
4
info.md
4
info.md
@ -1,7 +1,7 @@
|
||||
# Haier hOn
|
||||
[](https://github.com/Andre0512/hon/releases/latest)
|
||||

|
||||
[](https://analytics.home-assistant.io/)
|
||||
[](https://github.com/Andre0512/hon/blob/main/LICENSE)
|
||||
[](https://tooomm.github.io/github-release-stats/?username=Andre0512&repository=hon)
|
||||
Support for home appliances of Haier's mobile app hOn.
|
||||
|
||||
## Supported Appliances
|
||||
|
37
scripts/sensor_docs.py
Normal file → Executable file
37
scripts/sensor_docs.py
Normal file → Executable file
@ -1,9 +1,12 @@
|
||||
import re
|
||||
from pathlib import Path
|
||||
|
||||
from custom_components.hon.binary_sensor import BINARY_SENSORS
|
||||
from custom_components.hon.button import BUTTONS
|
||||
from custom_components.hon.number import NUMBERS
|
||||
from custom_components.hon.select import SELECTS
|
||||
from custom_components.hon.sensor import SENSORS
|
||||
from custom_components.hon.switch import SWITCHES
|
||||
from custom_components.hon.switch import SWITCHES, HonSwitchEntityDescription
|
||||
|
||||
APPLIANCES = {
|
||||
"AC": "Air conditioner",
|
||||
@ -38,19 +41,37 @@ result = {}
|
||||
for entity_type, appliances in entities.items():
|
||||
for appliance, data in appliances.items():
|
||||
for entity in data:
|
||||
attributes = (entity.key, entity.name, entity.icon, entity_type)
|
||||
if (
|
||||
isinstance(entity, HonSwitchEntityDescription)
|
||||
and entity.entity_category != "config"
|
||||
):
|
||||
key = f"{entity.turn_on_key}` / `{entity.turn_off_key}"
|
||||
else:
|
||||
key = entity.key
|
||||
attributes = (key, entity.name, entity.icon, entity_type)
|
||||
category = "control" if entity_type in ["switch", "button"] else "sensor"
|
||||
result.setdefault(appliance, {}).setdefault(
|
||||
entity.entity_category or category, []
|
||||
).append(attributes)
|
||||
|
||||
text = ""
|
||||
for appliance, categories in sorted(result.items()):
|
||||
print(f"### {APPLIANCES[appliance]}")
|
||||
text += f"\n### {APPLIANCES[appliance]}\n"
|
||||
categories = {k: categories[k] for k in ENTITY_CATEGORY_SORT if k in categories}
|
||||
for category, data in categories.items():
|
||||
print(f"#### {str(category).capitalize()}s")
|
||||
print("| Name | Icon | Entity | Key |")
|
||||
print("| --- | --- | --- | --- |")
|
||||
text += f"#### {str(category).capitalize()}s\n"
|
||||
text += "| Name | Icon | Entity | Key |\n"
|
||||
text += "| --- | --- | --- | --- |\n"
|
||||
for key, name, icon, entity_type in sorted(data, key=lambda d: d[1]):
|
||||
icon = f"`{icon}`" if icon else ""
|
||||
print(f"| {name} | {icon} | `{entity_type}` | `{key}` |")
|
||||
text += f"| {name} | {icon} | `{entity_type}` | `{key}` |\n"
|
||||
|
||||
with open(Path(__file__).parent.parent / "README.md", "r") as file:
|
||||
readme = file.read()
|
||||
readme = re.sub(
|
||||
"(## Appliance Features\n)(?:.|\\s)+?([^#]## |\\Z)",
|
||||
f"\\1{text}\\2",
|
||||
readme,
|
||||
re.DOTALL,
|
||||
)
|
||||
with open(Path(__file__).parent.parent / "README.md", "w") as file:
|
||||
file.write(readme)
|
||||
|
Reference in New Issue
Block a user