Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Manual Cooling for x days #184

Open
2 of 3 tasks
switschel opened this issue Jul 3, 2024 · 12 comments
Open
2 of 3 tasks

Manual Cooling for x days #184

switschel opened this issue Jul 3, 2024 · 12 comments

Comments

@switschel
Copy link

switschel commented Jul 3, 2024

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
Copy link
Owner

@switschel
Copy link
Author

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
Copy link
Owner

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
Copy link
Author

switschel commented Jul 3, 2024

@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
Copy link
Owner

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

@switschel
Copy link
Author

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
Copy link
Owner

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
Copy link
Author

switschel commented Jul 4, 2024

  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:

if system.is_cooling_allowed:

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
Copy link
Owner

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

@switschel
Copy link
Author

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
Copy link
Owner

@switschel
Copy link
Author

It's partially working now.
I can toggle the button but it will be deactivated directly again. Also the days I have defined will be overwritten with 30 all the time. So I have to toggle the manual cooling button once more and then it is activated (for 30 days). After some time the button is deactivated even the manual cooling is on. I guess there is some kind of state missing leading to this behavior? If so I can try to discover the correct one using reverse engineering again.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants