Compare commits

...

15 Commits

Author SHA1 Message Date
2c6def8f57 update readme 2023-04-19 20:40:31 +02:00
b723744948 Merge pull request #27 from MiguelAngelLV/main
Updated oven
2023-04-19 20:32:26 +02:00
e0081bf75e Black style 2023-04-19 20:18:40 +02:00
554ce1d7ff Update manifiest 2023-04-19 19:33:35 +02:00
256c691213 Oven 2023-04-19 19:31:45 +02:00
7fb68be033 Merge remote-tracking branch 'origin/main'
# Conflicts:
#	custom_components/hon/manifest.json
2023-04-19 18:42:17 +02:00
72c83527d5 Bump version to v0.6.0 2023-04-19 17:47:05 +02:00
75622e18a2 Bump version, update readme 2023-04-18 23:50:27 +02:00
a2d0257410 Add more sensors for #22 2023-04-18 23:50:14 +02:00
e2c7ca36db Merge pull request #23 from cylonbrain/main
Added WashingMachine sonsors to WashDryer as well
2023-04-18 12:52:54 +02:00
b33b6a40b2 Added WashingMachine sonsors to WashDryer as well
In addition to that the currentElectricityUsed is measured in kWh because it just counts the kWh for the current cycle
2023-04-18 12:47:25 +02:00
75859543aa Improve entity documentation 2023-04-17 23:18:27 +02:00
891ae51832 Bump pyhon version, fixes disapearing programs 2023-04-17 00:42:50 +02:00
5dbf508519 Merged 2023-04-16 17:04:18 +02:00
7d3813b8fd Update oven 2023-04-16 16:59:37 +02:00
9 changed files with 128 additions and 42 deletions

View File

@ -1,8 +1,8 @@
# Haier hOn
[![hacs_badge](https://img.shields.io/badge/HACS-Default-41BDF5.svg)](https://hacs.xyz)
[![GitHub release (latest by date)](https://img.shields.io/github/v/release/Andre0512/hon?color=green)](https://github.com/Andre0512/hon/releases/latest)
![GitHub](https://img.shields.io/github/license/Andre0512/hon?color=red)
[![Home Assistant installs](https://img.shields.io/badge/dynamic/json?color=blue&label=usage&suffix=%20installs&cacheSeconds=15600&url=https://analytics.home-assistant.io/custom_integrations.json&query=$.hon.total)](https://analytics.home-assistant.io/)
[![GitHub](https://img.shields.io/github/license/Andre0512/hon?color=red)](https://github.com/Andre0512/hon/blob/main/LICENSE)
[![GitHub all releases](https://img.shields.io/github/downloads/Andre0512/hon/total?color=blue)](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 |
| --- | --- | --- | --- |

View File

@ -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",

View File

@ -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",

View File

@ -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"
}

View File

@ -70,11 +70,6 @@ SELECTS = {
entity_category=EntityCategory.CONFIG,
translation_key="programs",
),
SelectEntityDescription(
key="startProgram.preheatStatus",
name="Preheat",
entity_category=EntityCategory.CONFIG,
),
),
"IH": (
SelectEntityDescription(

View File

@ -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(

View File

@ -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",

View File

@ -1,7 +1,7 @@
# Haier hOn
[![GitHub release (latest by date)](https://img.shields.io/github/v/release/Andre0512/hon?color=green)](https://github.com/Andre0512/hon/releases/latest)
![GitHub](https://img.shields.io/github/license/Andre0512/hon?color=red)
[![Home Assistant installs](https://img.shields.io/badge/dynamic/json?color=blue&label=usage&suffix=%20installs&cacheSeconds=15600&url=https://analytics.home-assistant.io/custom_integrations.json&query=$.hon.total)](https://analytics.home-assistant.io/)
[![GitHub](https://img.shields.io/github/license/Andre0512/hon?color=red)](https://github.com/Andre0512/hon/blob/main/LICENSE)
[![GitHub all releases](https://img.shields.io/github/downloads/Andre0512/hon/total?color=blue)](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
View 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)