bigmoby / fglair_for_homeassistant

❄️ FGLair heat pump controller integration
MIT License
49 stars 4 forks source link

No entity found #107

Closed AlbertoV8 closed 6 months ago

AlbertoV8 commented 7 months ago

System Health details

System Information

version core-2024.4.1
installation_type Home Assistant Container
dev false
hassio false
docker true
user root
virtualenv false
python_version 3.12.2
os_name Linux
os_version 6.6.20+rpt-rpi-2712
arch aarch64
timezone Atlantic/Canary
config_dir /config
Home Assistant Community Store GitHub API | ok -- | -- GitHub Content | ok GitHub Web | ok GitHub API Calls Remaining | 4975 Installed Version | 1.34.0 Stage | running Available Repositories | 1401 Downloaded Repositories | 5 HACS Data | ok
Home Assistant Cloud logged_in | false -- | -- can_reach_cert_server | ok can_reach_cloud_auth | ok can_reach_cloud | ok
Dashboards dashboards | 5 -- | -- resources | 1 views | 6 mode | storage
Recorder oldest_recorder_run | 31 de marzo de 2024, 20:53 -- | -- current_recorder_run | 6 de abril de 2024, 23:10 estimated_db_size | 141.28 MiB database_engine | sqlite database_version | 3.44.2
Xiaomi Miot Auto component_version | 0.7.17 -- | -- can_reach_server | ok can_reach_spec | ok logged_accounts | 1 total_devices | 1

Checklist

Describe the issue

I installed through HACS and I can log in but no entity has been found. I try to reinstall many times and to reload but nothing

Reproduction steps

  1. Add github repository to HACS
  2. Install
  3. Add integration and log in
  4. Restart Home Assistant
  5. No entities created

Debug logs

2024-04-06 23:11:16.685 ERROR (MainThread) [homeassistant.components.climate] fglair_heatpump_controller: Error on device update!
Traceback (most recent call last):
  File "/usr/src/homeassistant/homeassistant/helpers/entity_platform.py", line 698, in _async_add_entity
    await entity.async_device_update(warning=False)
  File "/usr/src/homeassistant/homeassistant/helpers/entity.py", line 1268, in async_device_update
    await self.async_update()
  File "/config/custom_components/fglair_heatpump_controller/climate.py", line 389, in async_update
    self._fan_mode = self.fan_mode
                     ^^^^^^^^^^^^^
  File "/usr/src/homeassistant/homeassistant/components/climate/__init__.py", line 328, in __getattribute__
    return super().__getattribute__(__name)
           ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
  File "/config/custom_components/fglair_heatpump_controller/climate.py", line 433, in fan_mode
    DICT_FAN_MODE[self._fujitsu_device.get_fan_speed_desc()],
                  ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
  File "/usr/local/lib/python3.12/site-packages/pyfujitsugeneral/splitac.py", line 161, in get_fan_speed_desc
    return FAN_SPEED_DICT[self.get_fan_speed()["value"]]
           ~~~~~~~~~~~~~~^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
KeyError: 9

Diagnostics dump

Not founded

Korvenwin commented 6 months ago

I'm having again this issue. At first it discover the entity, but after a few hours/days, randomly, it dissapears.

`2024-04-11 11:28:03.325 ERROR (MainThread) [homeassistant.components.climate] fglair_heatpump_controller: Error on device update! Traceback (most recent call last): File "/usr/src/homeassistant/homeassistant/helpers/entity_platform.py", line 707, in _async_add_entity await entity.async_device_update(warning=False) File "/usr/src/homeassistant/homeassistant/helpers/entity.py", line 1268, in async_device_update await self.async_update() File "/config/custom_components/fglair_heatpump_controller/climate.py", line 389, in async_update self._fan_mode = self.fan_mode ^^^^^^^^^^^^^ File "/usr/src/homeassistant/homeassistant/components/climate/init.py", line 328, in getattribute return super().getattribute(__name) ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ File "/config/custom_components/fglair_heatpump_controller/climate.py", line 433, in fan_mode DICT_FAN_MODE[self._fujitsu_device.get_fan_speed_desc()], ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ File "/usr/local/lib/python3.12/site-packages/pyfujitsugeneral/splitac.py", line 161, in get_fan_speed_desc return FAN_SPEED_DICT[self.get_fan_speed()["value"]]


KeyError: 9`
Korvenwin commented 6 months ago

I've updated to v1.3.6 and then removed and readded the device.

I'm still getting this error:

`fglair_heatpump_controller: Error on device update! Traceback (most recent call last): File "/usr/src/homeassistant/homeassistant/helpers/entity_platform.py", line 707, in _async_add_entity await entity.async_device_update(warning=False) File "/usr/src/homeassistant/homeassistant/helpers/entity.py", line 1268, in async_device_update await self.async_update() File "/config/custom_components/fglair_heatpump_controller/climate.py", line 379, in async_update self._fan_mode = self.fan_mode ^^^^^^^^^^^^^ File "/usr/src/homeassistant/homeassistant/components/climate/init.py", line 328, in getattribute return super().getattribute(__name) ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ File "/config/custom_components/fglair_heatpump_controller/climate.py", line 419, in fan_mode DICT_FAN_MODE[self._fujitsu_device.get_fan_speed_desc()], ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ File "/usr/local/lib/python3.12/site-packages/pyfujitsugeneral/splitac.py", line 161, in get_fan_speed_desc return FAN_SPEED_DICT[self.get_fan_speed()["value"]]


KeyError: 9`
bigmoby commented 6 months ago

@Korvenwin the v0.3.6 fixs turn_on/off climate service call as reported in its release notes https://github.com/bigmoby/fglair_for_homeassistant/releases/tag/v0.3.6

bigmoby commented 6 months ago

pyfujitsugeneral_test.zip Please guys, the only chance I have to try to understand the problem is to run this test on your air conditioners for me. Please follow these steps:

and give me please the logs. I believe that the value of fan_speed depends on the model of air conditioner you own.

SgtFlippy commented 6 months ago

Just updated, ran my AC through a number of settings and didn't get any new log entries. So thanks a bunch!

bigmoby commented 6 months ago

No, Sorry I'll try to explain better, you have to run it outside HA, in your PC/Mac in a shell and post here the console output.

SgtFlippy commented 6 months ago

Sorry, I thought I replied to a more general topic. I have no entitie issues, never had. I did have the issues with error logs and deprecation. Those are gone now.

Korvenwin commented 6 months ago

@Korvenwin the v0.3.6 fixs turn_on/off climate service call as reported in its release notes https://github.com/bigmoby/fglair_for_homeassistant/releases/tag/v0.3.6

I can’t call the service. There is no entity or device compatible.

I will send you the log that you’ve requested

Korvenwin commented 6 months ago

pyfujitsugeneral_test.zip Please guys, the only chance I have to try to understand the problem is to run this test on your air conditioners for me. Please follow these steps:

  • unzip this file
  • in a shell please cd [unzipped_directory_name]/pyfujitsugeneral
  • run pip3 install -r requirements.txt
  • edit splitAC.py file accordingly, please complete rows 600-601 with you FGLair account secrets
  • run python3 splitAC.py

and give me please the logs. I believe that the value of fan_speed depends on the model of air conditioner you own.

Something is not working on the script:

`PS C:\Temp\pyfujitsugeneral_test\pyfujitsugeneral> python3 .\splitAC.py

Traceback (most recent call last): File "C:\Temp\pyfujitsugeneral_test\pyfujitsugeneral\splitAC.py", line 4, in import numpy as np ModuleNotFoundError: No module named 'numpy'`

Numpy module exists:

`PS C:\Temp\pyfujitsugeneral_test\pyfujitsugeneral> pip3 install numpy

Requirement already satisfied: numpy in c:\users\user1\appdata\local\programs\python\python312\lib\site-packages (1.26.0)`

bigmoby commented 6 months ago

Try to reinstall it

Korvenwin commented 6 months ago

Try to reinstall it

As you can see on my last quote, after pip3 install numpy command I get this: Requirement already satisfied: numpy in c:\users\user1\appdata\local\programs\python\python312\lib\site-packages (1.26.0)

Is there any other way to force a reinstall of the module?

Korvenwin commented 6 months ago

I've tried to run the python script on macOS and this is the result.

I hope that could be helpful for you.

Thank you very much for your effort.

`Testing FGLairApiClient... Error fetching information from https://user-field-eu.aylanetworks.com/users/sign_in.json - Cannot connect to host user-field-eu.aylanetworks.com:443 ssl:True [SSLCertVerificationError: (1, '[SSL: CERTIFICATE_VERIFY_FAILED] certificate verify failed: unable to get local issuer certificate (_ssl.c:1000)')] Traceback (most recent call last): File "/Library/Frameworks/Python.framework/Versions/3.12/lib/python3.12/site-packages/aiohttp/connector.py", line 1025, in _wrap_create_connection return await self._loop.create_connection(*args, **kwargs) ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ File "/Library/Frameworks/Python.framework/Versions/3.12/lib/python3.12/asyncio/base_events.py", line 1149, in create_connection transport, protocol = await self._create_connection_transport( ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ File "/Library/Frameworks/Python.framework/Versions/3.12/lib/python3.12/asyncio/base_events.py", line 1182, in _create_connection_transport await waiter File "/Library/Frameworks/Python.framework/Versions/3.12/lib/python3.12/asyncio/sslproto.py", line 578, in _on_handshake_complete raise handshake_exc File "/Library/Frameworks/Python.framework/Versions/3.12/lib/python3.12/asyncio/sslproto.py", line 560, in _do_handshake self._sslobj.do_handshake() File "/Library/Frameworks/Python.framework/Versions/3.12/lib/python3.12/ssl.py", line 917, in do_handshake self._sslobj.do_handshake() ssl.SSLCertVerificationError: [SSL: CERTIFICATE_VERIFY_FAILED] certificate verify failed: unable to get local issuer certificate (_ssl.c:1000)

The above exception was the direct cause of the following exception:

Traceback (most recent call last): File "/Users/janguita/Downloads/pyfujitsugeneral_test/pyfujitsugeneral/client.py", line 209, in api_wrapper response = await self._session.post( ^^^^^^^^^^^^^^^^^^^^^^^^^ File "/Library/Frameworks/Python.framework/Versions/3.12/lib/python3.12/site-packages/aiohttp/client.py", line 578, in _request conn = await self._connector.connect( ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ File "/Library/Frameworks/Python.framework/Versions/3.12/lib/python3.12/site-packages/aiohttp/connector.py", line 544, in connect proto = await self._create_connection(req, traces, timeout) ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ File "/Library/Frameworks/Python.framework/Versions/3.12/lib/python3.12/site-packages/aiohttp/connector.py", line 944, in _createconnection , proto = await self._create_direct_connection(req, traces, timeout) ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ File "/Library/Frameworks/Python.framework/Versions/3.12/lib/python3.12/site-packages/aiohttp/connector.py", line 1257, in _create_direct_connection raise last_exc File "/Library/Frameworks/Python.framework/Versions/3.12/lib/python3.12/site-packages/aiohttp/connector.py", line 1226, in _create_direct_connection transp, proto = await self._wrap_create_connection( ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ File "/Library/Frameworks/Python.framework/Versions/3.12/lib/python3.12/site-packages/aiohttp/connector.py", line 1027, in _wrap_create_connection raise ClientConnectorCertificateError(req.connection_key, exc) from exc aiohttp.client_exceptions.ClientConnectorCertificateError: Cannot connect to host user-field-eu.aylanetworks.com:443 ssl:True [SSLCertVerificationError: (1, '[SSL: CERTIFICATE_VERIFY_FAILED] certificate verify failed: unable to get local issuer certificate (_ssl.c:1000)')]

The above exception was the direct cause of the following exception:

Traceback (most recent call last): File "/Users/janguita/Downloads/pyfujitsugeneral_test/pyfujitsugeneral/splitAC.py", line 651, in asyncio.run(main()) File "/Library/Frameworks/Python.framework/Versions/3.12/lib/python3.12/asyncio/runners.py", line 194, in run return runner.run(main) ^^^^^^^^^^^^^^^^ File "/Library/Frameworks/Python.framework/Versions/3.12/lib/python3.12/asyncio/runners.py", line 118, in run return self._loop.run_until_complete(task) ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ File "/Library/Frameworks/Python.framework/Versions/3.12/lib/python3.12/asyncio/base_events.py", line 687, in run_until_complete return future.result() ^^^^^^^^^^^^^^^ File "/Users/janguita/Downloads/pyfujitsugeneral_test/pyfujitsugeneral/splitAC.py", line 609, in main if not await client.async_authenticate(): ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ File "/Users/janguita/Downloads/pyfujitsugeneral_test/pyfujitsugeneral/client.py", line 171, in async_authenticate response = await self.api_wrapper( ^^^^^^^^^^^^^^^^^^^^^^^ File "/Users/janguita/Downloads/pyfujitsugeneral_test/pyfujitsugeneral/client.py", line 235, in api_wrapper raise FGLairGeneralException() from exception exceptions.FGLairGeneralException: FGLairBaseException has been raised Unclosed client session client_session: <aiohttp.client.ClientSession object at 0x10761b020>`

bigmoby commented 6 months ago

Are Account and password fields filled?

Korvenwin commented 6 months ago

Yes, and I've modified the password to be sure that there is no special symbols like $ or &.

AlbertoV8 commented 6 months ago

When I run the command "pip3 install -r requirements.txt" I get this error: error: externally-managed-environment

× This environment is externally managed ╰─> To install Python packages system-wide, try apt install python3-xyz, where xyz is the package you are trying to install.

If you wish to install a non-Debian-packaged Python package,
create a virtual environment using python3 -m venv path/to/venv.
Then use path/to/venv/bin/python and path/to/venv/bin/pip. Make
sure you have python3-full installed.

For more information visit http://rptl.io/venv

note: If you believe this is a mistake, please contact your Python installation or OS distribution provider. You can override this, at the risk of breaking your Python installation or OS, by passing --break-system-packages. hint: See PEP 668 for the detailed specification.

This is a Raspbian on a Raspberry PI 5.

bigmoby commented 6 months ago

@AlbertoV8 have you tried to Google it?! https://stackoverflow.com/questions/75608323/how-do-i-solve-error-externally-managed-environment-every-time-i-use-pip-3 for example...

bigmoby commented 6 months ago

Yes, and I've modified the password to be sure that there is no special symbols like $ or &.

@Korvenwin different region than eu?!

Korvenwin commented 6 months ago

I live in Spain so my region is Europe.

bigmoby commented 6 months ago

@Korvenwin https://stackoverflow.com/questions/52805115/certificate-verify-failed-unable-to-get-local-issuer-certificate it's an issue related in your python environment... came on guys, a little bit of proactivity 😉

Korvenwin commented 6 months ago

I'm sorry, I'm not programmer. This is the result now:

Testing FGLairApiClient... devices ---->>> ['AC000W004285832'] device name ---->>> %s {'value': 'Salón sótano', 'key': 641912256} op_status_desc ---->>> Normal display_temperature ---->>> {'value': 6800, 'key': 641912257} get_fan_speed ---->>> {'value': 9, 'key': 641912262} Traceback (most recent call last): File "/Users/janguita/Downloads/pyfujitsugeneral_test/pyfujitsugeneral/splitAC.py", line 651, in asyncio.run(main()) File "/Library/Frameworks/Python.framework/Versions/3.12/lib/python3.12/asyncio/runners.py", line 194, in run return runner.run(main) ^^^^^^^^^^^^^^^^ File "/Library/Frameworks/Python.framework/Versions/3.12/lib/python3.12/asyncio/runners.py", line 118, in run return self._loop.run_until_complete(task) ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ File "/Library/Frameworks/Python.framework/Versions/3.12/lib/python3.12/asyncio/base_events.py", line 687, in run_until_complete return future.result() ^^^^^^^^^^^^^^^ File "/Users/janguita/Downloads/pyfujitsugeneral_test/pyfujitsugeneral/splitAC.py", line 636, in main get_fan_speed_desc = splitac.get_fan_speed_desc() ^^^^^^^^^^^^^^^^^^^^^^^^^^^^ File "/Users/janguita/Downloads/pyfujitsugeneral_test/pyfujitsugeneral/splitAC.py", line 164, in get_fan_speed_desc return FAN_SPEED_DICT[self.get_fan_speed()["value"]]


KeyError: 9
Unclosed client session
client_session: <aiohttp.client.ClientSession object at 0x106bb7170>
Unclosed connector
connections: ['[(<aiohttp.client_proto.ResponseHandler object at 0x107010c50>, 16478.7519025)]', '[(<aiohttp.client_proto.ResponseHandler object at 0x1070110d0>, 16479.361693458)]']
connector: <aiohttp.connector.TCPConnector object at 0x107004410>
bigmoby commented 6 months ago

@Korvenwin good job, great! 🚀 Oook...well... seems to me that your ac model has a different key-value mapping than the "usual" model! ...and now the fun part @Korvenwin 😉you should identify this map...how?! Following these steps: turn on your ac with the standard app, set the fan speed and please annotate it, after that run the python script and annotate the numeric value for each of different fan velocity (your case now is 9). Ok for you?

Korvenwin commented 6 months ago

device name ---->>> %s {'value': 'Salón sótano', 'key': 641912256} op_status_desc ---->>> Normal display_temperature ---->>> {'value': 6800, 'key': 641912257} get_fan_speed ---->>> {'value': 0, 'key': 641912262} get_fan_speed_desc ---->>> Quiet

device name ---->>> %s {'value': 'Salón sótano', 'key': 641912256} op_status_desc ---->>> Normal display_temperature ---->>> {'value': 6800, 'key': 641912257} get_fan_speed ---->>> {'value': 1, 'key': 641912262} get_fan_speed_desc ---->>> Low

device name ---->>> %s {'value': 'Salón sótano', 'key': 641912256} op_status_desc ---->>> Normal display_temperature ---->>> {'value': 6800, 'key': 641912257} get_fan_speed ---->>> {'value': 2, 'key': 641912262} get_fan_speed_desc ---->>> Medium

device name ---->>> %s {'value': 'Salón sótano', 'key': 641912256} op_status_desc ---->>> Normal display_temperature ---->>> {'value': 6800, 'key': 641912257} get_fan_speed ---->>> {'value': 3, 'key': 641912262} get_fan_speed_desc ---->>> High

device name ---->>> %s {'value': 'Salón sótano', 'key': 641912256} op_status_desc ---->>> Normal display_temperature ---->>> {'value': 6800, 'key': 641912257} get_fan_speed ---->>> {'value': 4, 'key': 641912262} get_fan_speed_desc ---->>> Auto

AlbertoV8 commented 6 months ago

@AlbertoV8 have you tried to Google it?! https://stackoverflow.com/questions/75608323/how-do-i-solve-error-externally-managed-environment-every-time-i-use-pip-3 for example...>

Sorry I made it quickly and didn't search... Today I have made my homework and I required to install the aiohttp module and the async-timeout module to make it work and finally it did... This is my log:

Testing FGLairApiClient... devices ---->>> ['AC000W004293902'] device name ---->>> %s {'value': 'Aire-Salon', 'key': 656562117} op_status_desc ---->>> Normal display_temperature ---->>> {'value': 7400, 'key': 656562118} get_fan_speed ---->>> {'value': 9, 'key': 656562123} Traceback (most recent call last): File "/tmp/pyfuji/pyfujitsugeneral/splitAC.py", line 651, in asyncio.run(main()) File "/usr/lib/python3.11/asyncio/runners.py", line 190, in run return runner.run(main) ^^^^^^^^^^^^^^^^ File "/usr/lib/python3.11/asyncio/runners.py", line 118, in run return self._loop.run_until_complete(task) ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ File "/usr/lib/python3.11/asyncio/base_events.py", line 653, in run_until_complete return future.result() ^^^^^^^^^^^^^^^ File "/tmp/pyfuji/pyfujitsugeneral/splitAC.py", line 636, in main get_fan_speed_desc = splitac.get_fan_speed_desc() ^^^^^^^^^^^^^^^^^^^^^^^^^^^^ File "/tmp/pyfuji/pyfujitsugeneral/splitAC.py", line 164, in get_fan_speed_desc return FAN_SPEED_DICT[self.get_fan_speed()["value"]]


KeyError: 9
Unclosed client session
client_session: <aiohttp.client.ClientSession object at 0x7fff81b16050>
Unclosed connector
connections: ['[(<aiohttp.client_proto.ResponseHandler object at 0x7fff81dd2270>, 172499.33543838)]', '[(<aiohttp.client_proto.ResponseHandler object at 0x7fff81dd2c80>, 172500.017175536)]']
connector: <aiohttp.connector.TCPConnector object at 0x7fff81b16090>

Also some useful information: I live in Canary Islands, Spain. I bought my A/C on 04/2021 to Mediamarkt and in my receipt the model is: 3NGF7075-ASY35UIKP This A/C came without WIFI, so this year I bought the Fujitsu UTY-TFSXF2 WIFI module and I installed it.

I hope this would be useful. Also in my FGLair app i haven't found the fan speed option. Thanks for your time.

bigmoby commented 6 months ago

device name ---->>> %s {'value': 'Salón sótano', 'key': 641912256} op_status_desc ---->>> Normal display_temperature ---->>> {'value': 6800, 'key': 641912257} get_fan_speed ---->>> {'value': 0, 'key': 641912262} get_fan_speed_desc ---->>> Quiet

device name ---->>> %s {'value': 'Salón sótano', 'key': 641912256} op_status_desc ---->>> Normal display_temperature ---->>> {'value': 6800, 'key': 641912257} get_fan_speed ---->>> {'value': 1, 'key': 641912262} get_fan_speed_desc ---->>> Low

device name ---->>> %s {'value': 'Salón sótano', 'key': 641912256} op_status_desc ---->>> Normal display_temperature ---->>> {'value': 6800, 'key': 641912257} get_fan_speed ---->>> {'value': 2, 'key': 641912262} get_fan_speed_desc ---->>> Medium

device name ---->>> %s {'value': 'Salón sótano', 'key': 641912256} op_status_desc ---->>> Normal display_temperature ---->>> {'value': 6800, 'key': 641912257} get_fan_speed ---->>> {'value': 3, 'key': 641912262} get_fan_speed_desc ---->>> High

device name ---->>> %s {'value': 'Salón sótano', 'key': 641912256} op_status_desc ---->>> Normal display_temperature ---->>> {'value': 6800, 'key': 641912257} get_fan_speed ---->>> {'value': 4, 'key': 641912262} get_fan_speed_desc ---->>> Auto

@Korvenwin and for the value of 9?!

Korvenwin commented 6 months ago

device name ---->>> %s {'value': 'Salón sótano', 'key': 641912256} op_status_desc ---->>> Normal display_temperature ---->>> {'value': 6800, 'key': 641912257} get_fan_speed ---->>> {'value': 0, 'key': 641912262} get_fan_speed_desc ---->>> Quiet device name ---->>> %s {'value': 'Salón sótano', 'key': 641912256} op_status_desc ---->>> Normal display_temperature ---->>> {'value': 6800, 'key': 641912257} get_fan_speed ---->>> {'value': 1, 'key': 641912262} get_fan_speed_desc ---->>> Low device name ---->>> %s {'value': 'Salón sótano', 'key': 641912256} op_status_desc ---->>> Normal display_temperature ---->>> {'value': 6800, 'key': 641912257} get_fan_speed ---->>> {'value': 2, 'key': 641912262} get_fan_speed_desc ---->>> Medium device name ---->>> %s {'value': 'Salón sótano', 'key': 641912256} op_status_desc ---->>> Normal display_temperature ---->>> {'value': 6800, 'key': 641912257} get_fan_speed ---->>> {'value': 3, 'key': 641912262} get_fan_speed_desc ---->>> High device name ---->>> %s {'value': 'Salón sótano', 'key': 641912256} op_status_desc ---->>> Normal display_temperature ---->>> {'value': 6800, 'key': 641912257} get_fan_speed ---->>> {'value': 4, 'key': 641912262} get_fan_speed_desc ---->>> Auto

@Korvenwin and for the value of 9?!

I've been trying all modes and speeds and all of them are from 0 to 4.

Mode 9 appears to be something like a "no-mode" or a mode set just after plug in the A/C to the outlet.

In fact, in the app didn't appear the fan speed button just after plug in. I had to set speed on the remote control, and then, it appears fan speed on the app.

After this, I've thought it might be a good idea to delete and add again the integration and, bingo!!... it appears now.

So my conclusion is that it is not a good idea unplug the A/C ever, because after do it, sometimes it disappear on the own FG app and as you can see, the initial mode is not "standard".

Please have another beer to my health.

AlbertoV8 commented 6 months ago

device name ---->>> %s {'value': 'Salón sótano', 'key': 641912256} op_status_desc ---->>> Normal display_temperature ---->>> {'value': 6800, 'key': 641912257} get_fan_speed ---->>> {'value': 0, 'key': 641912262} get_fan_speed_desc ---->>> Quiet device name ---->>> %s {'value': 'Salón sótano', 'key': 641912256} op_status_desc ---->>> Normal display_temperature ---->>> {'value': 6800, 'key': 641912257} get_fan_speed ---->>> {'value': 1, 'key': 641912262} get_fan_speed_desc ---->>> Low device name ---->>> %s {'value': 'Salón sótano', 'key': 641912256} op_status_desc ---->>> Normal display_temperature ---->>> {'value': 6800, 'key': 641912257} get_fan_speed ---->>> {'value': 2, 'key': 641912262} get_fan_speed_desc ---->>> Medium device name ---->>> %s {'value': 'Salón sótano', 'key': 641912256} op_status_desc ---->>> Normal display_temperature ---->>> {'value': 6800, 'key': 641912257} get_fan_speed ---->>> {'value': 3, 'key': 641912262} get_fan_speed_desc ---->>> High device name ---->>> %s {'value': 'Salón sótano', 'key': 641912256} op_status_desc ---->>> Normal display_temperature ---->>> {'value': 6800, 'key': 641912257} get_fan_speed ---->>> {'value': 4, 'key': 641912262} get_fan_speed_desc ---->>> Auto

@Korvenwin and for the value of 9?!

I've been trying all modes and speeds and all of them are from 0 to 4.

Mode 9 appears to be something like a "no-mode" or a mode set just after plug in the A/C to the outlet.

In fact, in the app didn't appear the fan speed button just after plug in. I had to set speed on the remote control, and then, it appears fan speed on the app.

After this, I've thought it might be a good idea to delete and add again the integration and, bingo!!... it appears now.

So my conclusion is that it is not a good idea unplug the A/C ever, because after do it, sometimes it disappear on the own FG app and as you can see, the initial mode is not "standard".

Please have another beer to my health.

Great!!! You got It!

It also works for me. When I change the fan speed manually with the remote control, I only have to reaload the integration and the entiry appears! Wonderful! Thanks you!

I think probably the key '9' is auto fan mode.

Korvenwin commented 6 months ago

No, Auto is key 4.

It is something related to de FG system just after connecting to power.

AlbertoV8 commented 6 months ago

Sorry I closed the issue, I did not know how I made this, I don't know how github works, I am new in this world...

bigmoby commented 6 months ago

Thank you so much @Korvenwin for your analysis and "beer" too!!! 🙌 I really appreciate it! 🙏 Ok, guys so...I could associate the '9' value with...I have to think on that! 🤔

bigmoby commented 6 months ago

@Korvenwin @AlbertoV8 please try this https://github.com/bigmoby/fglair_for_homeassistant/releases/tag/v0.3.7

Korvenwin commented 6 months ago

Appears as not found. I guess you removed it due to some bug

bigmoby commented 6 months ago

Yes sorry 😓

Korvenwin commented 6 months ago

Hi again.

I'm getting a new error and the entity is not available again.

I think that could be again the famous 'value 9' because I press the Auto Mode and in this mode, I can't control the speed.

`2024-04-22 10:02:03.346 ERROR (MainThread) [homeassistant.components.climate] fglair_heatpump_controller: Error on device update! Traceback (most recent call last): File "/usr/src/homeassistant/homeassistant/helpers/entity_platform.py", line 707, in _async_add_entity await entity.async_device_update(warning=False) File "/usr/src/homeassistant/homeassistant/helpers/entity.py", line 1268, in async_device_update await self.async_update() File "/config/custom_components/fglair_heatpump_controller/climate.py", line 379, in async_update self._fan_mode = self.fan_mode ^^^^^^^^^^^^^ File "/usr/src/homeassistant/homeassistant/components/climate/init.py", line 328, in getattribute return super().getattribute(__name) ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ File "/config/custom_components/fglair_heatpump_controller/climate.py", line 419, in fan_mode DICT_FAN_MODE[self._fujitsu_device.get_fan_speed_desc()], ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ File "/usr/local/lib/python3.12/site-packages/pyfujitsugeneral/splitac.py", line 161, in get_fan_speed_desc return FAN_SPEED_DICT[self.get_fan_speed()["value"]]


KeyError: 7
                  ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
  File "/usr/local/lib/python3.12/site-packages/pyfujitsugeneral/splitac.py", line 161, in get_fan_speed_desc
    return FAN_SPEED_DICT[self.get_fan_speed()["value"]]
           ~~~~~~~~~~~~~~^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
KeyError: 7`
bigmoby commented 6 months ago

hi @Korvenwin unfortunately I have some unsolved problem (maybe different python version) between the integration and its underlying library. I suppose your AC maps value 7 (seven) with auto fan speed...but I don't understand why in your test results as

get_fan_speed ---->>> {'value': 4, 'key': 641912262}
get_fan_speed_desc ---->>> Auto

Please, could have you a check again?

Korvenwin commented 6 months ago

I'm start to thinking that the problem is not your integration but the A/A equipment.

Somehow he goes crazy after losing the WiFi communication. Take a look to the results of your test script, there is a new key value 7!:

Testing FGLairApiClient...
devices ---->>>
['AC000W004285832']
device name ---->>> %s {'value': 'Salón sótano', 'key': 641912256}
op_status_desc ---->>> Normal
display_temperature ---->>> {'value': 7000, 'key': 641912257}
get_fan_speed ---->>> {'value': 7, 'key': 641912262}
Traceback (most recent call last):
  File "C:\Temp\pyfujitsugeneral_test\pyfujitsugeneral\splitAC.py", line 651, in <module>
    asyncio.run(main())
  File "C:\Program Files\WindowsApps\PythonSoftwareFoundation.Python.3.12_3.12.1008.0_x64__qbz5n2kfra8p0\Lib\asyncio\runners.py", line 194, in run
    return runner.run(main)
           ^^^^^^^^^^^^^^^^
  File "C:\Program Files\WindowsApps\PythonSoftwareFoundation.Python.3.12_3.12.1008.0_x64__qbz5n2kfra8p0\Lib\asyncio\runners.py", line 118, in run
    return self._loop.run_until_complete(task)
           ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
  File "C:\Program Files\WindowsApps\PythonSoftwareFoundation.Python.3.12_3.12.1008.0_x64__qbz5n2kfra8p0\Lib\asyncio\base_events.py", line 687, in run_until_complete
    return future.result()
           ^^^^^^^^^^^^^^^
  File "C:\Temp\pyfujitsugeneral_test\pyfujitsugeneral\splitAC.py", line 636, in main
    get_fan_speed_desc = splitac.get_fan_speed_desc()
                         ^^^^^^^^^^^^^^^^^^^^^^^^^^^^
  File "C:\Temp\pyfujitsugeneral_test\pyfujitsugeneral\splitAC.py", line 164, in get_fan_speed_desc
    return FAN_SPEED_DICT[self.get_fan_speed()["value"]]
           ~~~~~~~~~~~~~~^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
KeyError: 7

I've disconnected the equipment from the power, and connected again.

Now it has returned to the normal state and it appears (after a reload) in the integration:

Testing FGLairApiClient...
devices ---->>>
['AC000W004285832']
device name ---->>> %s {'value': 'Salón sótano', 'key': 641912256}
op_status_desc ---->>> Normal
display_temperature ---->>> {'value': 65535, 'key': 641912257}
get_fan_speed ---->>> {'value': 4, 'key': 641912262}
get_fan_speed_desc ---->>> Auto
PS C:\Temp\pyfujitsugeneral_test\pyfujitsugeneral>
bigmoby commented 6 months ago

Ops wow! 😅 ...ok, this evening I'll try to manage in a better way the exceptions thrown...and I hope the incompatibility issue too between the library and the integration

Korvenwin commented 6 months ago

Ok, by now, I've created an automation to switch off/on power when the equipment is not available for 30 minutes. XD

bigmoby commented 6 months ago

Hi @Korvenwin @AlbertoV8 any mitigations after the release v0.3.7 ?

AlbertoV8 commented 6 months ago

Hi @Korvenwin @AlbertoV8 any mitigations after the release v0.3.7 ?

After some days the entity dissapeared, I think because of I rebooted the Raspberry and after install the new update, there is still no entity, this is the log:

2024-05-01 10:46:05.757 ERROR (MainThread) [homeassistant.components.climate] fglair_heatpump_controller: Error on device update! Traceback (most recent call last): File "/usr/src/homeassistant/homeassistant/helpers/entity_platform.py", line 698, in _async_add_entity await entity.async_device_update(warning=False) File "/usr/src/homeassistant/homeassistant/helpers/entity.py", line 1268, in async_device_update await self.async_update() File "/config/custom_components/fglair_heatpump_controller/climate.py", line 379, in async_update self._fan_mode = self.fan_mode ^^^^^^^^^^^^^ File "/usr/src/homeassistant/homeassistant/components/climate/init.py", line 328, in getattribute return super().getattribute(__name) ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ File "/config/custom_components/fglair_heatpump_controller/climate.py", line 419, in fan_mode DICT_FAN_MODE[self._fujitsu_device.get_fan_speed_desc()], ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ File "/usr/local/lib/python3.12/site-packages/pyfujitsugeneral/splitAC.py", line 175, in get_fan_speed_desc return FAN_SPEED_DICT[fan_speed]


KeyError: 5

If I turn on with the FGLair app the fan speed doesnt appear and there isnt entity found. When I select the fan speed with the remote control the fan speed appear  in the FGLair app and the entity IS found in Home assistant. I think that there is a bug in the FGlair that makes  no posible to select fan speed before you select It manually with the remote control and there is nothing we can do... Maybe makes unavaible to select the speed in your integration until we select with the remote control the speed manually but having avaible the rest of the settings?

Thanks @bigmoby for your time!
Korvenwin commented 6 months ago

I resolved the problem using the remote control and setting the fan speed with this. Then a reload on the integration, made the system works again.

bigmoby commented 6 months ago

Hi @Korvenwin @AlbertoV8 I just released v0.3.9 in order to be compliant with fan_speed value 5.

Korvenwin commented 6 months ago

The electricity went out tonight and my equipment again has lost the fan speed setting, and now it is not available. It appear that it is in value 7 again. I've installed the most recent version: v0.3.10 and doesn't handle this value. It appears that I cannot do anything remotely so the only solution is to use the remote control and set FAN to a valid value manually :(

The error is:

`Traceback (most recent call last): File "/usr/src/homeassistant/homeassistant/helpers/entity_platform.py", line 707, in _async_add_entity await entity.async_device_update(warning=False) File "/usr/src/homeassistant/homeassistant/helpers/entity.py", line 1293, in async_device_update await self.async_update() File "/config/custom_components/fglair_heatpump_controller/climate.py", line 393, in async_update self._fan_mode = self.fan_mode ^^^^^^^^^^^^^ File "/usr/src/homeassistant/homeassistant/components/climate/init.py", line 324, in getattribute return super().getattribute(__name) ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ File "/config/custom_components/fglair_heatpump_controller/climate.py", line 433, in fan_mode DICT_FAN_MODE[self._fujitsu_device.get_fan_speed_desc()], ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ File "/usr/local/lib/python3.12/site-packages/pyfujitsugeneral/splitAC.py", line 182, in get_fan_speed_desc return FAN_SPEED_DICT[fan_speed]


KeyError: 7`
bigmoby commented 6 months ago

Hi @Korvenwin please try with https://github.com/bigmoby/fglair_for_homeassistant/releases/tag/v0.3.11

Korvenwin commented 6 months ago

@bigmoby installed, but I'm not sure how to force the "value 7". When the fan adjustment is missing, I will check that everything is fine. THANK YOU