WirelessPalaControl icon indicating copy to clipboard operation
WirelessPalaControl copied to clipboard

Stove im Home Assistant gets unavailable when changing the target temp while stove is powered off

Open abcklaus opened this issue 10 months ago • 16 comments

Hi,

I am using the WPalaControl with Palazzetti "Marianne" stove. I am using WPalaControl with Palazzetti integration in Home Assistant.

I have observed that the stove becomes unavailable in HA if the target temperature is change while the stove is powered off:

Image

Is that behavior intended?

Thanks

Michael

abcklaus avatar Feb 02 '25 19:02 abcklaus

Hi,

Do you mean the target temperature is changed directly on the stove physically or via HA?

Domochip avatar Feb 03 '25 10:02 Domochip

It happens when I change the target temp in HA.

abcklaus avatar Feb 03 '25 10:02 abcklaus

Interesting, could you give it a try directly using HTTP command and check that it disconnect or not (ex: set target temperature to 20): http://{WPalaControlIP}/cgi-bin/sendmsg.lua?cmd=SET+SETP+20

Domochip avatar Feb 03 '25 10:02 Domochip

Response for HTTP command:

{"INFO":{"CMD":"SET SETP","RSP":"OK"},"DATA":{"SETP":20.00},"SUCCESS":true}

One more thing: When setting the temp in HA I get this error:

Image

abcklaus avatar Feb 03 '25 13:02 abcklaus

And did the WPalaControl appeared disconnected in HA next to this successfull command? Regarding the error in HA, as you are using the Palazzetti integration, the problem should be reported to @dotvav (the developper of it). Or switch to the native WPalaControl integration using MQTT.

Domochip avatar Feb 03 '25 13:02 Domochip

After executing the HTTP command WPalaControl remains available. But it takes some seconds (approximately 10s) to reflect the change in HA.

Ok, I will contact dotav.

abcklaus avatar Feb 03 '25 13:02 abcklaus

For the 10sec delay, it is normal, Palazzetti integration is using HTTP endpoints and no notification is sent from WPalaControl nor CBox using this protocol. What's interesting is that HA didn't considered the WPalaControl has disconnected, so yes, the problem is coming from Palazzetti integration

Domochip avatar Feb 03 '25 15:02 Domochip

Hi there. It could be that the response payload from WPalaControl has a format that I was not expecting. If the processing throws an exception (missing attribute, unexpected type...) then the device will be reported as unavailable, until it responds again with something that fulfills the expectations. Which could be 10s. I haven't had a chance to test today, but I have some doubts about SETP returning a float value instead of an int. I'll check tomorrow.

dotvav avatar Feb 03 '25 16:02 dotvav

Nice trail found. If my memory is good, some stoves are able to be configured with 0.2°C step, but in that case, I don't know what CBox returns...

Domochip avatar Feb 03 '25 17:02 Domochip

@dotvav were you able to confirm if it comes from the float returned?

Domochip avatar Mar 05 '25 06:03 Domochip

Hi, I came back from vacation last week and haven't found the time to run these tests. I will look into that in the coming days.

dotvav avatar Mar 05 '25 09:03 dotvav

I ran some tests today, both on the HA integration and on the API lib, and the float type of SETP does not cause any issues.

@abcklaus, can you open an issue on the HA Core Github? It will get assigned to me. I don't want to polute Domochip's repo. Feel free to link to this issue and share the tests that you have performed. Also, any error message ort information you can get from the HA logs would be very helpful.

dotvav avatar Mar 09 '25 13:03 dotvav

ok, done.

#140215

Thanks

abcklaus avatar Mar 09 '25 17:03 abcklaus

@Domochip below is the relevant error from @abcklaus's logs. There is a imeout error when I call GET STDT. Do you think that it is possible that the WPalaControl could struggle with concurrent http requests if HA is calling GET STDT right after (or during) the SET SETP command?

I'll also try to understand why I call GET STDT at this point.

NB: if that is the case, it is not necessarily something that you need to fix. I was already planning to make a change in the integration to avoid concurrent requests.

2025-03-09 18:16:44.569 ERROR (MainThread) [homeassistant.components.palazzetti] Communication error
Traceback (most recent call last):
  File "/usr/local/lib/python3.13/site-packages/aiohttp/connector.py", line 1116, in _wrap_create_connection
    sock = await aiohappyeyeballs.start_connection(
           ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
    ...<5 lines>...
    )
    ^
  File "/usr/local/lib/python3.13/site-packages/aiohappyeyeballs/impl.py", line 73, in start_connection
    sock = await _connect_sock(
           ^^^^^^^^^^^^^^^^^^^^
    ...<6 lines>...
    )
    ^
  File "/usr/local/lib/python3.13/site-packages/aiohappyeyeballs/impl.py", line 208, in _connect_sock
    await loop.sock_connect(sock, address)
  File "/usr/local/lib/python3.13/asyncio/selector_events.py", line 641, in sock_connect
    return await fut
           ^^^^^^^^^
asyncio.exceptions.CancelledError

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

Traceback (most recent call last):
  File "/usr/local/lib/python3.13/site-packages/aiohttp/client.py", line 703, in _request
    conn = await self._connector.connect(
           ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
        req, traces=traces, timeout=real_timeout
        ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
    )
    ^
  File "/usr/local/lib/python3.13/site-packages/aiohttp/connector.py", line 548, in connect
    proto = await self._create_connection(req, traces, timeout)
            ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
  File "/usr/local/lib/python3.13/site-packages/aiohttp/connector.py", line 1056, in _create_connection
    _, proto = await self._create_direct_connection(req, traces, timeout)
               ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
  File "/usr/local/lib/python3.13/site-packages/aiohttp/connector.py", line 1411, in _create_direct_connection
    raise last_exc
  File "/usr/local/lib/python3.13/site-packages/aiohttp/connector.py", line 1380, in _create_direct_connection
    transp, proto = await self._wrap_create_connection(
                    ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
    ...<7 lines>...
    )
    ^
  File "/usr/local/lib/python3.13/site-packages/aiohttp/connector.py", line 1113, in _wrap_create_connection
    async with ceil_timeout(
               ~~~~~~~~~~~~^
        timeout.sock_connect, ceil_threshold=timeout.ceil_threshold
        ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
    ):
    ^
  File "/usr/local/lib/python3.13/asyncio/timeouts.py", line 116, in __aexit__
    raise TimeoutError from exc_val
TimeoutError

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

Traceback (most recent call last):
  File "/usr/local/lib/python3.13/site-packages/pypalazzetti/client.py", line 402, in _execute_command
    async with self._session.get(request_url) as response:
               ~~~~~~~~~~~~~~~~~^^^^^^^^^^^^^
  File "/usr/local/lib/python3.13/site-packages/aiohttp/client.py", line 1425, in __aenter__
    self._resp: _RetType = await self._coro
                           ^^^^^^^^^^^^^^^^
  File "/usr/local/lib/python3.13/site-packages/aiohttp/client.py", line 707, in _request
    raise ConnectionTimeoutError(
        f"Connection timeout to host {url}"
    ) from exc
aiohttp.client_exceptions.ConnectionTimeoutError: Connection timeout to host http://10.60.20.10/cgi-bin/sendmsg.lua?cmd=GET+STDT

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

Traceback (most recent call last):
  File "/usr/src/homeassistant/homeassistant/components/palazzetti/config_flow.py", line 31, in async_step_user
    await client.connect()
  File "/usr/local/lib/python3.13/site-packages/pypalazzetti/client.py", line 48, in connect
    r = await self._execute_command(
        ^^^^^^^^^^^^^^^^^^^^^^^^^^^^
    ...<2 lines>...
    )
    ^
  File "/usr/local/lib/python3.13/site-packages/pypalazzetti/client.py", line 409, in _execute_command
    raise CommunicationError("API communication error") from ex
pypalazzetti.exceptions.CommunicationError: API communication error

dotvav avatar Mar 10 '25 08:03 dotvav

That's interesting. Could be a good idea that I give it a try because we are currently working on a reliability problem with @abcklaus . To clarify things, the first post mention that this problem occurs when changing the temperature (setPoint) while the stove is off. Does it also happens when the stove is on?

@dotvav Even if this is something you can fix, I want to give it a try to understand if this is a memory shortage or a "simple" watchdog timeout. (I can improve things for watchdog timeout)

Domochip avatar Mar 10 '25 17:03 Domochip

Yes, the issue occurs only if the stove is turned off.

abcklaus avatar Mar 10 '25 17:03 abcklaus

Hi. Same behavior for me.

I can help you to debug if you need.

damien-louis avatar Nov 11 '25 18:11 damien-louis