maorcc / citymind_water_meter

Home Assistant Integration with cp.city-mind.com, an Israeli water meters reading service
Apache License 2.0
41 stars 2 forks source link

Unable to set and to remove cost parameters #65

Closed ilyaalexan closed 3 months ago

ilyaalexan commented 4 months ago

After updating to 2.0.15, any attempt to call CityMind Water Meter service to set/remove cost parameters fails with the following error: "Failed to call service citymind_water_meter.remove_cost_parameters. Unknown error"

This is what appears in the log: 2024-05-24 14:40:28.664 WARNING (SyncWorker_1) [homeassistant.helpers.frame] Detected that custom integration 'citymind_water_meter' calls async_create_task from a thread at custom_components/citymind_water_meter/component/managers/home_assistant.py, line 859: self._hass.async_create_task(self._async_update_cost_parameters(service_call)), please report it to the author of the 'citymind_water_meter' custom integration 2024-05-24 14:40:28.666 ERROR (MainThread) [homeassistant.helpers.script.websocket_api_script] websocket_api script: Error executing script. Unexpected error for call_service at pos 1: Detected that custom integration 'citymind_water_meter' calls async_create_task from a thread at custom_components/citymind_water_meter/component/managers/home_assistant.py, line 859: self._hass.async_create_task(self._async_update_cost_parameters(service_call)). Please report it to the author of the 'citymind_water_meter' custom integration. Traceback (most recent call last): File "/usr/src/homeassistant/homeassistant/helpers/script.py", line 501, in _async_step await getattr(self, handler)() File "/usr/src/homeassistant/homeassistant/helpers/script.py", line 736, in _async_call_service_step response_data = await self._async_run_long_action( ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ File "/usr/src/homeassistant/homeassistant/helpers/script.py", line 699, in _async_run_long_action return await long_task ^^^^^^^^^^^^^^^ File "/usr/src/homeassistant/homeassistant/core.py", line 2738, in async_call response_data = await coro ^^^^^^^^^^ File "/usr/src/homeassistant/homeassistant/core.py", line 2786, in _execute_service return await self._hass.async_add_executor_job(target, service_call) ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ 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/citymind_water_meter/component/managers/home_assistant.py", line 859, in _remove_cost_parameters self._hass.async_create_task(self._async_update_cost_parameters(service_call)) File "/usr/src/homeassistant/homeassistant/core.py", line 816, in async_create_task self.verify_event_loop_thread("async_create_task") File "/usr/src/homeassistant/homeassistant/core.py", line 440, in verify_event_loop_thread frame.report( File "/usr/src/homeassistant/homeassistant/helpers/frame.py", line 162, in report _report_integration(what, integration_frame, level, error_if_integration) File "/usr/src/homeassistant/homeassistant/helpers/frame.py", line 203, in _report_integration raise RuntimeError( RuntimeError: Detected that custom integration 'citymind_water_meter' calls async_create_task from a thread at custom_components/citymind_water_meter/component/managers/home_assistant.py, line 859: self._hass.async_create_task(self._async_update_cost_parameters(service_call)). Please report it to the author of the 'citymind_water_meter' custom integration. 2024-05-24 14:40:28.672 ERROR (MainThread) [homeassistant.components.websocket_api.http.connection] [547604632384] Error handling message: Unknown error (unknown_error) xxxxxx from xxx.xxx.xxx.xx (Mozilla/5.0 (Windows NT 10.0; Win64; x64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/125.0.0.0 Safari/537.36) Traceback (most recent call last): File "/usr/src/homeassistant/homeassistant/components/websocket_api/decorators.py", line 27, in _handle_async_response await func(hass, connection, msg) File "/usr/src/homeassistant/homeassistant/components/websocket_api/commands.py", line 793, in handle_execute_script script_result = await script_obj.async_run( ^^^^^^^^^^^^^^^^^^^^^^^^^^^ File "/usr/src/homeassistant/homeassistant/helpers/script.py", line 1731, in async_run return await asyncio.shield(create_eager_task(run.async_run())) ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ File "/usr/src/homeassistant/homeassistant/helpers/script.py", line 451, in async_run await self._async_step(log_exceptions=False) File "/usr/src/homeassistant/homeassistant/helpers/script.py", line 503, in _async_step self._handle_exception( File "/usr/src/homeassistant/homeassistant/helpers/script.py", line 533, in _handle_exception raise exception File "/usr/src/homeassistant/homeassistant/helpers/script.py", line 501, in _async_step await getattr(self, handler)() File "/usr/src/homeassistant/homeassistant/helpers/script.py", line 736, in _async_call_service_step response_data = await self._async_run_long_action( ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ File "/usr/src/homeassistant/homeassistant/helpers/script.py", line 699, in _async_run_long_action return await long_task ^^^^^^^^^^^^^^^ File "/usr/src/homeassistant/homeassistant/core.py", line 2738, in async_call response_data = await coro ^^^^^^^^^^ File "/usr/src/homeassistant/homeassistant/core.py", line 2786, in _execute_service return await self._hass.async_add_executor_job(target, service_call) ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ 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/citymind_water_meter/component/managers/home_assistant.py", line 859, in _remove_cost_parameters self._hass.async_create_task(self._async_update_cost_parameters(service_call)) File "/usr/src/homeassistant/homeassistant/core.py", line 816, in async_create_task self.verify_event_loop_thread("async_create_task") File "/usr/src/homeassistant/homeassistant/core.py", line 440, in verify_event_loop_thread frame.report( File "/usr/src/homeassistant/homeassistant/helpers/frame.py", line 162, in report _report_integration(what, integration_frame, level, error_if_integration) File "/usr/src/homeassistant/homeassistant/helpers/frame.py", line 203, in _report_integration raise RuntimeError( RuntimeError: Detected that custom integration 'citymind_water_meter' calls async_create_task from a thread at custom_components/citymind_water_meter/component/managers/home_assistant.py, line 859: self._hass.async_create_task(self._async_update_cost_parameters(service_call)). Please report it to the author of the 'citymind_water_meter' custom integration.

elad-bar commented 3 months ago

is it still relevant?

thanks

ilyaalexan commented 3 months ago

No, not relevant anymore after the change to not use service calls to configure prices.

On Tue, 25 Jun 2024 at 8:32 Elad Bar @.***> wrote:

is it still relevant?

thanks

— Reply to this email directly, view it on GitHub https://github.com/maorcc/citymind_water_meter/issues/65#issuecomment-2188013352, or unsubscribe https://github.com/notifications/unsubscribe-auth/BGMYI4WMZQFRMYXXKOFRWF3ZJD6FXAVCNFSM6AAAAABIHNXHTGVHI2DSMVQWIX3LMV43OSLTON2WKQ3PNVWWK3TUHMZDCOBYGAYTGMZVGI . You are receiving this because you authored the thread.Message ID: @.***>

elad-bar commented 3 months ago

great, thanks for the update, hope you know you can change it under the meter device / entities of number for that

ilyaalexan commented 3 months ago

Yes, I do know that. BTW, great sensor! Thanks for your work!

On Tue, 25 Jun 2024 at 10:33 Elad Bar @.***> wrote:

great, thanks for the update, hope you know you can change it under the meter device / entities of number for that

— Reply to this email directly, view it on GitHub https://github.com/maorcc/citymind_water_meter/issues/65#issuecomment-2188186792, or unsubscribe https://github.com/notifications/unsubscribe-auth/BGMYI4RMWM72FXEDW3HWTSLZJEMLHAVCNFSM6AAAAABIHNXHTGVHI2DSMVQWIX3LMV43OSLTON2WKQ3PNVWWK3TUHMZDCOBYGE4DMNZZGI . You are receiving this because you authored the thread.Message ID: @.***>

elad-bar commented 3 months ago

sure, thanks for feedback :)