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
143 stars 22 forks source link

Add FAN level 1-5 for Recovair 260/360/4 #129

Open gamer123 opened 8 months ago

gamer123 commented 8 months ago

Before requesting a new feature / a new sensor

Describe the feature you want

For Recovair 260 and 360 it is possible in APP to selcet the fan level. In homeassistant right now i only can select normal mode or reduced mode. I would like to use fan levels 1-5 relateted to a CO2 Sensor .

Screenshot

Screenshot_20240309_164538 Screenshot_20240309_164535

Export data

homes:
  - homeName: 1f2df3700df48a36d4a64555465651a4b0ab7f47
    serialNumber: 86cff0e4bbaf5549f19cc03a684fb20dc412345678
    systemId: e3abncde1f743ab911da362db262e123456789
    productMetadata:
      productType: VR921
      productionYear: "22"
      productionWeek: "50"
      articleNumber: "0020260962"
    state: CLAIMED
    migrationState: FINISHED
    migrationFinishedAt: "2023-12-08T05:41:27.569308885Z"
    onlineState: ONLINE
    firmware:
      version: 0357.40.34
      updateEnabled: true
      updateRequired: false
    nomenclature: VR 921
    cag: false
    countryCode: DE
    productInformation: VR921
    firmwareVersion: 0357.40.34
e3c40dd90751f743ab911da362db262e2d1ee031:
  control_identifier:
    controlIdentifier: tli
  time_zone:
    timeZone: Europe/Berlin
  diagnostic_trouble_codes:
    - serialNumber: 025bec8bb1562cff0cb81375efb7431c731862ea
      articleNumber: "0020260914"
      codes: []
    - serialNumber: 82f46be9f257324a61c50b7bf9e1687884d4a9c8
      articleNumber: "0010021118"
      codes: []
    - serialNumber: 86cff0e4bbaf5549f19cc03a684fb20dc4354b48
      articleNumber: "0020260962"
      codes: []
    - serialNumber: 01199baf726db9024ca8bade0d6e29eed1efb5b9
      articleNumber: "0010023609"
      codes: []
    - serialNumber: 08cb492e34210bdaaa7306af6dcf4ead12de1e4a
      articleNumber: "0020184846"
      codes: []
    - serialNumber: 1c5e3590dbea56a5d9063a6a3a79ac6a9977525e
      articleNumber: "0010016349"
      codes: []
  connection_status:
    connected: true
  system:
    state:
      system:
        outdoorTemperature: 12.03125
        outdoorTemperatureAverage24h: 6.453125
        systemFlowTemperature: 27.75
        systemWaterPressure: 1.2
        energyManagerState: HEATING
        systemOff: false
      zones:
        - index: 0
          desiredRoomTemperatureSetpointHeating: 23
          desiredRoomTemperatureSetpointCooling: 24
          desiredRoomTemperatureSetpoint: 23
          currentRoomTemperature: 23.2875
          currentRoomHumidity: 46
          currentSpecialFunction: NONE
          heatingState: IDLE
          isManualCoolingActive: false
      circuits:
        - index: 0
          circuitState: HEATING
          currentCircuitFlowTemperature: 26.9375
          heatingCircuitFlowSetpoint: 27.800735
          calculatedEnergyManagerState: HEATING_ACTIVE
      dhw:
        - index: 255
          currentSpecialFunction: REGULAR
          currentDhwTemperature: 58
      ventilation:
        - index: 0
          currentSpecialFunction: REGULAR
    properties:
      system:
        controllerType: VRC720
        systemScheme: 8
        backupHeaterType: CONDENSING
        backupHeaterAllowedFor: DHW_AND_HEATING
        moduleConfigurationVR71: 3
        energyProvidePowerCutBehavior: DISABLE_HEATPUMP_AND_BACKUP_HEATER
        smartPhotovoltaicBufferOffset: 10
        externalEnergyManagementActivation: false
      zones:
        - index: 0
          isActive: true
          zoneBinding: CENTRAL_CONTROL
          isCoolingAllowed: true
          associatedCircuitIndex: 0
      circuits:
        - index: 0
          mixerCircuitTypeExternal: HEATING
          heatingCircuitType: MIXER_CIRCUIT_EXTERNAL
          isCoolingAllowed: true
      dhw:
        - index: 255
          minSetpoint: 35
          maxSetpoint: 70
      ventilation:
        - index: 0
    configuration:
      system:
        coolingStartTemperature: 24
        continuousHeatingStartSetpoint: -18
        alternativePoint: -21
        heatingCircuitBivalencePoint: 0
        dhwBivalencePoint: -7
        automaticCoolingOnOff: true
        adaptiveHeatingCurve: false
        dhwMaximumLoadingTime: 60
        dhwHysteresis: 5
        dhwFlowSetpointOffset: 25
        continuousHeatingRoomSetpoint: 20
        hybridControlStrategy: BIVALENCE_POINT
        maxFlowSetpointHpError: 25
        dhwMaximumTemperature: 80
        maximumPreheatingTime: 0
        paralellTankLoadingAllowed: true
      zones:
        - index: 0
          general:
            name: Haus
            holidayStartDateTime: "2015-01-01T00:00:00Z"
            holidayEndDateTime: "2015-01-01T00:00:00Z"
            holidaySetpoint: 15
          heating:
            operationModeHeating: MANUAL
            setBackTemperature: 20
            manualModeSetpointHeating: 23
            timeProgramHeating:
              metaInfo:
                minSlotsPerDay: 0
                maxSlotsPerDay: 12
                setpointRequiredPerSlot: true
              monday:
                - startTime: 360
                  endTime: 1320
                  setpoint: 20
              tuesday:
                - startTime: 360
                  endTime: 1320
                  setpoint: 20
              wednesday:
                - startTime: 360
                  endTime: 1320
                  setpoint: 20
              thursday:
                - startTime: 360
                  endTime: 1320
                  setpoint: 20
              friday:
                - startTime: 360
                  endTime: 1320
                  setpoint: 20
              saturday:
                - startTime: 450
                  endTime: 1410
                  setpoint: 20
              sunday:
                - startTime: 450
                  endTime: 1320
                  setpoint: 20
          cooling:
            operationModeCooling: TIME_CONTROLLED
            setpointCooling: 24
            manualModeSetpointCooling: 24
            timeProgramCooling:
              metaInfo:
                minSlotsPerDay: 0
                maxSlotsPerDay: 12
                setpointRequiredPerSlot: false
              monday:
                - startTime: 360
                  endTime: 1320
              tuesday:
                - startTime: 360
                  endTime: 1320
              wednesday:
                - startTime: 360
                  endTime: 1320
              thursday:
                - startTime: 360
                  endTime: 1320
              friday:
                - startTime: 360
                  endTime: 1320
              saturday:
                - startTime: 450
                  endTime: 1410
              sunday:
                - startTime: 450
                  endTime: 1320
      circuits:
        - index: 0
          heatingCurve: 0.2
          heatingFlowTemperatureMinimumSetpoint: 22
          heatingFlowTemperatureMaximumSetpoint: 55
          heatDemandLimitedByOutsideTemperature: 21
          minimumOutsideTemperatureCooling: 4
          heatingCircuitFlowSetpointExcessOffset: 0
          coolingFlowTemperatureMinimumSetpoint: 15
          setBackModeEnabled: true
          roomTemperatureControlMode: NON
      dhw:
        - index: 255
          operationModeDhw: TIME_CONTROLLED
          tappingSetpoint: 59
          holidayStartDateTime: "2015-01-01T00:00:00Z"
          holidayEndDateTime: "2015-01-01T00:00:00Z"
          timeProgramDhw:
            metaInfo:
              minSlotsPerDay: 0
              maxSlotsPerDay: 3
              setpointRequiredPerSlot: false
            monday:
              - startTime: 540
                endTime: 1260
            tuesday:
              - startTime: 540
                endTime: 1260
            wednesday:
              - startTime: 540
                endTime: 1260
            thursday:
              - startTime: 540
                endTime: 1260
            friday:
              - startTime: 540
                endTime: 1260
            saturday:
              - startTime: 540
                endTime: 1260
            sunday:
              - startTime: 540
                endTime: 1260
          timeProgramCirculationPump:
            metaInfo:
              minSlotsPerDay: 0
              maxSlotsPerDay: 3
              setpointRequiredPerSlot: false
            monday:
              - startTime: 360
                endTime: 1320
            tuesday:
              - startTime: 360
                endTime: 1320
            wednesday:
              - startTime: 360
                endTime: 1320
            thursday:
              - startTime: 360
                endTime: 1320
            friday:
              - startTime: 360
                endTime: 1320
            saturday:
              - startTime: 450
                endTime: 1410
            sunday:
              - startTime: 450
                endTime: 1320
      ventilation:
        - index: 0
          maximumDayFanStage: 4
          maximumNightFanStage: 1
          holidayStartDateTime: "2015-01-01T00:00:00Z"
          holidayEndDateTime: "2015-01-01T00:00:00Z"
          operationModeVentilation: TIME_CONTROLLED
          timeProgramVentilation:
            metaInfo:
              minSlotsPerDay: 0
              maxSlotsPerDay: 12
              setpointRequiredPerSlot: false
            monday:
              - startTime: 420
                endTime: 1290
            tuesday:
              - startTime: 420
                endTime: 1290
            wednesday:
              - startTime: 420
                endTime: 1290
            thursday:
              - startTime: 420
                endTime: 1290
            friday:
              - startTime: 420
                endTime: 1290
            saturday:
              - startTime: 480
                endTime: 1320
            sunday:
              - startTime: 480
                endTime: 1320
  current_system:
    system_type: HEATPUMP
    has_emf_capable_devices: true
    primary_heat_generator:
      device_uuid: b02c54f13c9c559f94c6309e2111c470cdf71cad
      ebus_id: HMU03
      spn: 351
      bus_coupler_address: 0
      article_number: "0010021118"
      emfValid: true
      device_serial_number: 82f46be9f257324a61c50b7bf9e1687884d4a9c8
      device_type: HEATPUMP
      first_data: "2023-11-18T16:19:21Z"
      last_data: "2024-03-09T15:10:47.613Z"
      data:
        - operation_mode: DOMESTIC_HOT_WATER
          value_type: CONSUMED_ELECTRICAL_ENERGY
          calculated: false
          from: "2023-11-18T16:19:21Z"
          to: "2024-03-09T15:10:45.832Z"
        - operation_mode: HEATING
          value_type: CONSUMED_ELECTRICAL_ENERGY
          calculated: false
          from: "2023-11-18T16:19:21Z"
          to: "2024-03-09T15:10:45.66Z"
        - operation_mode: DOMESTIC_HOT_WATER
          value_type: EARNED_ENVIRONMENT_ENERGY
          calculated: false
          from: "2023-11-18T16:19:21Z"
          to: "2024-03-09T15:10:46.753Z"
        - operation_mode: HEATING
          value_type: EARNED_ENVIRONMENT_ENERGY
          calculated: false
          from: "2023-11-18T16:19:21Z"
          to: "2024-03-09T15:10:46.566Z"
        - operation_mode: DOMESTIC_HOT_WATER
          value_type: HEAT_GENERATED
          calculated: false
          from: "2023-11-18T16:19:21Z"
          to: "2024-03-09T15:10:47.411Z"
        - operation_mode: HEATING
          value_type: HEAT_GENERATED
          calculated: false
          from: "2023-11-18T16:19:21Z"
          to: "2024-03-09T15:10:47.207Z"
      product_name: aroTHERM plus
    secondary_heat_generators: []
    electric_backup_heater:
      device_uuid: b9a61c142e1f52127daaee96794f0acb697cd2aa
      ebus_id: VWZ02
      spn: 351
      bus_coupler_address: 0
      article_number: "0010023609"
      emfValid: true
      device_serial_number: 01199baf726db9024ca8bade0d6e29eed1efb5b9
      device_type: ELECTRIC_AUXILIARY_HEATER
      first_data: "2023-11-18T16:19:21Z"
      last_data: "2024-03-09T15:10:49.082Z"
      data:
        - operation_mode: DOMESTIC_HOT_WATER
          value_type: CONSUMED_ELECTRICAL_ENERGY
          calculated: false
          from: "2023-11-18T16:19:21Z"
          to: "2024-03-09T15:10:48.66Z"
        - operation_mode: HEATING
          value_type: CONSUMED_ELECTRICAL_ENERGY
          calculated: false
          from: "2023-11-18T16:19:21Z"
          to: "2024-03-09T15:10:48.425Z"
        - operation_mode: DOMESTIC_HOT_WATER
          value_type: HEAT_GENERATED
          calculated: false
          from: "2023-12-08T06:43:42Z"
          to: "2024-03-09T15:10:49.082Z"
        - operation_mode: HEATING
          value_type: HEAT_GENERATED
          calculated: false
          from: "2023-12-08T06:43:42Z"
          to: "2024-03-09T15:10:48.863Z"
      product_name: hydraulic station
    solar_station: null
    ventilation:
      device_uuid: f0eb913121a6a9682d17bd3c4a4b240cb93e7480
      ebus_id: recoV
      spn: 302
      bus_coupler_address: 56
      article_number: "0010016349"
      emfValid: false
      device_serial_number: 1c5e3590dbea56a5d9063a6a3a79ac6a9977525e
      device_type: VENTILATION
      first_data: "2023-12-19T03:40:20Z"
      last_data: "2024-03-09T15:10:50.66Z"
      data:
        - operation_mode: HEATING
          value_type: CONSUMED_ELECTRICAL_ENERGY
          calculated: false
          from: "2023-12-19T03:40:20Z"
          to: "2024-03-09T15:10:50.66Z"
      product_name: VAR 360/4 E
    gateway: null
  mpc:
    devices: []
  rts:
    statistics:
      - deviceId: b9a61c142e1f52127daaee96794f0acb697cd2aa
        operationTime: 2207
        onOffCycles: 43
      - deviceId: b02c54f13c9c559f94c6309e2111c470cdf71cad
        operationTime: 86507
        onOffCycles: 469
  device_buckets:
    startDate: "2024-03-08T00:00:00Z"
    endDate: "2024-03-09T00:00:00Z"
    resolution: HOUR
    operationMode: DOMESTIC_HOT_WATER
    energyType: CONSUMED_ELECTRICAL_ENERGY
    totalConsumption: 5253.326202095345
    data:
      - startDate: "2024-03-08T00:00:00Z"
        endDate: "2024-03-08T01:00:00Z"
        value: 0
      - startDate: "2024-03-08T01:00:00Z"
        endDate: "2024-03-08T02:00:00Z"
        value: 0
      - startDate: "2024-03-08T02:00:00Z"
        endDate: "2024-03-08T03:00:00Z"
        value: 0
      - startDate: "2024-03-08T03:00:00Z"
        endDate: "2024-03-08T04:00:00Z"
        value: 0
      - startDate: "2024-03-08T04:00:00Z"
        endDate: "2024-03-08T05:00:00Z"
        value: 0
      - startDate: "2024-03-08T05:00:00Z"
        endDate: "2024-03-08T06:00:00Z"
        value: 0
      - startDate: "2024-03-08T06:00:00Z"
        endDate: "2024-03-08T07:00:00Z"
        value: 0
      - startDate: "2024-03-08T07:00:00Z"
        endDate: "2024-03-08T08:00:00Z"
        value: 84.24005208333334
      - startDate: "2024-03-08T08:00:00Z"
        endDate: "2024-03-08T09:00:00Z"
        value: 651.6336067708334
      - startDate: "2024-03-08T09:00:00Z"
        endDate: "2024-03-08T10:00:00Z"
        value: 0
      - startDate: "2024-03-08T10:00:00Z"
        endDate: "2024-03-08T11:00:00Z"
        value: 109.51457001944985
      - startDate: "2024-03-08T11:00:00Z"
        endDate: "2024-03-08T12:00:00Z"
        value: 1646.0519529408068
      - startDate: "2024-03-08T12:00:00Z"
        endDate: "2024-03-08T13:00:00Z"
        value: 1169.426152956665
      - startDate: "2024-03-08T13:00:00Z"
        endDate: "2024-03-08T14:00:00Z"
        value: 1147.6532934495692
      - startDate: "2024-03-08T14:00:00Z"
        endDate: "2024-03-08T15:00:00Z"
        value: 402.9375531165647
      - startDate: "2024-03-08T15:00:00Z"
        endDate: "2024-03-08T16:00:00Z"
        value: 41.869020758122744
      - startDate: "2024-03-08T16:00:00Z"
        endDate: "2024-03-08T17:00:00Z"
        value: 0
      - startDate: "2024-03-08T17:00:00Z"
        endDate: "2024-03-08T18:00:00Z"
        value: 0
      - startDate: "2024-03-08T18:00:00Z"
        endDate: "2024-03-08T19:00:00Z"
        value: 0
      - startDate: "2024-03-08T19:00:00Z"
        endDate: "2024-03-08T20:00:00Z"
        value: 0
      - startDate: "2024-03-08T20:00:00Z"
        endDate: "2024-03-08T21:00:00Z"
        value: 0
      - startDate: "2024-03-08T21:00:00Z"
        endDate: "2024-03-08T22:00:00Z"
        value: 0
      - startDate: "2024-03-08T22:00:00Z"
        endDate: "2024-03-08T23:00:00Z"
        value: 0
      - startDate: "2024-03-08T23:00:00Z"
        endDate: "2024-03-09T00:00:00Z"
        value: 0
signalkraft commented 7 months ago

There should be a service set_ventilation_fan_stage that you can call. Let me know if that works, or not. It's not very well tested, I don't have a recovair in my setup.

gamer123 commented 7 months ago

I tried, but I don't get it :D I tried to set the FAN status to 5. According to the APP, 1-5 should be possible. According to my understanding it must be data:{5} or data:{'5'} ? Please let me know if this is correct. Thank you very much ! @signalkraft image

gamer123 commented 6 months ago

@signalkraft there is missing a GUI input function, but i dont know how to add :| It is working this is the used command:

service: mypyllant.set_ventilation_fan_stage target: entity_id:

DAY is normal mode NIGHT is reduced mode

fightboy89 commented 5 months ago

I have the VAR 260 and also have the problem, that i can´t change die Fan Level via Home Assistant. I updated the HACS Component to the latest Version 0.8.3, but it still doesn´t work.

@gamer123 If i use your code, i still get an error. grafik Any idea?

Roadis commented 2 months ago

This works for me. Var 360 It changes the value for the day.

action: mypyllant.set_ventilation_fan_stage
entity_id: climate.zuhause_ventilation_var_360_4_climate
data: 
  maximum_fan_stage: 2
  fan_stage_type: "DAY"

I also added

 @property
    def extra_state_attributes(self) -> Mapping[str, Any] | None:
        attr = {
            "time_program_ventilation": self.ventilation.time_program_ventilation,
            "maximum_night_fan_stage": self.maximum_night_fan_stage,
            "maximum_day_fan_stage": self.maximum_day_fan_stage
        }
        return attr

    @property
    def maximum_night_fan_stage(self) -> int | None:
        return self.ventilation.maximum_night_fan_stage

    @property
    def maximum_day_fan_stage(self) -> int | None:
        return self.ventilation.maximum_day_fan_stage

Then you can see the Values in Homeassistant. image

But I'm not good enough in Python that i can make a PR where the values are written into the entity.

I tried to add it like this in the number.py:

        for ventilation_index, ventilation in enumerate(system.ventilation):
            sensors.append(
                lambda: MaximumFanStageDaySensor(
                    index, ventilation_index, coordinator
                )
            )
            sensors.append(
                lambda: MaximumFanStageNightSensor(
                    index, ventilation_index, coordinator
                )
            )

class MaximumFanStageDaySensor(
    VentilationClimate, NumberEntity
):
    _attr_native_max_value = 6
    _attr_native_min_value = 1
    _attr_step = 1

    async def async_set_native_value(self, value: int) -> None:
        await self.set_ventilation_fan_stage(value, fan_stage_type=VentilationFanStageType.DAY)

    @property
    def name(self):
        return f"{self.name_prefix} Maximum Fan Stage Day"

    @property
    def native_value(self) -> int:
        return self.ventilation.maximum_day_fan_stage

    @property
    def unique_id(self) -> str:
        return f"{self.system.id}_ventilation_{self.ventilation_index}_maximum_fan_stage_day"

class MaximumFanStageNightSensor(
    VentilationClimate, NumberEntity
):

    _attr_native_max_value = 6
    _attr_native_min_value = 1
    _attr_step = 1

    async def async_set_native_value(self, value: int) -> None:
        await self.set_ventilation_fan_stage(value, fan_stage_type=VentilationFanStageType.NIGHT)

    @property
    def name(self):
        return f"{self.name_prefix} Maximum Fan Stage Night"

    @property
    def native_value(self) -> int:
        return self.ventilation.maximum_night_fan_stage

    @property
    def unique_id(self) -> str:
        return f"{self.system.id}_ventilation_{self.ventilation_index}_maximum_fan_stage_night"

But my Problem is the Status is fixed. Its always "auto" and I can't override it because of the ClimateEntity. As I said. I'm not good in Python.

Maybe someone can help

It would then look like this: image

(Btw. changing the number works and it changes the Value in MyVailant)

Roadis commented 2 months ago

@signalkraft Maybe you could implement it. If I get a Branch I could test it. Or you can teach me how to do it :)

arhisa2021 commented 1 month ago

Hi @signalkraft and @Roadis

Nice start definitely. I'm also interested in this function but have the same problem in python as @signalkraft:) Did you maybe were able to solve this? Thanks for the great work and help. Regards