nathanvdh / homeassistant-airtouch2plus

Custom component integration for Polyaire Airtouch 2+
12 stars 2 forks source link

Zone support #2

Closed nathanvdh closed 8 months ago

nathanvdh commented 11 months ago

@Chris112 @Selmaks @bigjezza @phardy @ozhound @ctrl-freak @mcoops

Ping :)

Can somebody see if the latest beta release works at all. If so: Do you get fan entities for the zones? Does on/off show correctly? Does damper% show correctly?

ctrl-freak commented 11 months ago

I'm getting an error importing At2PlusClient, but I'll remove it entirely and try again.

``` This error originated from a custom integration. Logger: homeassistant.setup Source: custom_components/airtouch2plus/__init__.py:4 Integration: airtouch2plus First occurred: 6:56:29 PM (1 occurrences) Last logged: 6:56:29 PM Setup failed for custom integration airtouch2plus: Unable to import component: cannot import name 'At2PlusClient' from partially initialized module 'airtouch2.at2plus.At2PlusClient' (most likely due to a circular import) (/usr/local/lib/python3.11/site-packages/airtouch2/at2plus/At2PlusClient.py) Traceback (most recent call last): File "/usr/src/homeassistant/homeassistant/setup.py", line 215, in _async_setup_component component = integration.get_component() ^^^^^^^^^^^^^^^^^^^^^^^^^^^ File "/usr/src/homeassistant/homeassistant/loader.py", line 818, in get_component ComponentProtocol, importlib.import_module(self.pkg_path) ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ File "/usr/local/lib/python3.11/importlib/__init__.py", line 126, in import_module return _bootstrap._gcd_import(name[level:], package, level) ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ File "", line 1204, in _gcd_import File "", line 1176, in _find_and_load File "", line 1147, in _find_and_load_unlocked File "", line 690, in _load_unlocked File "", line 940, in exec_module File "", line 241, in _call_with_frames_removed File "/config/custom_components/airtouch2plus/__init__.py", line 4, in from airtouch2.at2plus import At2PlusClient File "/usr/local/lib/python3.11/site-packages/airtouch2/at2plus/__init__.py", line 1, in from airtouch2.at2plus.At2PlusClient import At2PlusClient File "/usr/local/lib/python3.11/site-packages/airtouch2/at2plus/At2PlusClient.py", line 6, in from airtouch2.at2plus.At2PlusGroup import At2PlusGroup File "/usr/local/lib/python3.11/site-packages/airtouch2/at2plus/At2PlusGroup.py", line 3, in from airtouch2.at2plus.At2PlusClient import At2PlusClient ImportError: cannot import name 'At2PlusClient' from partially initialized module 'airtouch2.at2plus.At2PlusClient' (most likely due to a circular import) (/usr/local/lib/python3.11/site-packages/airtouch2/at2plus/At2PlusClient.py) ```
Chris112 commented 11 months ago

Hey, i'm excited for this one. I did the update via HACS but didn't check the sha. Got the same error as @ctrl-freak

``` Logger: homeassistant.setup Source: setup.py:215 First occurred: 6:55:42 PM (1 occurrences) Last logged: 6:55:42 PM Setup failed for custom integration airtouch2plus: Unable to import component: cannot import name 'At2PlusClient' from partially initialized module 'airtouch2.at2plus.At2PlusClient' (most likely due to a circular import) (/usr/local/lib/python3.11/site-packages/airtouch2/at2plus/At2PlusClient.py) Traceback (most recent call last): File "/usr/src/homeassistant/homeassistant/setup.py", line 215, in _async_setup_component component = integration.get_component() ^^^^^^^^^^^^^^^^^^^^^^^^^^^ File "/usr/src/homeassistant/homeassistant/loader.py", line 818, in get_component ComponentProtocol, importlib.import_module(self.pkg_path) ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ File "/usr/local/lib/python3.11/importlib/__init__.py", line 126, in import_module return _bootstrap._gcd_import(name[level:], package, level) ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ File "", line 1204, in _gcd_import File "", line 1176, in _find_and_load File "", line 1147, in _find_and_load_unlocked File "", line 690, in _load_unlocked File "", line 940, in exec_module File "", line 241, in _call_with_frames_removed File "/config/custom_components/airtouch2plus/__init__.py", line 4, in from airtouch2.at2plus import At2PlusClient File "/usr/local/lib/python3.11/site-packages/airtouch2/at2plus/__init__.py", line 1, in from airtouch2.at2plus.At2PlusClient import At2PlusClient File "/usr/local/lib/python3.11/site-packages/airtouch2/at2plus/At2PlusClient.py", line 6, in from airtouch2.at2plus.At2PlusGroup import At2PlusGroup File "/usr/local/lib/python3.11/site-packages/airtouch2/at2plus/At2PlusGroup.py", line 3, in from airtouch2.at2plus.At2PlusClient import At2PlusClient ImportError: cannot import name 'At2PlusClient' from partially initialized module 'airtouch2.at2plus.At2PlusClient' (most likely due to a circular import) (/usr/local/lib/python3.11/site-packages/airtouch2/at2plus/At2PlusClient.py) ```
randellmatt commented 11 months ago

Same for me unfortunately. Looking forward to steps toward zone control - that would be amazing.

``` 2023-11-01 21:29:59.133 ERROR (MainThread) [homeassistant.setup] Setup failed for custom integration airtouch2plus: Unable to import component: cannot import name 'At2PlusClient' from partially initialized module 'airtouch2.at2plus.At2PlusClient' (most likely due to a circular import) (/usr/local/lib/python3.11/site-packages/airtouch2/at2plus/At2PlusClient.py) Traceback (most recent call last): File "/usr/src/homeassistant/homeassistant/setup.py", line 215, in _async_setup_component component = integration.get_component() ^^^^^^^^^^^^^^^^^^^^^^^^^^^ File "/usr/src/homeassistant/homeassistant/loader.py", line 818, in get_component ComponentProtocol, importlib.import_module(self.pkg_path) ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ File "/usr/local/lib/python3.11/importlib/__init__.py", line 126, in import_module return _bootstrap._gcd_import(name[level:], package, level) ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ File "", line 1204, in _gcd_import File "", line 1176, in _find_and_load File "", line 1147, in _find_and_load_unlocked File "", line 690, in _load_unlocked File "", line 940, in exec_module File "", line 241, in _call_with_frames_removed File "/config/custom_components/airtouch2plus/__init__.py", line 4, in from airtouch2.at2plus import At2PlusClient File "/usr/local/lib/python3.11/site-packages/airtouch2/at2plus/__init__.py", line 1, in from airtouch2.at2plus.At2PlusClient import At2PlusClient File "/usr/local/lib/python3.11/site-packages/airtouch2/at2plus/At2PlusClient.py", line 6, in from airtouch2.at2plus.At2PlusGroup import At2PlusGroup File "/usr/local/lib/python3.11/site-packages/airtouch2/at2plus/At2PlusGroup.py", line 3, in from airtouch2.at2plus.At2PlusClient import At2PlusClient ImportError: cannot import name 'At2PlusClient' from partially initialized module 'airtouch2.at2plus.At2PlusClient' (most likely due to a circular import) (/usr/local/lib/python3.11/site-packages/airtouch2/at2plus/At2PlusClient.py) ```
nathanvdh commented 11 months ago

This is what I get for not writing an emulator to test against myself...

Ok fixed this recursive import problem. Try again :)

randellmatt commented 11 months ago

Reloaded. Cannot see any new entities.

nathanvdh commented 11 months ago

I think I know what's going on. I'll try to sort it out tomorrow. In the meantime can you try the test_programs/at2plus_test.py script from the library repo. Let me know if it prints the zone statuses correctly.

Edit: Just realised I never actually request the zones - doh!

nathanvdh commented 11 months ago

Ok pushed another release that actually requests the zone info xD.

randellmatt commented 11 months ago

Still no new entities or zone details unfortunately.

nathanvdh commented 11 months ago

Final dumb mistake fixed for tonight - try 0.2.3. Will pick this up again tomorrow night.

randellmatt commented 11 months ago

I can now see 8 fan group entities corresponding to the 8 zones of my house. They update correctly if I turn a zone on and off. No dampler settings or anything else. It's a pretty good start though!

ctrl-freak commented 11 months ago

Confirming the later update is good.

All zones accounted for, no dampening, but that's still awesome!

mcoops commented 11 months ago

Agreed!

Works, fans are correct (on/off) but no dampening %. Very exciting!

Selmaks commented 11 months ago

Just confirming what everyone else is seeing. Very exciting indeed!.

nathanvdh commented 11 months ago

Have a go with the latest release :)

Group names are still missing, will do that next.

randellmatt commented 11 months ago

So far it looks to be operating correctly. I can control each individual zone damper %; and turn zones off and on.

This will be very helpful to control the zones for the kids overnight when asleep and cold or the opposite during the day when warm. Awesome.

EDIT: minor weird behaviour. The service call fails when trying to set at 100% damper. 99% is fine. Error states that the number should be between 0 and 100, but 100 doesn't work.

Logger: homeassistant.components.websocket_api.http.connection Source: components/websocket_api/commands.py:230 Integration: Home Assistant WebSocket API (documentation, issues) First occurred: 8:20:57 PM (6 occurrences) Last logged: 8:22:56 PM

[140134670933952] Damper percentage must be from 0 to 100 Traceback (most recent call last): File "/usr/src/homeassistant/homeassistant/components/websocket_api/commands.py", line 230, in handle_call_service await hass.services.async_call( File "/usr/src/homeassistant/homeassistant/core.py", line 2035, in async_call response_data = await coro ^^^^^^^^^^ File "/usr/src/homeassistant/homeassistant/core.py", line 2072, in _execute_service return await target(service_call) ^^^^^^^^^^^^^^^^^^^^^^^^^^ File "/usr/src/homeassistant/homeassistant/helpers/entity_component.py", line 235, in handle_service return await service.entity_service_call( ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ File "/usr/src/homeassistant/homeassistant/helpers/service.py", line 876, in entity_service_call response_data = await _handle_entity_call( ^^^^^^^^^^^^^^^^^^^^^^^^^^ File "/usr/src/homeassistant/homeassistant/helpers/service.py", line 948, in _handle_entity_call result = await task ^^^^^^^^^^ File "/config/custom_components/airtouch2plus/Airtouch2PlusGroupEntity.py", line 87, in async_set_percentage await self._group.set_damp(percentage) File "/usr/local/lib/python3.11/site-packages/airtouch2/at2plus/At2PlusGroup.py", line 38, in set_damp settings = GroupSettings(self.status.id, GroupSetDamper.SET, GroupSetPower.UNCHANGED, new_damp) ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ File "/usr/local/lib/python3.11/site-packages/airtouch2/protocol/at2plus/messages/GroupControl.py", line 24, in init raise ValueError(f"Damper percentage must be from 0 to 100") ValueError: Damper percentage must be from 0 to 100

randellmatt commented 11 months ago

100% setting works now with the newest version. Sometimes the updated values are not reflected immediately on the air touch app, but that may be more to do with the app itself.

nathanvdh commented 11 months ago

Sorry I'm not sure about that. Group names should be working in new version now.

ctrl-freak commented 11 months ago

Group names there, percent control accurate and changing it reflects in the app.

Fantastic work 👌👌