Closed letrouf closed 1 week ago
Hello,
Almost the same problem here, but the climate control is working even though the button turns "Unavailable" each time I press on it. After an integration reload I can see the state of the climate control again, start it or stop it. But then the button is unavailable again.
Here are the logs:
Logger: homeassistant.components.websocket_api.http.connection
Source: components/websocket_api/commands.py:241
integration: Home Assistant WebSocket API (documentation, issues)
First occurred: July 22, 2024 at 15:52:19 (4 occurrences)
Last logged: 10:23:50
[139861665627968] Unexpected exception
[139862444408352] Unexpected exception
[139861224117952] Unexpected exception
Traceback (most recent call last):
File "/config/custom_components/nissan_carwings/api.py", line 234, in async_set_climate
await response.get_start_climate_control_result(result_key)
File "/usr/local/lib/python3.12/site-packages/pycarwings3/pycarwings3.py", line 331, in get_start_climate_control_result
response = await self.session._request_with_retry(
^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
File "/usr/local/lib/python3.12/site-packages/pycarwings3/pycarwings3.py", line 135, in _request_with_retry
ret = await self._request(endpoint, params)
^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
File "/usr/local/lib/python3.12/site-packages/pycarwings3/pycarwings3.py", line 217, in _request
raise CarwingsError
pycarwings3.pycarwings3.CarwingsError
The above exception was the direct cause of the following exception:
Traceback (most recent call last):
File "/usr/src/homeassistant/homeassistant/components/websocket_api/commands.py", line 241, in handle_call_service
response = await hass.services.async_call(
^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
File "/usr/src/homeassistant/homeassistant/core.py", line 2731, in async_call
response_data = await coro
^^^^^^^^^^
File "/usr/src/homeassistant/homeassistant/core.py", line 2774, in _execute_service
return await target(service_call)
^^^^^^^^^^^^^^^^^^^^^^^^^^
File "/usr/src/homeassistant/homeassistant/helpers/service.py", line 999, in entity_service_call
single_response = await _handle_entity_call(
^^^^^^^^^^^^^^^^^^^^^^^^^^
File "/usr/src/homeassistant/homeassistant/helpers/service.py", line 1071, in _handle_entity_call
result = await task
^^^^^^^^^^
File "/config/custom_components/nissan_carwings/switch.py", line 68, in async_turn_on
await client.async_set_climate(switch_on=True)
File "/config/custom_components/nissan_carwings/api.py", line 258, in async_set_climate
raise NissanCarwingsApiClientError(
custom_components.nissan_carwings.api.NissanCarwingsApiClientError: Error fetching data - CarwingsError:
@letrouf this works as intended: the button turns unavailable while the operation is in progress. And, because turning the AC on is a heavily async operation (can take some time, 5-10 minutes), the button will stick unavailable.
Because the operation cannot be cancelled anyway, updating the button "available" state reflects that. The button will be automatically enabled as soon as the car has acknowledged that the operation was successful (which will happen a couple of minutes after the AC has been actually turned on or off).
Could you please test that once again and just wait longer to see if the button state will be updated correctly?
@letrouf this works as intended: the button turns unavailable while the operation is in progress. And, because turning the AC on is a heavily async operation (can take some time, 5-10 minutes), the button will stick unavailable.
Because the operation cannot be cancelled anyway, updating the button "available" state reflects that. The button will be automatically enabled as soon as the car has acknowledged that the operation was successful (which will happen a couple of minutes after the AC has been actually turned on or off).
Could you please test that once again and just wait longer to see if the button state will be updated correctly?
If I may answer even though the question is not for me: the button stayed unavailable for several hours until I manually reloaded the integration, even though the climate control correctly started and stopped when the desired temperature was reached in the car.
The behavior you describe is exactly what happen with the "request update" button.
@lootre ok, thanks for the update here. I will take a look into that, it seems to be a bug then..
Same for me. As this morning the button is still unavailable and the car never turned on AC. Usually when it does I have the notification from the Nissan app within one minute.
Le mar. 23 juil. 2024, 12:00, Remus Lazar @.***> a écrit :
@lootre https://github.com/lootre ok, thanks for the update here. I will take a look into that, it seems to be a bug then..
— Reply to this email directly, view it on GitHub https://github.com/remuslazar/homeassistant-carwings/issues/13#issuecomment-2244778162, or unsubscribe https://github.com/notifications/unsubscribe-auth/BC255AYJITMUHEEYRDBKVKTZNYSTLAVCNFSM6AAAAABLI4U3X6VHI2DSMVQWIX3LMV43OSLTON2WKQ3PNVWWK3TUHMZDENBUG43TQMJWGI . You are receiving this because you were mentioned.Message ID: @.***>
Hello there. Would you need me to do more testing ?
For me it turns on AC, but remains unavailable until I reboot HA.
I too experience this same issue: After turning on the A/C-switch, it becomes 'unavailable' immediately, it does turn on the A/C in the car however.
For the moment I've made this workaround using an automation, it automatically reloads the Nissan Carwings-integration 20 minutes after switching the A/C on. This 20 minutes ensures the A/C in the car has turned off again, because otherwise reloading the integration will result in the A/C-switch being 'on' instead of 'off'
Trigger: When Nissan Leaf Climate Control changes to Unavailable (Which happens right away after switching A/C on) Then do:
I will definitely take a deeper look at that, it seems that it's a bug in the integration. Currently being busy with other tasks, this could take some time, though.
Thanks, no rush, your work is already amasing.
If this can help, i've noticed an error when activating the climate control switch : "error fetching data Carwings error".
@letrouf @JorenVandenBergh could you please test if the current release fixes all issues here? I have reworked the whole ac logic to handle errors gracefully. Now also the switch should not become unavailable any more which was kind-of confusing anyway.
Hi. Thanks for the update. Turns out, the AC works fine now but the switch stays unavailable after. I made an automation to reload integration the switch becomes unavailable to outpass this issue. Thank you again though
@letrouf are you sure that you're using the current version? should render 0.1.5 on the integration info page
Indeed, even after updating yesterday the files it showed 0.1.4. I updated all the files again but after restarting I got a new error :
Enregistreur: homeassistant.util.loop Source: util/loop.py:77 S'est produit pour la première fois: 14:28:01 (1 occurrences) Dernier enregistrement: 14:28:01
Detected blocking call to import_module with args ('custom_components.nissan_carwings',) in /usr/src/homeassistant/homeassistant/loader.py, line 1067: ComponentProtocol, importlib.import_module(self.pkg_path) inside the event loop; This is causing stability issues. Please create a bug report at https://github.com/home-assistant/core/issues?q=is%3Aopen+is%3Aissue For developers, please see https://developers.home-assistant.io/docs/asyncio_blocking_operations/#import_module Traceback (most recent call last): File "
and :
Enregistreur: homeassistant.setup Source: setup.py:334 S'est produit pour la première fois: 14:28:01 (1 occurrences) Dernier enregistrement: 14:28:01
Setup failed for custom integration 'nissan_carwings': Unable to import component: Exception importing custom_components.nissan_carwings
Traceback (most recent call last):
File "/usr/src/homeassistant/homeassistant/loader.py", line 1067, in _get_component
ComponentProtocol, importlib.import_module(self.pkg_path)
^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
File "/usr/src/homeassistant/homeassistant/util/loop.py", line 200, in protected_loop_func
return func(*args, **kwargs)
^^^^^^^^^^^^^^^^^^^^^
File "/usr/local/lib/python3.12/importlib/init.py", line 90, in import_module
return _bootstrap._gcd_import(name[level:], package, level)
^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
File "
^
SyntaxError: invalid character '·' (U+00B7)
The above exception was the direct cause of the following exception:
Traceback (most recent call last): File "/usr/src/homeassistant/homeassistant/loader.py", line 1007, in async_get_component comp = await self.hass.async_add_import_executor_job( ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ File "/usr/local/lib/python3.12/concurrent/futures/thread.py", line 58, in run result = self.fn(*self.args, **self.kwargs) ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ File "/usr/src/homeassistant/homeassistant/loader.py", line 1078, in _get_component raise ImportError(f"Exception importing {self.pkg_path}") from err ImportError: Exception importing custom_components.nissan_carwings
During handling of the above exception, another exception occurred:
Traceback (most recent call last):
File "/usr/src/homeassistant/homeassistant/loader.py", line 1067, in _get_component
ComponentProtocol, importlib.import_module(self.pkg_path)
^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
File "/usr/src/homeassistant/homeassistant/util/loop.py", line 200, in protected_loop_func
return func(*args, **kwargs)
^^^^^^^^^^^^^^^^^^^^^
File "/usr/local/lib/python3.12/importlib/init.py", line 90, in import_module
return _bootstrap._gcd_import(name[level:], package, level)
^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
File "
^
SyntaxError: invalid character '·' (U+00B7)
The above exception was the direct cause of the following exception:
Traceback (most recent call last): File "/usr/src/homeassistant/homeassistant/setup.py", line 334, in _async_setup_component component = await integration.async_get_component() ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ File "/usr/src/homeassistant/homeassistant/loader.py", line 1027, in async_get_component self._component_future.result() File "/usr/src/homeassistant/homeassistant/loader.py", line 1019, in async_get_component comp = self._get_component() ^^^^^^^^^^^^^^^^^^^^^ File "/usr/src/homeassistant/homeassistant/loader.py", line 1078, in _get_component raise ImportError(f"Exception importing {self.pkg_path}") from err ImportError: Exception importing custom_components.nissan_carwings
Probably I did wrong something. I can't even delete the integration.
@letrouf I think you have messed up with the files, maybe downloaded the HTML GitHub page instead of the real script or something. You can download a ZIP archive for the current release from here: https://github.com/remuslazar/homeassistant-carwings/releases/tag/v0.1.5
Ok thank you. I had downloaded an HTML file indeed. I am on 0.1.5 now. AC works fine and button behavior is normal (comes back to off when I got Nissan's app confirmation).
Thank you for your work.
Thanks for the update! The button should reflect the current state of the AC but there are some bugs I have already fixed in the master branch. I will test that and create a new release then.
Hey ! I also tested the new version and unfortunately, the remote climate control is not working at all anymore...! The button stays unavailable, even though I reloaded the integration and restarted Home Assistant.
Here are the logs:
This error originated from a custom integration.
Logger: custom_components.nissan_carwings
Source: helpers/update_coordinator.py:386
integration: Nissan Connect (Carwings) (documentation, issues)
First occurred: 15:00:30 (3 occurrences)
Last logged: 15:04:15
Error fetching nissan_carwings data: Error fetching data - AttributeError: 'CarwingsLatestClimateControlStatusResponse' object has no attribute '_operation_date_and_time'
This error originated from a custom integration.
Logger: custom_components.nissan_carwings
Source: custom_components/nissan_carwings/api.py:216
integration: Nissan Connect (Carwings) (documentation, issues)
First occurred: 15:00:30 (9 occurrences)
Last logged: 15:34:23
Error fetching data - AttributeError: 'CarwingsLatestClimateControlStatusResponse' object has no attribute '_operation_date_and_time'
@lootre thanks for the error log, I was able to spot the bug. It's already fixed in the new release: https://github.com/remuslazar/homeassistant-carwings/releases/tag/v0.1.6
Could u please test that again if it works now?
I can confirm A/C (both the Switch in HA as the actual logic) works perfect for my 2018 European Leaf in 0.1.6!
Thanks for all your work on this integration!
Yes it's much better now ! Thank you very much for your amazing work !
Sounds great! I will close this issue now.. finally! :)
System Health details
System Information
Home Assistant Community Store
GitHub API | ok -- | -- GitHub Content | ok GitHub Web | ok GitHub API Calls Remaining | 5000 Installed Version | 1.34.0 Stage | running Available Repositories | 1399 Downloaded Repositories | 37 HACS Data | okHome Assistant Cloud
logged_in | true -- | -- subscription_expiration | 27 juillet 2024 à 02:00 relayer_connected | true relayer_region | eu-central-1 remote_enabled | true remote_connected | true alexa_enabled | false google_enabled | true remote_server | eu-central-1-14.ui.nabu.casa certificate_status | ready instance_id | 2e63daec2c5345ed83b2d196eabafefd can_reach_cert_server | ok can_reach_cloud_auth | ok can_reach_cloud | okHome Assistant Supervisor
host_os | Home Assistant OS 12.4 -- | -- update_channel | stable supervisor_version | supervisor-2024.06.2 agent_version | 1.6.0 docker_version | 26.1.4 disk_total | 234.5 GB disk_used | 142.1 GB healthy | true supported | true host_connectivity | true supervisor_connectivity | true ntp_synchronized | true virtualization | board | green supervisor_api | ok version_api | ok installed_addons | Mosquitto broker (6.4.1), Samba share (12.3.1), Node-RED (18.0.4), Terminal & SSH (9.14.0), File editor (5.8.0), Silicon Labs Flasher (0.2.3), Apache2 Minimal with MariaDB Client (2.8.3), Home Assistant Google Drive Backup (0.112.1), tiko / Mon Pilotage Elec (1.4.7), Zigbee2MQTT (1.39.0-1), Studio Code Server (5.15.0), openWakeWord (1.10.0), Advanced SSH & Web Terminal (18.0.0)Dashboards
dashboards | 4 -- | -- resources | 18 views | 17 mode | storageRecorder
oldest_recorder_run | 12 juillet 2024 à 20:06 -- | -- current_recorder_run | 20 juillet 2024 à 19:38 estimated_db_size | 260.09 MiB database_engine | sqlite database_version | 3.45.3Xiaomi Miot Auto
component_version | 0.7.19 -- | -- can_reach_server | ok can_reach_spec | ok logged_accounts | 1 total_devices | 2Checklist
Describe the issue
All the entities work like a charm except for the climate control button. If I click on it, nothing happens in my car and the button becomes unavailable until I reload the integration. It worked with the previous Nissan Leaf integration though. My car is a 2018 leaf. I tried to provide as much info as I can, let me know if you need anything else. And thank you if you take some time to look into my issue.
John
Reproduction steps
...
Debug logs
Diagnostics dump
No response