cjaliaga / home-assistant-aquarea

Home Assistant integration for Panasonic Aquarea devices connected to Aquarea Smart Cloud
MIT License
85 stars 13 forks source link

[Bug]: Climate entity min and max allowed temp is equal to the current temperature of the heating tank. #120

Closed 3evv closed 2 months ago

3evv commented 2 months ago

The problem

Attributes min_temp and max_temp get set to the current_temperature every time device refreshes, making it impossible to control the heat pump with climate.set_temperature in automations - the action returns error:

image

Status of the device in developer settings:

hvac_modes:
  - heat
  - "off"
min_temp: 30
max_temp: 30
target_temp_step: 1
preset_modes:
  - eco
  - comfort
  - none
current_temperature: 30
temperature: 35
hvac_action: idle
preset_mode: eco
attribution: Data provided by Aquarea Smart Cloud
icon: mdi:hvac-off
friendly_name: XXXXXXXXX
supported_features: 401

The automation/action YAML syntax:

action: climate.set_temperature
metadata: {}
data:
  temperature: "{{ states('input_number.TEMP_I_WANT') }}"
target:
  device_id: WORKING_ID

What version of Home Assistant Core are you running?

core-2024.8.0

What type of installation are you running?

Home Assistant Container

What version of the integration are you running?

0.7.1

Device description

ZONE: 1 COOLING: NO DHW: YES (?)

Is the integration loading?

Yes

Is the adapter able to connect to the Aquarea Smart Cloud with a stable internet connection?

Yes

Are you able to perform the action you're trying to with the Aquarea Smart Cloud Site/App?

Yes

Area of the issue

Automation / setting the target temperature with a defined helper numeric value as input for "temperature:" field.

Anything in the logs?

No.

Additional information

No response

cjaliaga commented 2 months ago

@3evv does your device and current setup support to set a target temperature on a zones basis? Not all setups allow that and on these cases the integration sets the current temperatura the device is working on as min and max, which also includes when it's heating the tank as you said.

Please let me know if your device and setup supports setting the temperature for the zone, if that the case, I might know what could be happening:

https://github.com/cjaliaga/home-assistant-aquarea/blob/15924ffb900aa53e21eb77600b12fb52433e578f/custom_components/aquarea/climate.py#L175

Thanks!

3evv commented 2 months ago

If I understand correctly it has no zones - the heating system is just a two pipe system with branches, without any control from the heating unit side (no diverter or flow control valves). I do not see any options in aquarea smart cloud to change any zones.

But it also heats hot water for the household, if that somehow impacts the zones. (Sorry, kinda new to the topic of heat pumps and searching with the model number didn't mention it having any heating zones)

cjaliaga commented 2 months ago

It depends on the way it is installed. For example, in our house from the heat pump point of view there's one zone, an external zone.

The external word here is important, because it's not a zone controlled by the heat pump itself. We have different circuits (underfloor heating/cooling), one per room basically to simplify. And then thermostats control every area. When a thermostat requests that its area needs to be cooled/heated, a control unit opens the specific valve for that circuit/zone/room and tells the heat pump to start moving water on the circuit, and in consequence, it heats or cools that water.

As you can see, with this kind of installation, the heat pump doesn't know about different zones, so we cannot tell it what target temperature we would like to have for any specific room (zone). As a summary, if the installation has for an specific zone an external sensor, you won't have the options in the Aquarea smart cloud app/page and neither the integration will allow you to set the target temperatures.

On installations where the heat pump knows about zones (1 or 2) and the sensor is not external https://github.com/cjaliaga/aioaquarea/blob/9348dd47b2c13163c45748ed513853646b5b27dd/aioaquarea/data.py#L19-L25, it will be allow to set a target temperature for those zones.

So it's a matter of who owns what responsibilities: The heat pump as only system to control them all versus heat pump heats/cools and lets other tell ask for heating/cooling.

3evv commented 2 months ago

Well, after looking around aquarea I found there is Zone 1, I guess it's the room the pump is in?

The heatpump only keeps the water tanks temperature - there are no calls to the pump from any home temperature sensors. The only ones visible to the pump are external unit's and internal unit's (which is outside the residential area, so its not used as an indicator) , and water tanks' temperature sensors. There is no control panel hooked up to the pump.

As I understand my current setup is "The heat pump as only system to control" but there is no sensor in my residential area it can validate it's results against?

The models of devices I have: AQUAREA T-CAP KIT-WXC09H3E8 - pump PAW-BTANK100L - central heating buffer tank (radiators) PAW-TD20C1E5 - hot water (shower, sink's) There is a sensor placed in the buffer tank, which seems to be reported as "current_temperature".

Basically, my setup is a "dumbed down" pump - its a heater keeping central heating water tank on desired temperature, with no way to know if it reached it's temp targets inside the house.

My desired setup is to have the on/off state regulated via HA, with the water tanks temperature set-point increased and decreased according to readouts from HA available temperature sensors.

The issue I have is that the keywords for "min_temp" and "max_temp" conflict with setting the heating water tank's settings - I can set it to any temperature between 20 and 60C from climate panel: image but the naming scheme confuses HA to check "temperature:" setting against max and min_temp when using an automation- but they are both equal to the temperature of the tank (current_temp).

The entity used in automation script is the same as in climate one. Maybe I should be setting other variable than "temperature:" to control the central heating water tank set-point?

P.S. I guess the https://github.com/cjaliaga/home-assistant-aquarea/blob/15924ffb900aa53e21eb77600b12fb52433e578f/custom_components/aquarea/climate.py#L172 would be at fault here. Would it be possible to include some kind of workaround in your code (maybe set min and max temp to a HA variable?)

cjaliaga commented 2 months ago

The integration will allow to do what the official Aquarea app/API allows to do. There's a climate entity per zone, and only if the Aquarea API allows to set a temperature for that zone, the climate entity for that zona will allow to do so. The min_temp and max_temp will have the allowed values when the zone in formation coming from the Aquarea API provides those values.

If we're in the case that the Aquarea App allows you to set a target temperature for a zone and the integration is not allowing it to do so, I'll work with you to understand why the integration is behaving differently than the official clients and try to implement that setup.

For the water heater tank, there should be an specific entity that you can target, if the Aquarea API says that you have one. The values allowed also come from the API, is not something that the integration has hardcoded.

As a summary, if your setup doesn't allow to set a target temperature to a zone, climate.set_temperature won't work, even using the device_id as a target.

3evv commented 2 months ago

So, in Aquarea I have two entries - the upper one that I want to control, and is controlable via climate entry. image It succesfuly toggles it on and off, changes "Set x C" to any value on the climate dial possible. 367932270-d90c4b48-2a1a-4a91-93ac-7f3043b15ed7

Automations successfully toggle heating on and off, but changing temperature is the issue I mention - its validated against current temp of the tank, and I dont see any other way to change it via automation - but it is possible via UI widget.

So it is functioning from both aquarea cloud and HA widget, therefore it should be possible to do via automation. But for some reason the climate entry knows its min/max is 20C/60C, but automation believes min/max to always be "current_temp". It creates a discrepancy between functionality - what is possible manually with a slider isn't possible via script - neither by hardcoded value nor a dynamic variable.

3evv commented 2 months ago

Okay, I seem to have figured things out. The solution was to use different action - instead of climate.turn_on you should use set_hvac_mode (set it to heat), then use a waiting block for the state of the pump to update to heating, and finally set the desired temperature.

image

Also, make sure to target the climate entity instead of the device - if you select the device as target for climate.turn_off it will stop your hot water tank heating - I suggest using the set_hvac_mode with climate entity instead.