mduran80 / daikin_madoka

Home Assistant custom component integration for the BRC1H thermostat (madoka)
MIT License
42 stars 10 forks source link

Decrease temp in cooling mode via HA, increases on Madoka #16

Open betonishard opened 1 year ago

betonishard commented 1 year ago

HI, first of all thank you so much for this. Also related to this: https://github.com/mduran80/pymadoka/issues/2

Since yesterday I have this madoka and like all of you immediately tried to hook it up to homeassistant. Actually it was smooth sailing, it worked at my first try with the latest home assistant on docker and built-in bluetooth of my server just by following the steps and ofcourse not to forget the addition dbus in docker-compose.

Now I have a couple of findings in which I hope someone can help me.

When I increase the temperature in homeassistant of the cooling by 1, the madoka shows the increase and it works. However when I decrease the temperature in homeassistant of the cooling by 1, the madoka INcreases instead of DEcreases. This means I can never lower the temperature.

I don’t have a separate temperature sensor, I just have 1 “climate.airconditioning_mac”. Is that correct?

Hopefully someone can help with the temperature set, because than it will be very useful to me.

Thank you in advance.

EDIT:

mduran80 commented 1 year ago

I am a bit busy at the moment but I will have a look at it as soon as I can. It seems the bug must be in the pymadoka library. Thank you for all the information and the testing!

On Sun, 17 Jul 2022 at 12:11, betonishard @.***> wrote:

HI, first of all thank you so much for this. Sorry for posting this on the homeassistant thread as well as here (double).

Since yesterday I have this madoka and like all of you immediately tried to hook it up to homeassistant. Actually it was smooth sailing, it worked at my first try with the latest home assistant on docker and built-in bluetooth of my server just by following the steps and ofcourse not to forget the addition dbus in docker-compose.

Now I have a couple of findings in which I hope someone can help me.

When I increase the temperature in homeassistant of the cooling by 1, the madoka shows the increase and it works. However when I decrease the temperature in homeassistant of the cooling by 1, the madoka INcreases instead of DEcreases. This means I can never lower the temperature.

I don’t have a separate temperature sensor, I just have 1 “climate.airconditioning_mac”. Is that correct?

Probably unrelated with this because with homeassistant it works, when integrating it with homekit via homeassistant on/off is not working either. In homeassistant itself it works. Again, maybe worth mentioning, not to solve here most probably.

Hopefully someone can help with the temperature set, because than it will be very useful to me.

Thank you in advance.

EDIT:

I updated to the latest firmware with madoka app (1.8.0). On the app in cooling mode when decreasing temp it actually decreases on the madoka itself. repaired everything, restarted and everything, still from homeassistant when I decrease the temp it increases on the madoka. When I increase it increases as expected and is correct. By the way if i directly decrease by 2 it still increases by 1. I noticed that when I do the same thing in heating mode, it works correct. So, it seems that decreasing temperature in cooling mode in homeassistant results in an increase on the madoka.

— Reply to this email directly, view it on GitHub https://github.com/mduran80/daikin_madoka/issues/16, or unsubscribe https://github.com/notifications/unsubscribe-auth/AFK3CTZWEAGFJARZWEASA2TVUPL4ZANCNFSM53ZQH2VQ . You are receiving this because you are subscribed to this thread.Message ID: @.***>

Thunkar commented 1 year ago

I am experiencing the exact same behavior and it is indeed related to https://github.com/mduran80/pymadoka/issues/2

As @mduran80 described, my unit also seems to ignore the cooling setpoint and just go with whatever the heating setpoint is set to, but with one caveat. Also as @betonishard is experiencing the cooling temperature is the heating setpoint + 1 degree.

I have modified these two functions in climate.py file as a temporary workaround, and it seems to be working fine:

@property                                                                 
    def target_temperature(self):                                             
        """Return the temperature we try to reach."""                         

        if self.controller.set_point.status is None:                                  
            return None                                                       

        value = None                                                                  

        if self.hvac_mode == HVAC_MODE_HEAT:                                  
            value = self.controller.set_point.status.heating_set_point        
        else:                                                                         
            value = self.controller.set_point.status.heating_set_point + 1            
        return value  

""" ... """

async def async_set_temperature(self, **kwargs):                          
        """Set new target temperature."""                                             
        new_set_point = 0                                                             
        try:                                                                  
            if (                                                                      
                self.controller.operation_mode.status.operation_mode                  
                != OperationModeEnum.HEAT                                             
            ):                                                                
                new_set_point = round(kwargs.get(ATTR_TEMPERATURE))           
                await self.controller.set_point.update(                               
                    SetPointStatus(new_set_point, new_set_point - 1)                  
                )                                                                     
            if (
                self.controller.operation_mode.status.operation_mode          
                != OperationModeEnum.COOL                                     
            ):                                                                
                new_set_point = round(kwargs.get(ATTR_TEMPERATURE))                   
                await self.controller.set_point.update(                               
                    SetPointStatus(new_set_point, new_set_point)              
                )                                                                     
        except ConnectionAbortedError:                                                
            # pylint: disable=logging-not-lazy                                        
            _LOGGER.warning(                                                  
                "Could not set target temperature on %s. "                    
                + "Connection not available, please reload integration to try reenabling.",
                self.name,                                                                 
            )    
        except ConnectionException:                                                        
            pass    
betonishard commented 1 year ago

@Thunkar Just made the same modifications in climate.py and it works for me.

Thanks!

BeFygo commented 1 year ago

@Thunkar I made the same modification to climate.py and lowering the temperature in cooling mode works... great!! 🦾

But with me its with an offset (-1) in cooling: 23°C in HA = 24°C on the controller.

BeFygo commented 9 months ago

@Thunkar I made the same modification to climate.py and lowering the temperature in cooling mode works... great!! 🦾

But with me its with an offset (-1) in cooling: 23°C in HA = 24°C on the controller.

I noticed that the offset I mentioned is because of a offset setting in the 'madoka assistant' app (android) under the 'afstandbediening' (translated: remote) settings. @mduran80 maybe this is an interesting fact to put into your README?

I put the setting on 2°C because in auto mode the thermostat bounced between heat and cool mode if it had an offset op 1°C.

BeFygo commented 1 week ago

The latest changes to climate.py still have this issue. The workaround from @Thunkar still works with sometimes the readback value being wrong.