rkzofficial / ha-miraie-ac

18 stars 10 forks source link

[code:4] The client is not currently connected. #12

Closed AnshulJ999 closed 5 months ago

AnshulJ999 commented 5 months ago

I keep getting this error:

`Logger: homeassistant.components.websocket_api.http.connection Source: components/websocket_api/commands.py:239 integration: Home Assistant WebSocket API (documentation, issues) First occurred: 4:52:59 PM (2 occurrences) Last logged: 4:53:03 PM

[140470498776000] [code:4] The client is not currently connected. Traceback (most recent call last): File "/usr/src/homeassistant/homeassistant/components/websocket_api/commands.py", line 239, in handle_call_service response = await hass.services.async_call( ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ File "/usr/src/homeassistant/homeassistant/core.py", line 2543, in async_call response_data = await coro ^^^^^^^^^^ File "/usr/src/homeassistant/homeassistant/core.py", line 2580, in _execute_service return await target(service_call) ^^^^^^^^^^^^^^^^^^^^^^^^^^ File "/usr/src/homeassistant/homeassistant/helpers/service.py", line 971, in entity_service_call single_response = await _handle_entity_call( ^^^^^^^^^^^^^^^^^^^^^^^^^^ File "/usr/src/homeassistant/homeassistant/helpers/service.py", line 1043, in _handle_entity_call result = await task ^^^^^^^^^^ File "/usr/src/homeassistant/homeassistant/components/climate/init.py", line 917, in async_service_temperature_set await entity.async_set_temperature(*kwargs) File "/config/custom_components/miraie/climate.py", line 179, in async_set_temperature await self.device.set_temperature(kwargs["temperature"]) File "/usr/local/lib/python3.12/site-packages/miraie_ac/device.py", line 131, in set_temperature await self.broker.set_temperature(self.control_topic, temperature) File "/usr/local/lib/python3.12/site-packages/miraie_ac/broker.py", line 98, in set_temperature await self.client.publish( File "/usr/local/lib/python3.12/site-packages/aiomqtt/client.py", line 105, in decorated return await method(self, args, **kwargs) ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ File "/usr/local/lib/python3.12/site-packages/aiomqtt/client.py", line 440, in publish raise MqttCodeError(info.rc, "Could not publish message") aiomqtt.exceptions.MqttCodeError: [code:4] The client is not currently connected. ` If this error can be fixed I'd love to give it a try.

I think this integration has a lot of potential since the earlier one by milothomas has not been updated. This one includes powerful mode, eco mode, and swing, but it doesn't have power consumption.

I would love to see more MirAIe features added to this HA integration, like sleep profiles and preset modes and all.

One more question: is it possible to see the realtime power consumption? I know miraie app only shows daily/weekly/monthly, but if there is any entity that could be exposed to show the realtime power consumption, that’d be really nice too.

Currently going back to the Node-red implementation since it works for me.

AnshulJ999 commented 5 months ago

https://github.com/rkzofficial/ha-miraie-ac/issues/11#issuecomment-2015862351

I was able to fix this issue by following the comment above. Edited the manifest file and changed aiomqtt to 1.0.0 and it is now working.

I'm happy to report that so far, the node-red implementation and this native integration are working fine side by side for the same AC. Currently I'm doing that only for the power consumption entity.

Hence, a simplified feature request list:

1) Daily Power Consumption 2) Weekly Power Consumption 3) Monthly Power Consumption 4) Realtime power consumption (or current/voltage) (if this is at all possible) 5) Sleep profiles 6) Convertible mode

This would allow all MirAIe app features inside HA so we can basically use only HA, and allow for more advanced automations I have in mind.

I would also love to know if anyone has tested an external thermostat/temperature sensor and whether that can be used for this AC.

For reference I have Panasonic 1.5 ton 5 star 2023 model, CS-CU-NU18KY5W. If you require any help from my side with testing, happy to help.

rkzofficial commented 5 months ago

@AnshulJ999 The client is not currently connected bug is fixed now and I have also noted the the feature request list in upcoming days I will layout the plan for this.