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

Unexpected error fetching myVAILLANT data: Circuit.__init__() missing 1 required positional argument: 'mixer_circuit_type_external' #139

Closed smmoroz closed 8 months ago

smmoroz commented 8 months ago

Before submitting a new issue

Problem description

I have recently migrated to myPyllant from multimatic integration. BTW, multimatic worked fine. Here is my setup (see details in logs below)

I'm running HA version is 2023.12.4 and myPyllant v0.8.0b2

During setup of the integration of got the following error. As a result, I have no devices and entities in HA.

2024-03-20 13:25:23.993 DEBUG (MainThread) [myPyllant.models] Creating related models from state: {'brand': 'vaillant', 'home': Home(extra_fields={'online_state': 'ONLINE', 'migration_finished_at': '2024-03-20T09:34:27.607564826Z'}, country_code='FR', timezone=tzfile('/usr/share/zoneinfo/Europe/Paris'), nomenclature='VR 920', serial_number='XXX', state='CLAIMED', system_id='XXX', home_name='Home', address={'street': 'XXX', 'extension': None, 'city': 'XXX', 'postal_code': 'XXX', 'country_code': 'FR'}, product_information='VR920', migration_state='FINISHED', cag=False, firmware_version='0357.40.34', firmware={'version': '0357.40.34', 'update_enabled': False, 'update_required': False}, product_metadata={'product_type': 'VR920', 'production_year': '19', 'production_week': '03', 'article_number': '0020252922'}), 'timezone': tzfile('/usr/share/zoneinfo/Europe/Paris'), 'control_identifier': <ControlIdentifier.VRC700: 'vrc700'>, 'connected': None, 'diagnostic_trouble_codes': None, 'rts': {}, 'mpc': {}, 'current_system': {'system_type': 'UNKNOWN', 'has_emf_capable_devices': False, 'primary_heat_generator': None, 'secondary_heat_generators': [], 'electric_backup_heater': None, 'solar_station': None, 'ventilation': None, 'gateway': None}, 'ambisense_capability': True, 'state': {'system': {'outdoor_temperature': 8.625, 'outdoor_temperature_average24h': 3.0585938, 'system_flow_temperature': 27.5, 'system_water_pressure': 1.2, 'legionella_protection_start_weekday': 'MONDAY', 'energy_manager_state': 'HEATING', 'system_off': False}, 'zones': [{'index': 0, 'desired_room_temperature_setpoint_heating': 22.0, 'desired_room_temperature_setpoint': 22.0, 'current_room_temperature': 29.375, 'current_room_humidity': 23.0, 'current_special_function': 'NONE'}], 'circuits': [{'index': 0, 'circuit_state': 'HEATING', 'current_circuit_flow_temperature': 27.5, 'heating_circuit_flow_setpoint': 29.873856, 'calculated_energy_manager_state': 'HEATING_ACTIVE'}, {'index': 2, 'circuit_state': 'STANDBY', 'heating_circuit_flow_setpoint': 0.0, 'calculated_energy_manager_state': 'HEATING_STANDBY'}], 'dhw': [{'index': 255, 'current_special_function': 'NONE', 'current_dhw_temperature': 55.0}]}, 'properties': {'system': {'controller_type': 'VRC700', 'controller_revision': 'R4', 'system_scheme': 1, 'backup_heater_type': 'CONDENSING', 'backup_heater_allowed_for': 'DOMESTIC_HOT_WATER_AND_HEATING', 'module_configuration_v_r71': 3, 'energy_provide_power_cut_behavior': 'DISABLE_HEATPUMP', 'smart_photovoltaic_buffer_offset': 10.0, 'external_energy_management_activation': False}, 'zones': [{'index': 0, 'is_active': True, 'zone_binding': 'CENTRAL_CONTROL', 'associated_circuit_index': 0}], 'circuits': [{'index': 0, 'mixer_circuit_type_external': 'HEATING', 'heating_circuit_type': 'DIRECT_HEATING_CIRCUIT', 'is_cooling_allowed': False}, {'index': 1, 'mixer_circuit_type_external': 'FIX_VALUE', 'heating_circuit_type': 'DIRECT_HEATING_CIRCUIT', 'is_cooling_allowed': False}], 'dhw': [{'index': 255, 'min_setpoint': 35.0, 'max_setpoint': 65.0}]}, 'configuration': {'system': {'continuous_heating_start_setpoint': -26.0, 'alternative_point': -21.0, 'heating_circuit_bivalence_point': 0.0, 'dhw_bivalence_point': -7.0, 'adaptive_heating_curve': True, 'dhw_maximum_loading_time': 45, 'dhw_hysteresis': 5.0, 'dhw_flow_setpoint_offset': 25.0, 'max_flow_setpoint_heatpump_error': 25.0, 'dhw_maximum_temperature': 80.0, 'hybrid_control_strategy': 'BIVALENCE_POINT', 'paralell_tank_loading_allowed': False}, 'zones': [{'index': 0, 'general': {'name': 'ZONE 1', 'holiday_start_date_time': '2001-01-01T00:00:00Z', 'holiday_end_date_time': '2001-01-01T00:00:00Z', 'holiday_setpoint': 5.0}, 'heating': {'operation_mode_heating': 'DAY', 'set_back_temperature': 20.0, 'day_temperature_heating': 22.0, 'time_program_heating': {'meta_info': {'min_slots_per_day': 0, 'max_slots_per_day': 3, 'setpoint_required_per_slot': False}, 'monday': [{'start_time': 360, 'end_time': 1320}], 'tuesday': [{'start_time': 360, 'end_time': 1320}], 'wednesday': [{'start_time': 360, 'end_time': 1320}], 'thursday': [{'start_time': 360, 'end_time': 1320}], 'friday': [{'start_time': 360, 'end_time': 1320}], 'saturday': [{'start_time': 450, 'end_time': 1410}], 'sunday': [{'start_time': 450, 'end_time': 1320}]}}}], 'circuits': [{'index': 0, 'heating_curve': 0.29999995, 'heating_flow_temperature_minimum_setpoint': 18.0, 'heating_flow_temperature_maximum_setpoint': 75.0, 'heat_demand_limited_by_outside_temperature': 16.0, 'heating_circuit_flow_setpoint_excess_offset': 0.0, 'setback_mode_enabled': True, 'room_temperature_control_mode': 'NON'}, {'index': 2, 'heating_curve': 1.2, 'heating_flow_temperature_minimum_setpoint': 15.0, 'heating_flow_temperature_maximum_setpoint': 90.0, 'heat_demand_limited_by_outside_temperature': 21.0, 'heating_circuit_flow_setpoint_excess_offset': 0.0, 'setback_mode_enabled': False, 'room_temperature_control_mode': 'NON'}], 'dhw': [{'index': 255, 'operation_mode_dhw': 'AUTO', 'tapping_setpoint': 55.0, 'holiday_start_date_time': '2001-01-01T00:00:00Z', 'holiday_end_date_time': '2001-01-01T00:00:00Z', 'time_program_dhw': {'meta_info': {'min_slots_per_day': 0, 'max_slots_per_day': 3, 'setpoint_required_per_slot': False}, 'monday': [{'start_time': 360, 'end_time': 1410}], 'tuesday': [{'start_time': 360, 'end_time': 1410}], 'wednesday': [{'start_time': 360, 'end_time': 1410}], 'thursday': [{'start_time': 360, 'end_time': 1410}], 'friday': [{'start_time': 360, 'end_time': 1410}], 'saturday': [{'start_time': 420, 'end_time': 1410}], 'sunday': [{'start_time': 420, 'end_time': 1410}]}, 'time_program_circulation_pump': {'meta_info': {'min_slots_per_day': 0, 'max_slots_per_day': 3, 'setpoint_required_per_slot': False}, 'monday': [{'start_time': 390, 'end_time': 410}, {'start_time': 840, 'end_time': 850}, {'start_time': 1170, 'end_time': 1200}], 'tuesday': [{'start_time': 390, 'end_time': 410}, {'start_time': 840, 'end_time': 850}, {'start_time': 1170, 'end_time': 1200}], 'wednesday': [{'start_time': 390, 'end_time': 410}, {'start_time': 840, 'end_time': 850}, {'start_time': 1170, 'end_time': 1200}], 'thursday': [{'start_time': 390, 'end_time': 410}, {'start_time': 840, 'end_time': 850}, {'start_time': 1170, 'end_time': 1200}], 'friday': [{'start_time': 390, 'end_time': 410}, {'start_time': 840, 'end_time': 850}, {'start_time': 1170, 'end_time': 1200}], 'saturday': [{'start_time': 450, 'end_time': 600}, {'start_time': 1170, 'end_time': 1260}], 'sunday': [{'start_time': 450, 'end_time': 600}, {'start_time': 1170, 'end_time': 1260}]}}]}, 'id': 'XXX'}
2024-03-20 13:25:23.999 WARNING (MainThread) [myPyllant.models] Error when merging properties
Traceback (most recent call last):
  File "/usr/local/lib/python3.11/site-packages/myPyllant/models.py", line 882, in merge_object
    properties = next(
                 ^^^^^
StopIteration
2024-03-20 13:25:24.003 ERROR (MainThread) [custom_components.mypyllant.coordinator] Unexpected error fetching myVAILLANT data: Circuit.__init__() missing 1 required positional argument: 'mixer_circuit_type_external'
Traceback (most recent call last):
  File "/usr/src/homeassistant/homeassistant/helpers/update_coordinator.py", line 300, in _async_refresh
    self.data = await self._async_update_data()
                ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
  File "/config/custom_components/mypyllant/coordinator.py", line 194, in _async_update_data
    async for system in await self.hass.async_add_executor_job(
  File "/usr/local/lib/python3.11/site-packages/myPyllant/api.py", line 355, in get_systems
    system = System.from_api(
             ^^^^^^^^^^^^^^^^
  File "/usr/local/lib/python3.11/site-packages/myPyllant/models.py", line 782, in from_api
    system.circuits = [
                      ^
  File "/usr/local/lib/python3.11/site-packages/myPyllant/models.py", line 783, in <listcomp>
    Circuit.from_api(system_id=system.id, timezone=system.timezone, **c)
  File "/usr/local/lib/python3.11/site-packages/myPyllant/models.py", line 74, in from_api
    return cls(**data)
           ^^^^^^^^^^^
  File "/usr/local/lib/python3.11/site-packages/pydantic/dataclasses.py", line 322, in new_init
    handle_extra_init(self, *args, **kwargs)
  File "/usr/local/lib/python3.11/site-packages/pydantic/dataclasses.py", line 286, in handle_extra_init
    init(self, *args, **{k: v for k, v in kwargs.items() if k in self.__dataclass_fields__})
TypeError: Circuit.__init__() missing 1 required positional argument: 'mixer_circuit_type_external'

Logs

Here is the output of GET 'https://api.vaillant-group.com/service-connected-control/vrc700/v1/systems/XXX'

{
    "state": {
        "system": {
            "outdoorTemperature": 8.625,
            "outdoorTemperatureAverage24h": 3.0585938,
            "systemFlowTemperature": 27.5,
            "systemWaterPressure": 1.2,
            "legionellaProtectionStartWeekday": "MONDAY",
            "energyManagerState": "HEATING",
            "systemOff": false
        },
        "zones": [
            {
                "index": 0,
                "desiredRoomTemperatureSetpointHeating": 22,
                "desiredRoomTemperatureSetpoint": 22,
                "currentRoomTemperature": 29.375,
                "currentRoomHumidity": 23,
                "currentSpecialFunction": "NONE"
            }
        ],
        "circuits": [
            {
                "index": 0,
                "circuitState": "HEATING",
                "currentCircuitFlowTemperature": 27.5,
                "heatingCircuitFlowSetpoint": 29.873856,
                "calculatedEnergyManagerState": "HEATING_ACTIVE"
            },
            {
                "index": 2,
                "circuitState": "STANDBY",
                "heatingCircuitFlowSetpoint": 0,
                "calculatedEnergyManagerState": "HEATING_STANDBY"
            }
        ],
        "domesticHotWater": [
            {
                "index": 255,
                "currentSpecialFunction": "NONE",
                "currentDomesticHotWaterTemperature": 55
            }
        ]
    },
    "properties": {
        "system": {
            "controllerType": "VRC700",
            "controllerRevision": "R4",
            "systemScheme": 1,
            "backupHeaterType": "CONDENSING",
            "backupHeaterAllowedFor": "DOMESTIC_HOT_WATER_AND_HEATING",
            "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": false
            },
            {
                "index": 1,
                "mixerCircuitTypeExternal": "FIX_VALUE",
                "heatingCircuitType": "DIRECT_HEATING_CIRCUIT",
                "isCoolingAllowed": false
            }
        ],
        "domesticHotWater": [
            {
                "index": 255,
                "minSetpoint": 35,
                "maxSetpoint": 65
            }
        ]
    },
    "configuration": {
        "system": {
            "continuousHeatingStartSetpoint": -26,
            "alternativePoint": -21,
            "heatingCircuitBivalencePoint": 0,
            "domesticHotWaterBivalencePoint": -7,
            "adaptiveHeatingCurve": true,
            "domesticHotWaterMaximumLoadingTime": 45,
            "domesticHotWaterHysteresis": 5,
            "domesticHotWaterFlowSetpointOffset": 25,
            "maxFlowSetpointHeatpumpError": 25,
            "domesticHotWaterMaximumTemperature": 80,
            "hybridControlStrategy": "BIVALENCE_POINT",
            "paralellTankLoadingAllowed": false
        },
        "zones": [
            {
                "index": 0,
                "general": {
                    "name": "ZONE 1",
                    "holidayStartDateTime": "2001-01-01T00:00:00Z",
                    "holidayEndDateTime": "2001-01-01T00:00:00Z",
                    "holidaySetpoint": 5
                },
                "heating": {
                    "operationModeHeating": "DAY",
                    "setBackTemperature": 20,
                    "dayTemperatureHeating": 22,
                    "timeProgramHeating": {
                        "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
                            }
                        ]
                    }
                }
            }
        ],
        "circuits": [
            {
                "index": 0,
                "heatingCurve": 0.29999995,
                "heatingFlowTemperatureMinimumSetpoint": 18,
                "heatingFlowTemperatureMaximumSetpoint": 75,
                "heatDemandLimitedByOutsideTemperature": 16,
                "heatingCircuitFlowSetpointExcessOffset": 0,
                "setbackModeEnabled": true,
                "roomTemperatureControlMode": "NON"
            },
            {
                "index": 2,
                "heatingCurve": 1.2,
                "heatingFlowTemperatureMinimumSetpoint": 15,
                "heatingFlowTemperatureMaximumSetpoint": 90,
                "heatDemandLimitedByOutsideTemperature": 21,
                "heatingCircuitFlowSetpointExcessOffset": 0,
                "setbackModeEnabled": false,
                "roomTemperatureControlMode": "NON"
            }
        ],
        "domesticHotWater": [
            {
                "index": 255,
                "operationModeDomesticHotWater": "AUTO",
                "tappingSetpoint": 55,
                "holidayStartDateTime": "2001-01-01T00:00:00Z",
                "holidayEndDateTime": "2001-01-01T00:00:00Z",
                "timeProgramDomesticHotWater": {
                    "metaInfo": {
                        "minSlotsPerDay": 0,
                        "maxSlotsPerDay": 3,
                        "setpointRequiredPerSlot": false
                    },
                    "monday": [
                        {
                            "startTime": 360,
                            "endTime": 1410
                        }
                    ],
                    "tuesday": [
                        {
                            "startTime": 360,
                            "endTime": 1410
                        }
                    ],
                    "wednesday": [
                        {
                            "startTime": 360,
                            "endTime": 1410
                        }
                    ],
                    "thursday": [
                        {
                            "startTime": 360,
                            "endTime": 1410
                        }
                    ],
                    "friday": [
                        {
                            "startTime": 360,
                            "endTime": 1410
                        }
                    ],
                    "saturday": [
                        {
                            "startTime": 420,
                            "endTime": 1410
                        }
                    ],
                    "sunday": [
                        {
                            "startTime": 420,
                            "endTime": 1410
                        }
                    ]
                },
                "timeProgramCirculationPump": {
                    "metaInfo": {
                        "minSlotsPerDay": 0,
                        "maxSlotsPerDay": 3,
                        "setpointRequiredPerSlot": false
                    },
                    "monday": [
                        {
                            "startTime": 390,
                            "endTime": 410
                        },
                        {
                            "startTime": 840,
                            "endTime": 850
                        },
                        {
                            "startTime": 1170,
                            "endTime": 1200
                        }
                    ],
                    "tuesday": [
                        {
                            "startTime": 390,
                            "endTime": 410
                        },
                        {
                            "startTime": 840,
                            "endTime": 850
                        },
                        {
                            "startTime": 1170,
                            "endTime": 1200
                        }
                    ],
                    "wednesday": [
                        {
                            "startTime": 390,
                            "endTime": 410
                        },
                        {
                            "startTime": 840,
                            "endTime": 850
                        },
                        {
                            "startTime": 1170,
                            "endTime": 1200
                        }
                    ],
                    "thursday": [
                        {
                            "startTime": 390,
                            "endTime": 410
                        },
                        {
                            "startTime": 840,
                            "endTime": 850
                        },
                        {
                            "startTime": 1170,
                            "endTime": 1200
                        }
                    ],
                    "friday": [
                        {
                            "startTime": 390,
                            "endTime": 410
                        },
                        {
                            "startTime": 840,
                            "endTime": 850
                        },
                        {
                            "startTime": 1170,
                            "endTime": 1200
                        }
                    ],
                    "saturday": [
                        {
                            "startTime": 450,
                            "endTime": 600
                        },
                        {
                            "startTime": 1170,
                            "endTime": 1260
                        }
                    ],
                    "sunday": [
                        {
                            "startTime": 450,
                            "endTime": 600
                        },
                        {
                            "startTime": 1170,
                            "endTime": 1260
                        }
                    ]
                }
            }
        ]
    }
}

Here is the output of GET https://api.vaillant-group.com/service-connected-control/end-user-app-api/v1/emf/v2/XXX/currentSystem'

{
    "system_type": "UNKNOWN",
    "has_emf_capable_devices": false,
    "primary_heat_generator": null,
    "secondary_heat_generators": [],
    "electric_backup_heater": null,
    "solar_station": null,
    "ventilation": null,
    "gateway": null
}

Somewhere in between I got Could not get RTS data

2024-03-20 13:25:22.035 WARNING (MainThread) [myPyllant.api] Could not get RTS data
Traceback (most recent call last):
  File "/usr/local/lib/python3.11/site-packages/myPyllant/api.py", line 1121, in get_rts
    response = await self.aiohttp_session.get(
               ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
  File "/usr/local/lib/python3.11/site-packages/aiohttp/client.py", line 687, in _request
    await raise_for_status(resp)
  File "/usr/local/lib/python3.11/site-packages/myPyllant/http_client.py", line 50, in on_raise_for_status
    response.raise_for_status()
  File "/usr/local/lib/python3.11/site-packages/aiohttp/client_reqrep.py", line 1059, in raise_for_status
    raise ClientResponseError(
aiohttp.client_exceptions.ClientResponseError: 404, message='Resource Not Found', url=URL('https://api.vaillant-group.com/service-connected-control/vrc700/v1/rts/XXX/devices')

and Could not get MPC data

2024-03-20 13:25:22.304 WARNING (MainThread) [myPyllant.api] Could not get MPC data
Traceback (most recent call last):
  File "/usr/local/lib/python3.11/site-packages/myPyllant/api.py", line 1140, in get_mpc
    response = await self.aiohttp_session.get(
               ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
  File "/usr/local/lib/python3.11/site-packages/aiohttp/client.py", line 687, in _request
    await raise_for_status(resp)
  File "/usr/local/lib/python3.11/site-packages/myPyllant/http_client.py", line 50, in on_raise_for_status
    response.raise_for_status()
  File "/usr/local/lib/python3.11/site-packages/aiohttp/client_reqrep.py", line 1059, in raise_for_status
    raise ClientResponseError(
aiohttp.client_exceptions.ClientResponseError: 404, message='Resource Not Found', url=URL('https://api.vaillant-group.com/service-connected-control/vrc700/v1/hem/XXX/mpc')

Please let me know if you need any further information.

signalkraft commented 8 months ago

Please updated to the latest beta release of the component and try again, I made the mentioned field optional.

smmoroz commented 8 months ago

@signalkraft thank you for your quick response! I have just installed 0.8.0b4 and it works (at least partially). I now have 10 devices and 30 entities.

But I still have a lot of these warninings:

2024-03-21 11:01:02.280 DEBUG (MainThread) [myPyllant.models] Creating related models from state: <SKIPPED>
2024-03-21 10:57:50.238 WARNING (MainThread) [myPyllant.models] Error when merging properties
Traceback (most recent call last):
  File "/usr/local/lib/python3.11/site-packages/myPyllant/models.py", line 882, in merge_object
    properties = next(
                 ^^^^^
StopIteration

ambiSense still doesn't work. I can see ambiSense devices, but they have no entities. You can find the output of 'GET', url=URL('https://api.vaillant-group.com/service-connected-control/end-user-app-api/v1/api/v1/ambisense/facilities/XXX/rooms') below. So, all info to create climate entities are available. I assume they are not created because of this:

2024-03-21 10:57:53.462 ERROR (MainThread) [homeassistant.components.climate] Error adding entities for domain climate with platform mypyllant
Traceback (most recent call last):
  File "/usr/src/homeassistant/homeassistant/helpers/entity_platform.py", line 509, in async_add_entities
    await asyncio.gather(*tasks)
  File "/usr/src/homeassistant/homeassistant/helpers/entity_platform.py", line 664, in _async_add_entity
    capabilities=entity.capability_attributes,
                 ^^^^^^^^^^^^^^^^^^^^^^^^^^^^
  File "/usr/src/homeassistant/homeassistant/components/climate/__init__.py", line 276, in capability_attributes
    supported_features = self.supported_features
                         ^^^^^^^^^^^^^^^^^^^^^^^
  File "/config/custom_components/mypyllant/climate.py", line 487, in supported_features
    | ClimateEntityFeature.TURN_OFF
      ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
  File "/usr/local/lib/python3.11/enum.py", line 784, in __getattr__
    raise AttributeError(name) from None
AttributeError: TURN_OFF
2024-03-21 10:57:53.489 ERROR (MainThread) [homeassistant.components.climate] Error adding entities for domain climate with platform mypyllant
Traceback (most recent call last):
  File "/usr/src/homeassistant/homeassistant/helpers/entity_platform.py", line 509, in async_add_entities
    await asyncio.gather(*tasks)
  File "/usr/src/homeassistant/homeassistant/helpers/entity_platform.py", line 664, in _async_add_entity
    capabilities=entity.capability_attributes,
                 ^^^^^^^^^^^^^^^^^^^^^^^^^^^^
  File "/usr/src/homeassistant/homeassistant/components/climate/__init__.py", line 276, in capability_attributes
    supported_features = self.supported_features
                         ^^^^^^^^^^^^^^^^^^^^^^^
  File "/config/custom_components/mypyllant/climate.py", line 798, in supported_features
    | ClimateEntityFeature.TURN_OFF
      ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
  File "/usr/local/lib/python3.11/enum.py", line 784, in __getattr__
    raise AttributeError(name) from None
AttributeError: TURN_OFF
2024-03-21 10:57:53.508 ERROR (MainThread) [homeassistant.components.climate] Error while setting up mypyllant platform for climate
Traceback (most recent call last):
  File "/usr/src/homeassistant/homeassistant/helpers/entity_platform.py", line 369, in _async_setup_platform
    await asyncio.gather(*pending)
  File "/usr/src/homeassistant/homeassistant/helpers/entity_platform.py", line 509, in async_add_entities
    await asyncio.gather(*tasks)
  File "/usr/src/homeassistant/homeassistant/helpers/entity_platform.py", line 664, in _async_add_entity
    capabilities=entity.capability_attributes,
                 ^^^^^^^^^^^^^^^^^^^^^^^^^^^^
  File "/usr/src/homeassistant/homeassistant/components/climate/__init__.py", line 276, in capability_attributes
    supported_features = self.supported_features
                         ^^^^^^^^^^^^^^^^^^^^^^^
  File "/config/custom_components/mypyllant/climate.py", line 487, in supported_features
    | ClimateEntityFeature.TURN_OFF
      ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
  File "/usr/local/lib/python3.11/enum.py", line 784, in __getattr__
    raise AttributeError(name) from None
AttributeError: TURN_OFF

ambiSense info

[
    {
        "roomIndex": 0,
        "roomConfiguration": {
            "name": "Прихожая",
            "temperatureSetpoint": 22,
            "operationMode": "auto",
            "currentTemperature": 24.5,
            "currentHumidity": null,
            "buttonLock": null,
            "windowState": false,
            "devices": [
                {
                    "name": "Прихожая",
                    "sgtin": "XXX1",
                    "deviceType": "TRV",
                    "lowBat": false,
                    "unreach": false,
                    "rssi": -68,
                    "rssiPeer": -69
                }
            ],
            "iconId": "HOBBY_ROOM",
            "quickVetoEndTime": null
        },
        "timeprogram": {
            "monday": [],
            "tuesday": [],
            "wednesday": [],
            "thursday": [],
            "friday": [],
            "saturday": [],
            "sunday": []
        }
    },
    {
        "roomIndex": 3,
        "roomConfiguration": {
            "name": "Спальня",
            "temperatureSetpoint": 19,
            "operationMode": "auto",
            "currentTemperature": 21.1,
            "currentHumidity": null,
            "buttonLock": null,
            "windowState": false,
            "devices": [
                {
                    "name": "Спальня",
                    "sgtin": "XXX2",
                    "deviceType": "TRV",
                    "lowBat": false,
                    "unreach": false,
                    "rssi": -56,
                    "rssiPeer": -57
                }
            ],
            "iconId": "BEDROOM",
            "quickVetoEndTime": null
        },
        "timeprogram": {
            "monday": [],
            "tuesday": [],
            "wednesday": [],
            "thursday": [],
            "friday": [],
            "saturday": [],
            "sunday": []
        }
    },
    {
        "roomIndex": 1,
        "roomConfiguration": {
            "name": "Офис",
            "temperatureSetpoint": 22,
            "operationMode": "auto",
            "currentTemperature": 24.4,
            "currentHumidity": null,
            "buttonLock": null,
            "windowState": false,
            "devices": [
                {
                    "name": "Офис",
                    "sgtin": "XXX3",
                    "deviceType": "TRV",
                    "lowBat": false,
                    "unreach": false,
                    "rssi": -85,
                    "rssiPeer": -78
                }
            ],
            "iconId": "OFFICE",
            "quickVetoEndTime": null
        },
        "timeprogram": {
            "monday": [],
            "tuesday": [],
            "wednesday": [],
            "thursday": [],
            "friday": [],
            "saturday": [],
            "sunday": []
        }
    },
    {
        "roomIndex": 4,
        "roomConfiguration": {
            "name": "Детская",
            "temperatureSetpoint": 19,
            "operationMode": "auto",
            "currentTemperature": 23,
            "currentHumidity": null,
            "buttonLock": null,
            "windowState": false,
            "devices": [
                {
                    "name": "Детская",
                    "sgtin": "XXX4",
                    "deviceType": "TRV",
                    "lowBat": false,
                    "unreach": false,
                    "rssi": -73,
                    "rssiPeer": -83
                }
            ],
            "iconId": "CHILDREN_ROOM",
            "quickVetoEndTime": null
        },
        "timeprogram": {
            "monday": [],
            "tuesday": [],
            "wednesday": [],
            "thursday": [],
            "friday": [],
            "saturday": [],
            "sunday": []
        }
    },
    {
        "roomIndex": 2,
        "roomConfiguration": {
            "name": "Гостиная",
            "temperatureSetpoint": 22,
            "operationMode": "auto",
            "currentTemperature": 24.1,
            "currentHumidity": null,
            "buttonLock": null,
            "windowState": false,
            "devices": [
                {
                    "name": "Гостиная",
                    "sgtin": "XXX5",
                    "deviceType": "TRV",
                    "lowBat": false,
                    "unreach": false,
                    "rssi": -64,
                    "rssiPeer": -63
                }
            ],
            "iconId": "LIVING_ROOM",
            "quickVetoEndTime": null
        },
        "timeprogram": {
            "monday": [],
            "tuesday": [],
            "wednesday": [],
            "thursday": [],
            "friday": [],
            "saturday": [],
            "sunday": []
        }
    }
]
signalkraft commented 8 months ago

Please update to the latest pre-release, this issue sbould already be fixed.

smmoroz commented 8 months ago

Just tried v0.8.1. I still have these two errors. BTW, I'm still running HA 2023.12.4, maybe this is important.

Logger: homeassistant.components.climate
Source: helpers/entity_platform.py:509
Integration: Climate (documentation, issues)
First occurred: 12:25:25 (2 occurrences)
Last logged: 12:25:25

Error adding entities for domain climate with platform mypyllant
Traceback (most recent call last):
  File "/usr/src/homeassistant/homeassistant/helpers/entity_platform.py", line 509, in async_add_entities
    await asyncio.gather(*tasks)
  File "/usr/src/homeassistant/homeassistant/helpers/entity_platform.py", line 664, in _async_add_entity
    capabilities=entity.capability_attributes,
                 ^^^^^^^^^^^^^^^^^^^^^^^^^^^^
  File "/usr/src/homeassistant/homeassistant/components/climate/__init__.py", line 276, in capability_attributes
    supported_features = self.supported_features
                         ^^^^^^^^^^^^^^^^^^^^^^^
  File "/config/custom_components/mypyllant/climate.py", line 487, in supported_features
    | ClimateEntityFeature.TURN_OFF
      ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
  File "/usr/local/lib/python3.11/enum.py", line 784, in __getattr__
    raise AttributeError(name) from None
AttributeError: TURN_OFF

and

Logger: myPyllant.models
Source: /usr/local/lib/python3.11/site-packages/myPyllant/models.py:886
First occurred: 12:25:24 (8 occurrences)
Last logged: 12:31:52

Error when merging properties
Traceback (most recent call last):
  File "/usr/local/lib/python3.11/site-packages/myPyllant/models.py", line 882, in merge_object
    properties = next(
                 ^^^^^
StopIteration
signalkraft commented 8 months ago

You need at least 2024.2

smmoroz commented 8 months ago

Thank you so much! I can finally see Climate entities for ambisense devices, although there is are no Calendars for them. But I will report this in a separate issue.

What about these errors? Should i ignore them?

Logger: myPyllant.models
Source: /usr/local/lib/python3.12/site-packages/myPyllant/models.py:886
First occurred: 18:42:59 (21 occurrences)
Last logged: 19:00:47

Error when merging properties
Traceback (most recent call last):
  File "/usr/local/lib/python3.12/site-packages/myPyllant/models.py", line 882, in merge_object
    properties = next(
                 ^^^^^
StopIteration

Other than that, you can close the issue.

signalkraft commented 8 months ago

That's just a warning, most likely because your setup doesn't return additional properties. You can ignore it and I'll make it a debug log in the next release.