arifwn / homeassistant-whatspie-integration

Send HomeAssistant Notifications to WhatsApp using WhatsPie
GNU General Public License v3.0
2 stars 3 forks source link

Unknown Error when running on Home Assistant 2024.10.1 #5

Closed twistedlizzard closed 1 week ago

twistedlizzard commented 1 week ago

Installed through HACS and set up as per instructions. I've paired my device in Whatspie and tested successfully in the web interface In Home Assistant I've tried running the action multiple times - it keeps coming back with an Unknown Error.

configuration.yaml:

notify:
  - name: send_wa
    platform: whatspie
    api_token: "REDACTED"
    from_number: "27REDACTED"
    country_code: "27"

I've checked the log files - this is what I can find:

Logger: homeassistant.components.websocket_api.http.connection Source: custom_components/whatspie/notify.py:33 integration: Home Assistant WebSocket API (documentation, issues) First occurred: 13:07:42 (6 occurrences) Last logged: 13:13:22

[548181839872] Error handling message: Unknown error (unknown_error) [User] from [IP] (Mozilla/5.0 (Windows NT 10.0; Win64; x64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/129.0.0.0 Safari/537.36) [547199578272] Error handling message: Unknown error (unknown_error) [User] from [IP] (Mozilla/5.0 (Windows NT 10.0; Win64; x64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/129.0.0.0 Safari/537.36) Traceback (most recent call last): File "/usr/src/homeassistant/homeassistant/components/websocket_api/decorators.py", line 28, in _handle_async_response await func(hass, connection, msg) File "/usr/src/homeassistant/homeassistant/components/websocket_api/commands.py", line 816, in handle_execute_script script_result = await script_obj.async_run( ^^^^^^^^^^^^^^^^^^^^^^^^^^^ File "/usr/src/homeassistant/homeassistant/helpers/script.py", line 1795, in async_run return await asyncio.shield(create_eager_task(run.async_run())) ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ File "/usr/src/homeassistant/homeassistant/helpers/script.py", line 463, in async_run await self._async_step(log_exceptions=False) File "/usr/src/homeassistant/homeassistant/helpers/script.py", line 527, in _async_step self._handle_exception( File "/usr/src/homeassistant/homeassistant/helpers/script.py", line 557, in _handle_exception raise exception File "/usr/src/homeassistant/homeassistant/helpers/script.py", line 525, in _async_step await getattr(self, handler)() File "/usr/src/homeassistant/homeassistant/helpers/script.py", line 763, in _async_call_service_step response_data = await self._async_run_long_action( ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ File "/usr/src/homeassistant/homeassistant/helpers/script.py", line 726, in _async_run_long_action return await long_task ^^^^^^^^^^^^^^^ File "/usr/src/homeassistant/homeassistant/core.py", line 2761, in async_call response_data = await coro ^^^^^^^^^^ File "/usr/src/homeassistant/homeassistant/core.py", line 2804, in _execute_service return await target(service_call) ^^^^^^^^^^^^^^^^^^^^^^^^^^ File "/usr/src/homeassistant/homeassistant/components/notify/legacy.py", line 256, in _async_notify_message_service await self.async_send_message(*kwargs) File "/usr/src/homeassistant/homeassistant/components/notify/legacy.py", line 236, in async_send_message await self.hass.async_add_executor_job( File "/usr/local/lib/python3.12/concurrent/futures/thread.py", line 58, in run result = self.fn(self.args, **self.kwargs) ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ File "/config/custom_components/whatspie/notify.py", line 81, in send_message send_whatsapp_text_message(target, message, self.api_token, self.from_number, self.country_code) File "/config/custom_components/whatspie/notify.py", line 33, in send_whatsapp_text_message resp = requests.post(f'{settings.WHATSPIE_API_ENDPOINT}/messages', ^^^^^^^^ NameError: name 'settings' is not defined

arifwn commented 1 week ago

I mistakenly committed wrong codes a while ago and thought I already undo that. It should be fixed now.

twistedlizzard commented 1 week ago

Thank you! Re-downloaded the integration and it's working perfectly.