sinseman44 / koolnova-BMS-Integration

Koolnova air conditioning support for Home Assistant via BMS
MIT License
8 stars 2 forks source link

Impossible to set more than one zone climate temperature in a row #14

Open ChrysMa opened 1 day ago

ChrysMa commented 1 day ago

Hello, Setting a temperature to more than 1 climate (on koolnova) fails. Only one is set properly. Worst : if you set them in a row, it fails for both.

I found a workaround which is to set a pause between two separate temperature setting (I set a 10 secpause and it worked) inside a sequence.

Workaround (I also needed to be sure the climate was set on) :

sinseman44 commented 23 hours ago

Hi,

I'm not surprised. You try to send multiples informations in a half duplex serial bus communication at maximum 9600 bits per second.

In a half-duplex or semiduplex system, both parties can communicate with each other, but not simultaneously; the communication is one direction at a time.

The primitive function of this integration to send information to the Koolnova is write_register(). This function is used to write a single holding register (a byte) in a remote device.

moreover, every time that you call the action (for example) _climate.settemperature, the function behind this action will send a holding register with the new value and end up waiting the coordinator to refresh all values so you can't send another register to Koolnova before the refreshing (otherwise frame collision because Half Dulplex).

async def async_set_temperature(self, **kwargs) -> None:
        """ set new target temperature """
        _LOGGER.debug("[Climate {}] set target temp - kwargs: {}".format(self._area.id_zone, kwargs))
        if "temperature" in kwargs:
            target_temp = kwargs.get("temperature")
            ret = await self._device.async_set_area_target_temp(zone_id = self._area.id_zone, temp = target_temp)
            if not ret:
                _LOGGER.error("Error sending target temperature for area id {}".format(self._area.id_zone))
        else:
            _LOGGER.warning("Target temperature not defined for climate id {}".format(self._area.id_zone))
       await self.coordinator.async_request_refresh()
ChrysMa commented 22 hours ago

Is there any way we can stack them ?

sinseman44 commented 22 hours ago

not in the near future. I might look for a future upgrade.