signalkraft / mypyllant-component

Home Assistant component for the myVAILLANT API, controls Vaillant devices such as aroTHERM heatpumps and ecoTEC boilers
https://signalkraft.com/mypyllant-component/
MIT License
108 stars 19 forks source link

Manual Cooling for x days #184

Open switschel opened 3 days ago

switschel commented 3 days ago

Before requesting a new feature / a new sensor

Describe the feature you want

With the latest app update manual cooling for x days is supported now. It would be great if this integration would provide a service to do the same via Home Assistant.

Let me know if I can help to discover the correct API to do so.

Screenshot

Screenshot_2024-07-03-10-36-51-892_com.vaillantgroup.enduserapp.vaillant.jpg

Export data

Not sure if it is relevant but if so I can provide it. I reviewed it but it would be not very helpful to implement this new service I guess.

Attach exported test data here
signalkraft commented 3 days ago

Should work in https://github.com/signalkraft/mypyllant-component/releases/tag/v0.8.5

switschel commented 3 days ago

Unfortunately not working for VRC700:

Traceback (most recent call last): File "/usr/src/homeassistant/homeassistant/components/websocket_api/decorators.py", line 27, in _handle_async_response await func(hass, connection, msg) File "/usr/src/homeassistant/homeassistant/components/websocket_api/commands.py", line 793, in handle_execute_script script_result = await script_obj.async_run( ^^^^^^^^^^^^^^^^^^^^^^^^^^^ File "/usr/src/homeassistant/homeassistant/helpers/script.py", line 1769, in async_run return await asyncio.shield(create_eager_task(run.async_run())) ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ File "/usr/src/homeassistant/homeassistant/helpers/script.py", line 464, in async_run await self._async_step(log_exceptions=False) File "/usr/src/homeassistant/homeassistant/helpers/script.py", line 528, in _async_step self._handle_exception( File "/usr/src/homeassistant/homeassistant/helpers/script.py", line 558, in _handle_exception raise exception File "/usr/src/homeassistant/homeassistant/helpers/script.py", line 526, in _async_step await getattr(self, handler)() File "/usr/src/homeassistant/homeassistant/helpers/script.py", line 763, in _async_call_service_step response_data = await self._async_run_long_action( ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ File "/usr/src/homeassistant/homeassistant/helpers/script.py", line 726, in _async_run_long_action return await long_task ^^^^^^^^^^^^^^^ File "/usr/src/homeassistant/homeassistant/core.py", line 2741, in async_call response_data = await coro ^^^^^^^^^^ File "/usr/src/homeassistant/homeassistant/core.py", line 2784, in _execute_service return await target(service_call) ^^^^^^^^^^^^^^^^^^^^^^^^^^ File "/usr/src/homeassistant/homeassistant/helpers/service.py", line 977, in entity_service_call single_response = await _handle_entity_call( ^^^^^^^^^^^^^^^^^^^^^^^^^^ File "/usr/src/homeassistant/homeassistant/helpers/service.py", line 1049, in _handle_entity_call result = await task ^^^^^^^^^^ File "/config/custom_components/mypyllant/climate.py", line 521, in set_cooling_for_days raise ValueError("Can't set cooling for days on VRC700 systems") ValueError: Can't set cooling for days on VRC700 systems

signalkraft commented 3 days ago

True, that would require someone with a VRC700 to do some reverse engineering and find out what values are being sent to which endpoint.

switschel commented 3 days ago

@signalkraft

Here you go:

POST    https://api.vaillant-group.com/service-connected-control/vrc700/v1/systems/<systemID>/cooling-for-days

Payload: 
{
    "value": 1
}

DELETE https://api.vaillant-group.com/service-connected-control/vrc700/v1/systems/<systemID>/cooling-for-days

No payload

value == int number of days

signalkraft commented 2 days ago

Thanks for the data, should be fixed in https://github.com/signalkraft/mypyllant-component/releases/tag/v0.8.6

switschel commented 2 days ago

Thanks for adding it so fast! Here are my test results:

  1. Calling service "cooling for days" providing the number of days is working as expected

  2. Calling service "cancel cooling" still results in an error: Traceback (most recent call last): File "/usr/src/homeassistant/homeassistant/components/websocket_api/decorators.py", line 28, in _handle_async_response await func(hass, connection, msg) File "/usr/src/homeassistant/homeassistant/components/websocket_api/commands.py", line 793, in handle_execute_script script_result = await script_obj.async_run( ^^^^^^^^^^^^^^^^^^^^^^^^^^^ File "/usr/src/homeassistant/homeassistant/helpers/script.py", line 1770, in async_run return await asyncio.shield(create_eager_task(run.async_run())) ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ File "/usr/src/homeassistant/homeassistant/helpers/script.py", line 465, in async_run await self._async_step(log_exceptions=False) File "/usr/src/homeassistant/homeassistant/helpers/script.py", line 529, in _async_step self._handle_exception( File "/usr/src/homeassistant/homeassistant/helpers/script.py", line 559, in _handle_exception raise exception File "/usr/src/homeassistant/homeassistant/helpers/script.py", line 527, in _async_step await getattr(self, handler)() File "/usr/src/homeassistant/homeassistant/helpers/script.py", line 764, in _async_call_service_step response_data = await self._async_run_long_action( ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ File "/usr/src/homeassistant/homeassistant/helpers/script.py", line 727, in _async_run_long_action return await long_task ^^^^^^^^^^^^^^^ File "/usr/src/homeassistant/homeassistant/core.py", line 2731, in async_call response_data = await coro ^^^^^^^^^^ File "/usr/src/homeassistant/homeassistant/core.py", line 2774, in _execute_service return await target(service_call) ^^^^^^^^^^^^^^^^^^^^^^^^^^ File "/usr/src/homeassistant/homeassistant/helpers/service.py", line 999, in entity_service_call single_response = await _handle_entity_call( ^^^^^^^^^^^^^^^^^^^^^^^^^^ File "/usr/src/homeassistant/homeassistant/helpers/service.py", line 1071, in _handle_entity_call result = await task ^^^^^^^^^^ File "/config/custom_components/mypyllant/climate.py", line 537, in cancel_cooling_for_days raise ValueError("Can't cancel cooling for days on VRC700 systems") ValueError: Can't cancel cooling for days on VRC700 systems

  3. There is no "cooling" switch available to activate cooling from a Dashboard / Device.

signalkraft commented 2 days ago

https://github.com/signalkraft/mypyllant-component/releases/tag/v0.8.7

Both issues should be fixed here! Let me know if the switch behaves as intended, I have no idea if VRC700 controllers use the same data structure for tracking the state of manual cooling.

switschel commented 2 days ago
  1. and 2. are working now.

  2. Cooling switch still is not appearing for VRC700 I have this binary_sensor.home_circuit_0_cooling_allowed which is "on" and I guess this is not working as intended:

https://github.com/signalkraft/mypyllant-component/blob/8d584d013e1067c22842a55b8fc714d2d2313325/custom_components/mypyllant/switch.py#L43

system:
    state:
      system:
        outdoorTemperature: 12.9140625
        outdoorTemperatureAverage24h: 17.886719
        systemWaterPressure: 1.7
        legionellaProtectionStartWeekday: "OFF"
        energyManagerState: STANDBY
        systemOff: false
      zones:
        - index: 0
          desiredRoomTemperatureSetpointHeating: 0
          desiredRoomTemperatureSetpointCooling: 24
          desiredRoomTemperatureSetpoint: 0
          currentRoomTemperature: 23.625
          currentRoomHumidity: 58
          currentSpecialFunction: NONE
      circuits:
        - index: 0
          circuitState: STANDBY
          currentCircuitFlowTemperature: 20
          heatingCircuitFlowSetpoint: 0
          calculatedEnergyManagerState: HEATING_STANDBY
      domesticHotWater:
        - index: 255
          currentSpecialFunction: NONE
          currentDomesticHotWaterTemperature: 45
    properties:
      system:
        controllerType: VRC700
        controllerRevision: R6
        systemScheme: 8
        backupHeaterType: CONDENSING
        backupHeaterAllowedFor: DISABLED
        temporaryAllowBackupHeater: DISABLED
        moduleConfigurationVR71: 3
        energyProvidePowerCutBehavior: DISABLE_HEATPUMP
        smartPhotovoltaicBufferOffset: 10
        externalEnergyManagementActivation: false
      zones:
        - index: 0
          isActive: true
          zoneBinding: CENTRAL_CONTROL
          associatedCircuitIndex: 0
      circuits:
        - index: 0
          mixerCircuitTypeExternal: HEATING
          heatingCircuitType: DIRECT_HEATING_CIRCUIT
          isCoolingAllowed: true
      domesticHotWater:
        - index: 255
          minSetpoint: 35
          maxSetpoint: 70
    configuration:
      system:
        coolingStartTemperature: 27
        continuousHeatingStartSetpoint: 3
        alternativePoint: -21
        heatingCircuitBivalencePoint: -15
        domesticHotWaterBivalencePoint: -15
        automaticCoolingOnOff: false
        adaptiveHeatingCurve: false
        domesticHotWaterMaximumLoadingTime: 15
        domesticHotWaterHysteresis: 5
        domesticHotWaterFlowSetpointOffset: 5
        maxFlowSetpointHeatpumpError: 20
        domesticHotWaterMaximumTemperature: 80
        hybridControlStrategy: BIVALENCE_POINT
        paralellTankLoadingAllowed: false
        coolingForXDays: 0
signalkraft commented 2 days ago

Good catch, let me know if https://github.com/signalkraft/mypyllant-component/releases/tag/v0.8.9 fixes that!

switschel commented 1 day ago

Switch is there but when trying to use it:

Traceback (most recent call last):
  File "/usr/src/homeassistant/homeassistant/components/websocket_api/commands.py", line 241, in handle_call_service
    response = await hass.services.async_call(
               ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
  File "/usr/src/homeassistant/homeassistant/core.py", line 2731, in async_call
    response_data = await coro
                    ^^^^^^^^^^
  File "/usr/src/homeassistant/homeassistant/core.py", line 2774, in _execute_service
    return await target(service_call)
           ^^^^^^^^^^^^^^^^^^^^^^^^^^
  File "/usr/src/homeassistant/homeassistant/helpers/service.py", line 999, in entity_service_call
    single_response = await _handle_entity_call(
                      ^^^^^^^^^^^^^^^^^^^^^^^^^^
  File "/usr/src/homeassistant/homeassistant/helpers/service.py", line 1071, in _handle_entity_call
    result = await task
             ^^^^^^^^^^
  File "/config/custom_components/mypyllant/switch.py", line 111, in async_turn_on
    await self.coordinator.api.set_cooling_for_days(self.system, end=end)
  File "/usr/local/lib/python3.12/site-packages/myPyllant/api.py", line 897, in set_cooling_for_days
    raise ValueError("duration_days is required on VRC700 controllers")
ValueError: duration_days is required on VRC700 controllers

Maybe default it to "1" when switching on?

signalkraft commented 1 day ago

https://github.com/signalkraft/mypyllant-component/releases/tag/v0.8.11 3rd time 4th time's the charm?