Compare commits
	
		
			17 Commits
		
	
	
		
			v0.6.0-bet
			...
			v0.6.1
		
	
	| Author | SHA1 | Date | |
|---|---|---|---|
| 2c6def8f57 | |||
| b723744948 | |||
| e0081bf75e | |||
| 554ce1d7ff | |||
| 256c691213 | |||
| 7fb68be033 | |||
| 72c83527d5 | |||
| 75622e18a2 | |||
| a2d0257410 | |||
| e2c7ca36db | |||
| b33b6a40b2 | |||
| 75859543aa | |||
| 891ae51832 | |||
| 102a05ffcd | |||
| 380cde5a71 | |||
| 5dbf508519 | |||
| 7d3813b8fd | 
							
								
								
									
										2
									
								
								.gitignore
									
									
									
									
										vendored
									
									
								
							
							
						
						
									
										2
									
								
								.gitignore
									
									
									
									
										vendored
									
									
								
							| @ -1,3 +1,3 @@ | |||||||
| __pycache__/ | __pycache__/ | ||||||
| test.py | scripts/test.py | ||||||
| .idea/ | .idea/ | ||||||
|  | |||||||
							
								
								
									
										209
									
								
								README.md
									
									
									
									
									
								
							
							
						
						
									
										209
									
								
								README.md
									
									
									
									
									
								
							| @ -1,16 +1,17 @@ | |||||||
| # Haier hOn | # Haier hOn | ||||||
| [](https://hacs.xyz) | [](https://hacs.xyz) | ||||||
| [](https://github.com/Andre0512/hon/releases/latest) | [](https://github.com/Andre0512/hon/releases/latest) | ||||||
|  | [](https://github.com/Andre0512/hon/blob/main/LICENSE) | ||||||
| [](https://analytics.home-assistant.io/)   | [](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. | Home Assistant integration for Haier hOn: support for Haier/Candy/Hoover home appliances like washing machines. | ||||||
|  |  | ||||||
| ## Supported Appliances | ## Supported Appliances | ||||||
| - Washing Machine | - [Washing Machine](https://github.com/Andre0512/hon#washing-machine) | ||||||
| - Tumble Dryer | - [Tumble Dryer](https://github.com/Andre0512/hon#tumble-dryer) | ||||||
| - Washer Dryer | - [Washer Dryer](https://github.com/Andre0512/hon#washer-dryer) | ||||||
| - Oven | - [Oven](https://github.com/Andre0512/hon#oven) | ||||||
| - Hob | - [Hob](https://github.com/Andre0512/hon#hob) | ||||||
| - Dish Washer | - [Dish Washer](https://github.com/Andre0512/hon#dish-washer) | ||||||
|  |  | ||||||
| ## Installation | ## Installation | ||||||
| **Method 1:** [](https://my.home-assistant.io/redirect/hacs_repository/?owner=Andre0512&repository=hon&category=integration) | **Method 1:** [](https://my.home-assistant.io/redirect/hacs_repository/?owner=Andre0512&repository=hon&category=integration) | ||||||
| @ -28,8 +29,6 @@ _Restart Home Assistant_ | |||||||
| **Method 2**: Settings > Devices & Services > Add Integration > **Haier hOn**   | **Method 2**: Settings > Devices & Services > Add Integration > **Haier hOn**   | ||||||
| _If the integration is not in the list, you need to clear the browser cache._ | _If the integration is not in the list, you need to clear the browser cache._ | ||||||
|  |  | ||||||
|  |  | ||||||
|  |  | ||||||
| ## Contribute | ## Contribute | ||||||
| Any kind of contribution is welcome! | Any kind of contribution is welcome! | ||||||
| ### Read out device data | ### Read out device data | ||||||
| @ -99,8 +98,198 @@ For every device exists a hidden button which can be used to log all info of you | |||||||
| - Haier HD80-A3959 | - Haier HD80-A3959 | ||||||
| - Haier HWO60SM2F3XH | - Haier HWO60SM2F3XH | ||||||
| - Hoover H-WASH 500 | - Hoover H-WASH 500 | ||||||
|  | - Candy CIS633SCTTWIFI | ||||||
|  | - Haier XIB 3B2SFS-80 | ||||||
|  | - Haier XIB 6B2D3FB | ||||||
|  |  | ||||||
| ## About this Repo | ## About this Repo | ||||||
| The existing integrations missed some features from the app I liked to have in HomeAssistant. | The existing integrations missed some features from the app I liked to have in HomeAssistant. | ||||||
| I tried to create a pull request, but in the structures of these existing repos, I find it hard to fit in my needs, so I basically rewrote everything.  | I tried to create a pull request, but in the structures of these existing repos, I find it hard to fit in my needs, so I basically rewrote everything.  | ||||||
| I moved the api related stuff into the package [pyhOn](https://github.com/Andre0512/pyhOn). | 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` | `startProgram` / `stopProgram` | | ||||||
|  | #### Configs | ||||||
|  | | Name | Icon | Entity | Key | | ||||||
|  | | --- | --- | --- | --- | | ||||||
|  | | Add Dish | `mdi:silverware-fork-knife` | `switch` | `startProgram.addDish` | | ||||||
|  | | Delay time | `mdi:timer-plus` | `number` | `startProgram.delayTime` | | ||||||
|  | | Eco Express | `mdi:sprout` | `switch` | `startProgram.ecoExpress` | | ||||||
|  | | Eco Index | `mdi:sprout` | `sensor` | `startProgram.ecoIndex` | | ||||||
|  | | Energy Label | `mdi:lightning-bolt-circle` | `sensor` | `startProgram.energyLabel` | | ||||||
|  | | Extra Dry | `mdi:hair-dryer` | `switch` | `startProgram.extraDry` | | ||||||
|  | | Half Load | `mdi:fraction-one-half` | `switch` | `startProgram.halfLoad` | | ||||||
|  | | Open Door | `mdi:door-open` | `switch` | `startProgram.openDoor` | | ||||||
|  | | Program |  | `select` | `startProgram.program` | | ||||||
|  | | Temperature | `mdi:thermometer` | `sensor` | `startProgram.temp` | | ||||||
|  | | Three in One | `mdi:numeric-3-box-outline` | `switch` | `startProgram.threeInOne` | | ||||||
|  | | Time | `mdi:timer` | `sensor` | `startProgram.remainingTime` | | ||||||
|  | | Water Efficiency | `mdi:water` | `sensor` | `startProgram.waterEfficiency` | | ||||||
|  | | Water Saving | `mdi:water-percent` | `sensor` | `startProgram.waterSaving` | | ||||||
|  | | Water hard | `mdi:water` | `number` | `startProgram.waterHard` | | ||||||
|  | #### Sensors | ||||||
|  | | Name | Icon | Entity | Key | | ||||||
|  | | --- | --- | --- | --- | | ||||||
|  | | Connection |  | `binary_sensor` | `attributes.lastConnEvent.category` | | ||||||
|  | | Door |  | `binary_sensor` | `doorStatus` | | ||||||
|  | | Error | `mdi:math-log` | `sensor` | `errors` | | ||||||
|  | | Machine Status | `mdi:information` | `sensor` | `machMode` | | ||||||
|  | | 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 | | ||||||
|  | | --- | --- | --- | --- | | ||||||
|  | | Start Program | `mdi:pot-steam` | `button` | `startProgram` | | ||||||
|  | #### Configs | ||||||
|  | | Name | Icon | Entity | Key | | ||||||
|  | | --- | --- | --- | --- | | ||||||
|  | | Power Management | `mdi:timelapse` | `number` | `startProgram.powerManagement` | | ||||||
|  | | Program |  | `select` | `startProgram.program` | | ||||||
|  | | Temperature | `mdi:thermometer` | `number` | `startProgram.temp` | | ||||||
|  | #### Sensors | ||||||
|  | | Name | Icon | Entity | Key | | ||||||
|  | | --- | --- | --- | --- | | ||||||
|  | | Connection | `mdi:wifi` | `binary_sensor` | `attributes.lastConnEvent.category` | | ||||||
|  | | Error | `mdi:math-log` | `sensor` | `errors` | | ||||||
|  | | 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 | | ||||||
|  | | --- | --- | --- | --- | | ||||||
|  | | Oven | `mdi:toaster-oven` | `switch` | `startProgram` / `stopProgram` | | ||||||
|  | #### Configs | ||||||
|  | | Name | Icon | Entity | Key | | ||||||
|  | | --- | --- | --- | --- | | ||||||
|  | | Delay time | `mdi:timer-plus` | `number` | `startProgram.delayTime` | | ||||||
|  | | 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` | | ||||||
|  | #### Sensors | ||||||
|  | | Name | Icon | Entity | Key | | ||||||
|  | | --- | --- | --- | --- | | ||||||
|  | | Connection | `mdi:wifi` | `binary_sensor` | `attributes.lastConnEvent.category` | | ||||||
|  | | On | `mdi:power-cycle` | `binary_sensor` | `attributes.parameters.onOffStatus` | | ||||||
|  | | Remaining Time | `mdi:timer` | `sensor` | `remainingTimeMM` | | ||||||
|  | | Remote Control | `mdi:remote` | `binary_sensor` | `attributes.parameters.remoteCtrValid` | | ||||||
|  | | 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` | `pauseProgram` / `resumeProgram` | | ||||||
|  | | Tumble Dryer | `mdi:tumble-dryer` | `switch` | `startProgram` / `stopProgram` | | ||||||
|  | #### Configs | ||||||
|  | | Name | Icon | Entity | Key | | ||||||
|  | | --- | --- | --- | --- | | ||||||
|  | | Anti-Crease time | `mdi:timer` | `number` | `startProgram.antiCreaseTime` | | ||||||
|  | | Delay time | `mdi:timer-plus` | `number` | `startProgram.delayTime` | | ||||||
|  | | Dry level | `mdi:hair-dryer` | `number` | `startProgram.dryLevel` | | ||||||
|  | | Program |  | `select` | `startProgram.program` | | ||||||
|  | | Sterilization status | `mdi:clock-start` | `number` | `startProgram.sterilizationStatus` | | ||||||
|  | | Temperature level | `mdi:thermometer` | `number` | `startProgram.tempLevel` | | ||||||
|  | | Time | `mdi:timer` | `select` | `startProgram.dryTimeMM` | | ||||||
|  | #### Sensors | ||||||
|  | | Name | Icon | Entity | Key | | ||||||
|  | | --- | --- | --- | --- | | ||||||
|  | | Connection |  | `binary_sensor` | `attributes.lastConnEvent.category` | | ||||||
|  | | Door |  | `binary_sensor` | `doorStatus` | | ||||||
|  | | Dry level | `mdi:hair-dryer` | `sensor` | `dryLevel` | | ||||||
|  | | Error | `mdi:math-log` | `sensor` | `errors` | | ||||||
|  | | Machine Status | `mdi:information` | `sensor` | `machMode` | | ||||||
|  | | Program | `mdi:tumble-dryer` | `sensor` | `prCode` | | ||||||
|  | | Program Phase | `mdi:tumble-dryer` | `sensor` | `prPhase` | | ||||||
|  | | 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` | `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` | | ||||||
|  | | Extra Rinse 2 |  | `binary_sensor` | `extraRinse2` | | ||||||
|  | | Extra Rinse 3 |  | `binary_sensor` | `extraRinse3` | | ||||||
|  | | Good Night Mode |  | `binary_sensor` | `goodNight` | | ||||||
|  | | Machine Status | `mdi:information` | `sensor` | `machMode` | | ||||||
|  | | Pre Wash |  | `binary_sensor` | `startProgram.prewash` | | ||||||
|  | | Program Phase | `mdi:tumble-dryer` | `sensor` | `prPhase` | | ||||||
|  | | Remaining Time | `mdi:timer` | `sensor` | `remainingTimeMM` | | ||||||
|  | | 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` | `pauseProgram` / `resumeProgram` | | ||||||
|  | | Washing Machine | `mdi:washing-machine` | `switch` | `startProgram` / `stopProgram` | | ||||||
|  | #### Configs | ||||||
|  | | Name | Icon | Entity | Key | | ||||||
|  | | --- | --- | --- | --- | | ||||||
|  | | Delay Status | `mdi:timer-check` | `switch` | `startProgram.delayStatus` | | ||||||
|  | | Delay Time | `mdi:timer-plus` | `number` | `startProgram.delayTime` | | ||||||
|  | | Main Wash Time | `mdi:clock-start` | `number` | `startProgram.mainWashTime` | | ||||||
|  | | Program |  | `select` | `startProgram.program` | | ||||||
|  | | Rinse Iterations | `mdi:rotate-right` | `number` | `startProgram.rinseIterations` | | ||||||
|  | | Soak Prewash Selection | `mdi:tshirt-crew` | `switch` | `startProgram.haier_SoakPrewashSelection` | | ||||||
|  | | Spin speed | `mdi:numeric` | `select` | `startProgram.spinSpeed` | | ||||||
|  | | Suggested weight | `mdi:weight-kilogram` | `sensor` | `startProgram.weight` | | ||||||
|  | | Temperature | `mdi:thermometer` | `select` | `startProgram.temp` | | ||||||
|  | #### Sensors | ||||||
|  | | Name | Icon | Entity | Key | | ||||||
|  | | --- | --- | --- | --- | | ||||||
|  | | Current Electricity Used | `mdi:lightning-bolt` | `sensor` | `currentElectricityUsed` | | ||||||
|  | | Current Water Used | `mdi:water` | `sensor` | `currentWaterUsed` | | ||||||
|  | | Door |  | `binary_sensor` | `doorStatus` | | ||||||
|  | | Door Lock |  | `binary_sensor` | `doorLockStatus` | | ||||||
|  | | Error | `mdi:math-log` | `sensor` | `errors` | | ||||||
|  | | Machine Status | `mdi:information` | `sensor` | `machMode` | | ||||||
|  | | Remaining Time | `mdi:timer` | `sensor` | `remainingTimeMM` | | ||||||
|  | | Remote Control | `mdi:remote` | `binary_sensor` | `attributes.lastConnEvent.category` | | ||||||
|  | | Spin Speed | `mdi:speedometer` | `sensor` | `spinSpeed` | | ||||||
|  | | Total Power |  | `sensor` | `totalElectricityUsed` | | ||||||
|  | | Total Wash Cycle | `mdi:counter` | `sensor` | `totalWashCycle` | | ||||||
|  | | Total Water |  | `sensor` | `totalWaterUsed` | | ||||||
|  | |||||||
| @ -152,6 +152,9 @@ BINARY_SENSORS: dict[str, tuple[HonBinarySensorEntityDescription, ...]] = { | |||||||
|             device_class=BinarySensorDeviceClass.HEAT, |             device_class=BinarySensorDeviceClass.HEAT, | ||||||
|             on_value="1", |             on_value="1", | ||||||
|         ), |         ), | ||||||
|  |         HonBinarySensorEntityDescription( | ||||||
|  |             key="panStatus", name="Pan Status", on_value="1", icon="mdi:pot-mix" | ||||||
|  |         ), | ||||||
|         HonBinarySensorEntityDescription( |         HonBinarySensorEntityDescription( | ||||||
|             key="hobLockStatus", |             key="hobLockStatus", | ||||||
|             name="Hob Lock", |             name="Hob Lock", | ||||||
|  | |||||||
| @ -14,18 +14,6 @@ from .hon import HonCoordinator, HonEntity | |||||||
| _LOGGER = logging.getLogger(__name__) | _LOGGER = logging.getLogger(__name__) | ||||||
|  |  | ||||||
| BUTTONS: dict[str, tuple[ButtonEntityDescription, ...]] = { | 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": ( |     "IH": ( | ||||||
|         ButtonEntityDescription( |         ButtonEntityDescription( | ||||||
|             key="startProgram", |             key="startProgram", | ||||||
|  | |||||||
| @ -6,6 +6,6 @@ | |||||||
|   "documentation": "https://github.com/Andre0512/hon/", |   "documentation": "https://github.com/Andre0512/hon/", | ||||||
|   "iot_class": "cloud_polling", |   "iot_class": "cloud_polling", | ||||||
|   "issue_tracker": "https://github.com/Andre0512/hon/issues", |   "issue_tracker": "https://github.com/Andre0512/hon/issues", | ||||||
|   "requirements": ["pyhOn==0.8.0b5"], |  "requirements": ["pyhOn==0.8.1"], | ||||||
|   "version": "0.6.0-beta.5" |   "version": "0.6.1" | ||||||
| } | } | ||||||
|  | |||||||
| @ -70,11 +70,6 @@ SELECTS = { | |||||||
|             entity_category=EntityCategory.CONFIG, |             entity_category=EntityCategory.CONFIG, | ||||||
|             translation_key="programs", |             translation_key="programs", | ||||||
|         ), |         ), | ||||||
|         SelectEntityDescription( |  | ||||||
|             key="startProgram.preheatStatus", |  | ||||||
|             name="Preheat", |  | ||||||
|             entity_category=EntityCategory.CONFIG, |  | ||||||
|         ), |  | ||||||
|     ), |     ), | ||||||
|     "IH": ( |     "IH": ( | ||||||
|         SelectEntityDescription( |         SelectEntityDescription( | ||||||
|  | |||||||
| @ -55,7 +55,7 @@ SENSORS: dict[str, tuple[SensorEntityDescription, ...]] = { | |||||||
|             name="Current Electricity Used", |             name="Current Electricity Used", | ||||||
|             state_class=SensorStateClass.MEASUREMENT, |             state_class=SensorStateClass.MEASUREMENT, | ||||||
|             device_class=SensorDeviceClass.POWER, |             device_class=SensorDeviceClass.POWER, | ||||||
|             native_unit_of_measurement=UnitOfPower.KILO_WATT, |             native_unit_of_measurement=UnitOfEnergy.KILO_WATT_HOUR, | ||||||
|             icon="mdi:lightning-bolt", |             icon="mdi:lightning-bolt", | ||||||
|         ), |         ), | ||||||
|         SensorEntityDescription( |         SensorEntityDescription( | ||||||
| @ -146,6 +146,48 @@ SENSORS: dict[str, tuple[SensorEntityDescription, ...]] = { | |||||||
|         ), |         ), | ||||||
|     ), |     ), | ||||||
|     "WD": ( |     "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( |         SensorEntityDescription( | ||||||
|             key="machMode", |             key="machMode", | ||||||
|             name="Machine Status", |             name="Machine Status", | ||||||
| @ -237,6 +279,12 @@ SENSORS: dict[str, tuple[SensorEntityDescription, ...]] = { | |||||||
|             native_unit_of_measurement=UnitOfTemperature.CELSIUS, |             native_unit_of_measurement=UnitOfTemperature.CELSIUS, | ||||||
|         ), |         ), | ||||||
|         SensorEntityDescription(key="errors", name="Error", icon="mdi:math-log"), |         SensorEntityDescription(key="errors", name="Error", icon="mdi:math-log"), | ||||||
|  |         SensorEntityDescription( | ||||||
|  |             key="power", | ||||||
|  |             name="Power", | ||||||
|  |             icon="mdi:lightning-bolt", | ||||||
|  |             state_class=SensorStateClass.MEASUREMENT, | ||||||
|  |         ), | ||||||
|     ), |     ), | ||||||
|     "DW": ( |     "DW": ( | ||||||
|         SensorEntityDescription( |         SensorEntityDescription( | ||||||
|  | |||||||
| @ -73,6 +73,21 @@ SWITCHES: dict[str, tuple[HonSwitchEntityDescription, ...]] = { | |||||||
|             turn_off_key="resumeProgram", |             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": ( |     "WD": ( | ||||||
|         HonSwitchEntityDescription( |         HonSwitchEntityDescription( | ||||||
|             key="active", |             key="active", | ||||||
|  | |||||||
							
								
								
									
										18
									
								
								info.md
									
									
									
									
									
								
							
							
						
						
									
										18
									
								
								info.md
									
									
									
									
									
								
							| @ -1,15 +1,16 @@ | |||||||
| # Haier hOn | # Haier hOn | ||||||
| [](https://github.com/Andre0512/hon/releases/latest) | [](https://github.com/Andre0512/hon/releases/latest) | ||||||
|  | [](https://github.com/Andre0512/hon/blob/main/LICENSE) | ||||||
| [](https://analytics.home-assistant.io/)   | [](https://tooomm.github.io/github-release-stats/?username=Andre0512&repository=hon)   | ||||||
| Support for home appliances of Haier's mobile app hOn.  | Support for home appliances of Haier's mobile app hOn.  | ||||||
|  |  | ||||||
| ## Supported Appliances | ## Supported Appliances | ||||||
| - Tumble Dryer | - [Washing Machine](https://github.com/Andre0512/hon#washing-machine) | ||||||
| - Washer Dryer | - [Tumble Dryer](https://github.com/Andre0512/hon#tumble-dryer) | ||||||
| - Washing Machine | - [Washer Dryer](https://github.com/Andre0512/hon#washer-dryer) | ||||||
| - Oven | - [Oven](https://github.com/Andre0512/hon#oven) | ||||||
| - Hob | - [Hob](https://github.com/Andre0512/hon#hob) | ||||||
|  | - [Dish Washer](https://github.com/Andre0512/hon#dish-washer) | ||||||
|  |  | ||||||
| ## Tested Appliances | ## Tested Appliances | ||||||
| - Haier WD90-B14TEAM5 | - Haier WD90-B14TEAM5 | ||||||
| @ -17,7 +18,6 @@ Support for home appliances of Haier's mobile app hOn. | |||||||
| - Haier HWO60SM2F3XH | - Haier HWO60SM2F3XH | ||||||
| - Hoover H-WASH 500 | - Hoover H-WASH 500 | ||||||
|  |  | ||||||
|  |  | ||||||
| ## Configuration | ## Configuration | ||||||
|  |  | ||||||
| **Method 1**: [](https://my.home-assistant.io/redirect/config_flow_start/?domain=hon) | **Method 1**: [](https://my.home-assistant.io/redirect/config_flow_start/?domain=hon) | ||||||
| @ -25,13 +25,11 @@ Support for home appliances of Haier's mobile app hOn. | |||||||
| **Method 2**: Settings > Devices & Services > Add Integration > **Haier hOn**   | **Method 2**: Settings > Devices & Services > Add Integration > **Haier hOn**   | ||||||
| _If the integration is not in the list, you need to clear the browser cache._ | _If the integration is not in the list, you need to clear the browser cache._ | ||||||
|  |  | ||||||
|  |  | ||||||
| ## Contribute | ## Contribute | ||||||
| Want to help us to support more appliances? Or add more sensors? Or help with translating? Or beautify some icons or captions?  | Want to help us to support more appliances? Or add more sensors? Or help with translating? Or beautify some icons or captions?  | ||||||
| Check out the [project on GitHub](https://github.com/Andre0512/hon), every contribution is welcome! | Check out the [project on GitHub](https://github.com/Andre0512/hon), every contribution is welcome! | ||||||
|  |  | ||||||
| ## Useful Links | ## Useful Links | ||||||
|  |  | ||||||
| * [GitHub repository](https://github.com/Andre0512/hon) (please add a star if you like this integration!) | * [GitHub repository](https://github.com/Andre0512/hon) (please add a star if you like this integration!) | ||||||
| * [pyhOn library](https://github.com/Andre0512/pyhOn) | * [pyhOn library](https://github.com/Andre0512/pyhOn) | ||||||
| * [Release notes](https://github.com/Andre0512/hon/releases) | * [Release notes](https://github.com/Andre0512/hon/releases) | ||||||
|  | |||||||
							
								
								
									
										77
									
								
								scripts/sensor_docs.py
									
									
									
									
									
										Executable file
									
								
							
							
						
						
									
										77
									
								
								scripts/sensor_docs.py
									
									
									
									
									
										Executable file
									
								
							| @ -0,0 +1,77 @@ | |||||||
|  | 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, HonSwitchEntityDescription | ||||||
|  |  | ||||||
|  | APPLIANCES = { | ||||||
|  |     "AC": "Air conditioner", | ||||||
|  |     "AP": "Air purifier", | ||||||
|  |     "AS": "Air scanner", | ||||||
|  |     "DW": "Dish washer", | ||||||
|  |     "HO": "Hood", | ||||||
|  |     "IH": "Hob", | ||||||
|  |     "MW": "Microwave", | ||||||
|  |     "OV": "Oven", | ||||||
|  |     "REF": "Fridge", | ||||||
|  |     "RVC": "Robot vacuum cleaner", | ||||||
|  |     "TD": "Tumble dryer", | ||||||
|  |     "WC": "Wine Cellar", | ||||||
|  |     "WD": "Washer dryer", | ||||||
|  |     "WH": "Water Heater", | ||||||
|  |     "WM": "Washing machine", | ||||||
|  | } | ||||||
|  |  | ||||||
|  | ENTITY_CATEGORY_SORT = ["control", "config", "sensor"] | ||||||
|  |  | ||||||
|  | entities = { | ||||||
|  |     "binary_sensor": BINARY_SENSORS, | ||||||
|  |     "button": BUTTONS, | ||||||
|  |     "number": NUMBERS, | ||||||
|  |     "select": SELECTS, | ||||||
|  |     "sensor": SENSORS, | ||||||
|  |     "switch": SWITCHES, | ||||||
|  | } | ||||||
|  |  | ||||||
|  | result = {} | ||||||
|  | for entity_type, appliances in entities.items(): | ||||||
|  |     for appliance, data in appliances.items(): | ||||||
|  |         for entity in data: | ||||||
|  |             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()): | ||||||
|  |     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(): | ||||||
|  |         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 "" | ||||||
|  |             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
	