diff --git a/homeassistant/components/overkiz/climate/atlantic_electrical_heater_with_adjustable_temperature_setpoint.py b/homeassistant/components/overkiz/climate/atlantic_electrical_heater_with_adjustable_temperature_setpoint.py index 8b813372fd35..faccd8e10dda 100644 --- a/homeassistant/components/overkiz/climate/atlantic_electrical_heater_with_adjustable_temperature_setpoint.py +++ b/homeassistant/components/overkiz/climate/atlantic_electrical_heater_with_adjustable_temperature_setpoint.py @@ -167,7 +167,13 @@ class AtlanticElectricalHeaterWithAdjustableTemperatureSetpoint( @override def target_temperature(self) -> float | None: """Return the temperature.""" - if state := self.device.states.get(OverkizState.CORE_TARGET_TEMPERATURE): + # core:TargetTemperatureState stays pinned to comfort in auto mode. + state_name = ( + OverkizState.IO_EFFECTIVE_TEMPERATURE_SETPOINT + if self.hvac_mode == HVACMode.AUTO + else OverkizState.CORE_TARGET_TEMPERATURE + ) + if state := self.device.states.get(state_name): return state.value_as_float return None @@ -187,6 +193,10 @@ class AtlanticElectricalHeaterWithAdjustableTemperatureSetpoint( async def async_set_temperature(self, **kwargs: Any) -> None: """Set new temperature.""" temperature = kwargs[ATTR_TEMPERATURE] - await self.executor.async_execute_command( - OverkizCommand.SET_TARGET_TEMPERATURE, temperature + # setTargetTemperature would overwrite comfort instead of the preset. + command = ( + OverkizCommand.SET_DEROGATED_TARGET_TEMPERATURE + if self.hvac_mode == HVACMode.AUTO + else OverkizCommand.SET_TARGET_TEMPERATURE ) + await self.executor.async_execute_command(command, temperature) diff --git a/tests/components/overkiz/fixtures/setup/cloud_atlantic_cozytouch.json b/tests/components/overkiz/fixtures/setup/cloud_atlantic_cozytouch.json index 1b530de81464..7f47e2773e1d 100644 --- a/tests/components/overkiz/fixtures/setup/cloud_atlantic_cozytouch.json +++ b/tests/components/overkiz/fixtures/setup/cloud_atlantic_cozytouch.json @@ -3905,6 +3905,1372 @@ "type": 1, "oid": "260c6316-213c-45ee-9c38-46850a698bf2", "uiClass": "HeatingSystem" + }, + { + "creationTime": 1602324374000, + "lastUpdateTime": 1602324374000, + "label": "Living Room Heater", + "deviceURL": "io://1234-5678-5643/11009627#1", + "shortcut": false, + "controllableName": "io:AtlanticElectricalHeaterWithAdjustableTemperatureSetpointIOComponent", + "definition": { + "commands": [ + { + "commandName": "addLockLevel", + "nparams": 2 + }, + { + "commandName": "advancedRefresh", + "nparams": 2 + }, + { + "commandName": "cancelHeatingLevel", + "nparams": 1 + }, + { + "commandName": "delayedStopIdentify", + "nparams": 1 + }, + { + "commandName": "getName", + "nparams": 0 + }, + { + "commandName": "identify", + "nparams": 0 + }, + { + "commandName": "noPersonInside", + "nparams": 0 + }, + { + "commandName": "off", + "nparams": 0 + }, + { + "commandName": "personInside", + "nparams": 0 + }, + { + "commandName": "refreshComfortTemperature", + "nparams": 0 + }, + { + "commandName": "refreshDateTime", + "nparams": 0 + }, + { + "commandName": "refreshDerogatedTargetTemperature", + "nparams": 0 + }, + { + "commandName": "refreshEcoTemperature", + "nparams": 0 + }, + { + "commandName": "refreshHeatingLevel", + "nparams": 0 + }, + { + "commandName": "refreshIdentifier", + "nparams": 0 + }, + { + "commandName": "refreshManufacturerName", + "nparams": 0 + }, + { + "commandName": "refreshMaximumHeatingTargetTemperature", + "nparams": 0 + }, + { + "commandName": "refreshMaximumTargetTemperature", + "nparams": 0 + }, + { + "commandName": "refreshOperatingMode", + "nparams": 0 + }, + { + "commandName": "refreshTargetTemperature", + "nparams": 0 + }, + { + "commandName": "refreshTemperature", + "nparams": 0 + }, + { + "commandName": "refreshTimeProgram", + "nparams": 0 + }, + { + "commandName": "removeLockLevel", + "nparams": 1 + }, + { + "commandName": "resetLockLevels", + "nparams": 0 + }, + { + "commandName": "setComfortTemperature", + "nparams": 1 + }, + { + "commandName": "setDateTime", + "nparams": 1 + }, + { + "commandName": "setDerogatedTargetTemperature", + "nparams": 1 + }, + { + "commandName": "setEcoTemperature", + "nparams": 1 + }, + { + "commandName": "setHeatingLevel", + "nparams": 1 + }, + { + "commandName": "setHeatingLevelWithTimer", + "nparams": 2 + }, + { + "commandName": "setHolidays", + "nparams": 1 + }, + { + "commandName": "setHolidaysTargetTemperature", + "nparams": 1 + }, + { + "commandName": "setName", + "nparams": 1 + }, + { + "commandName": "setOccupancyActivation", + "nparams": 1 + }, + { + "commandName": "setOccupancy", + "nparams": 1 + }, + { + "commandName": "setOpenWindowDetectionActivation", + "nparams": 1 + }, + { + "commandName": "setOperatingMode", + "nparams": 1 + }, + { + "commandName": "setPreviousTargetTemperature", + "nparams": 1 + }, + { + "commandName": "setSchedulingType", + "nparams": 1 + }, + { + "commandName": "setTargetTemperature", + "nparams": 1 + }, + { + "commandName": "setTimeProgram", + "nparams": 1 + }, + { + "commandName": "startIdentify", + "nparams": 0 + }, + { + "commandName": "stopIdentify", + "nparams": 0 + }, + { + "commandName": "wink", + "nparams": 1 + }, + { + "commandName": "pairOneWayController", + "nparams": 2 + }, + { + "commandName": "refreshAutoProgram", + "nparams": 0 + }, + { + "commandName": "refreshControllerAddress", + "nparams": 0 + }, + { + "commandName": "refreshCumulatedLowering", + "nparams": 0 + }, + { + "commandName": "refreshCurrentWorkingRate", + "nparams": 0 + }, + { + "commandName": "refreshDeletionCancelation", + "nparams": 0 + }, + { + "commandName": "refreshEffectiveTemperatureSetpoint", + "nparams": 0 + }, + { + "commandName": "refreshLocalLeadTime", + "nparams": 0 + }, + { + "commandName": "refreshModel", + "nparams": 0 + }, + { + "commandName": "refreshNativeFunctionalLevel", + "nparams": 0 + }, + { + "commandName": "refreshPeakNotice", + "nparams": 0 + }, + { + "commandName": "refreshPeakWarning", + "nparams": 0 + }, + { + "commandName": "refreshPowerAndTension", + "nparams": 0 + }, + { + "commandName": "refreshRoomDeletionThreshold", + "nparams": 0 + }, + { + "commandName": "refreshSetpointLoweringTemperatureInProgMode", + "nparams": 0 + }, + { + "commandName": "refreshSynchronisationRequest", + "nparams": 0 + }, + { + "commandName": "refreshTemperatureProbeCalibrationOffset", + "nparams": 0 + }, + { + "commandName": "setCommunicationTest", + "nparams": 1 + }, + { + "commandName": "setDeletionCancelation", + "nparams": 1 + }, + { + "commandName": "setExpectedPresence", + "nparams": 1 + }, + { + "commandName": "setHeatingLevelForTrigger", + "nparams": 1 + }, + { + "commandName": "setNativeLevelsList", + "nparams": 1 + }, + { + "commandName": "setPeakNotice", + "nparams": 1 + }, + { + "commandName": "setPeakWarning", + "nparams": 1 + }, + { + "commandName": "setRoomDeletionThreshold", + "nparams": 1 + }, + { + "commandName": "setSetpointLoweringTemperatureInProgMode", + "nparams": 1 + }, + { + "commandName": "setTemperatureProbeCalibrationOffset", + "nparams": 1 + }, + { + "commandName": "setTwinningExit", + "nparams": 1 + }, + { + "commandName": "unpairAllOneWayControllers", + "nparams": 0 + }, + { + "commandName": "unpairOneWayController", + "nparams": 2 + } + ], + "states": [ + { + "type": "ContinuousState", + "qualifiedName": "core:ComfortRoomTemperatureState" + }, + { + "eventBased": true, + "type": "DataState", + "qualifiedName": "core:CommandLockLevelsState" + }, + { + "type": "DataState", + "qualifiedName": "core:DateTimeState" + }, + { + "type": "ContinuousState", + "qualifiedName": "core:DerogatedTargetTemperatureState" + }, + { + "type": "DiscreteState", + "values": ["good", "low", "normal", "verylow"], + "qualifiedName": "core:DiscreteRSSILevelState" + }, + { + "type": "ContinuousState", + "qualifiedName": "core:EcoRoomTemperatureState" + }, + { + "type": "DiscreteState", + "values": ["off", "on"], + "qualifiedName": "core:HolidaysModeState" + }, + { + "type": "ContinuousState", + "qualifiedName": "core:HolidaysTargetTemperatureState" + }, + { + "type": "DataState", + "qualifiedName": "core:IdentifierState" + }, + { + "type": "DataState", + "qualifiedName": "core:ManufacturerNameState" + }, + { + "type": "ContinuousState", + "qualifiedName": "core:MaximumHeatingTargetTemperatureState" + }, + { + "type": "ContinuousState", + "qualifiedName": "core:MaximumTargetTemperatureState" + }, + { + "type": "DataState", + "qualifiedName": "core:NameState" + }, + { + "type": "DiscreteState", + "values": ["active", "inactive"], + "qualifiedName": "core:OccupancyActivationState" + }, + { + "type": "DiscreteState", + "values": ["off", "on"], + "qualifiedName": "core:OnOffState" + }, + { + "type": "DiscreteState", + "values": ["active", "inactive"], + "qualifiedName": "core:OpenWindowDetectionActivationState" + }, + { + "type": "DiscreteState", + "values": [ + "antifreeze", + "auto", + "away", + "eco", + "frostprotection", + "manual", + "max", + "normal", + "off", + "on", + "prog", + "program", + "boost" + ], + "qualifiedName": "core:OperatingModeState" + }, + { + "type": "ContinuousState", + "qualifiedName": "core:PreviousTargetTemperatureState" + }, + { + "type": "ContinuousState", + "qualifiedName": "core:PriorityLockTimerState" + }, + { + "type": "ContinuousState", + "qualifiedName": "core:RSSILevelState" + }, + { + "type": "DiscreteState", + "values": ["increase", "none", "standby"], + "qualifiedName": "core:RegulationModeState" + }, + { + "type": "DiscreteState", + "values": ["available", "unavailable"], + "qualifiedName": "core:StatusState" + }, + { + "type": "ContinuousState", + "qualifiedName": "core:TargetTemperatureState" + }, + { + "type": "DataState", + "qualifiedName": "core:TimeProgramState" + }, + { + "type": "ContinuousState", + "qualifiedName": "core:VersionState" + }, + { + "type": "DataState", + "qualifiedName": "io:AutoProgramState" + }, + { + "type": "DataState", + "qualifiedName": "io:ControllerAddressState" + }, + { + "type": "ContinuousState", + "qualifiedName": "io:CumulatedLoweringState" + }, + { + "type": "ContinuousState", + "qualifiedName": "io:CurrentWorkingRateState" + }, + { + "type": "DiscreteState", + "values": ["deletion cancelation", "no deletion cancelation"], + "qualifiedName": "io:DeletionCancelationState" + }, + { + "type": "ContinuousState", + "qualifiedName": "io:EffectiveTemperatureSetpointState" + }, + { + "type": "ContinuousState", + "qualifiedName": "io:ExpectedPresenceState" + }, + { + "type": "DiscreteState", + "values": ["external", "internal"], + "qualifiedName": "io:InternalExternalSchedulingTypeState" + }, + { + "type": "ContinuousState", + "qualifiedName": "io:LocalLeadTimeState" + }, + { + "type": "DiscreteState", + "values": [ + "boost", + "comfort", + "comfort-1", + "comfort-2", + "eco", + "frostprotection", + "off", + "secured" + ], + "qualifiedName": "io:MaximumHeatingLevelState" + }, + { + "type": "DataState", + "qualifiedName": "io:ModelState" + }, + { + "type": "DiscreteState", + "values": ["base", "medium", "top"], + "qualifiedName": "io:NativeFunctionalLevelState" + }, + { + "type": "DiscreteState", + "values": ["long peak", "no peak", "short peak"], + "qualifiedName": "io:PeakNoticeState" + }, + { + "type": "DiscreteState", + "values": ["long peak warning", "no warning", "short peak warning"], + "qualifiedName": "io:PeakWarningState" + }, + { + "type": "DataState", + "qualifiedName": "io:PowerState" + }, + { + "type": "DiscreteState", + "values": [ + "comfortLevel1", + "comfortLevel2", + "comfortLevel3", + "comfortLevel4", + "environmentProtection", + "humanProtection", + "userLevel1", + "userLevel2" + ], + "qualifiedName": "io:PriorityLockLevelState" + }, + { + "type": "DiscreteState", + "values": [ + "LSC", + "SAAC", + "SFC", + "UPS", + "externalGateway", + "localUser", + "myself", + "rain", + "security", + "temperature", + "timer", + "user", + "wind" + ], + "qualifiedName": "io:PriorityLockOriginatorState" + }, + { + "type": "DataState", + "qualifiedName": "io:RoomDeletionThresholdState" + }, + { + "type": "DiscreteState", + "values": ["kept", "lost"], + "qualifiedName": "io:RunningState" + }, + { + "type": "ContinuousState", + "qualifiedName": "io:SetpointLoweringTemperatureInProgModeState" + }, + { + "type": "DiscreteState", + "values": [ + "boost", + "comfort", + "comfort-1", + "comfort-2", + "eco", + "frostprotection", + "off", + "secured" + ], + "qualifiedName": "io:TargetHeatingLevelState" + }, + { + "type": "ContinuousState", + "qualifiedName": "io:TemperatureProbeCalibrationOffsetState" + }, + { + "type": "DataState", + "qualifiedName": "io:TensionState" + }, + { + "type": "ContinuousState", + "qualifiedName": "io:TimerForTransitoryStateState" + }, + { + "type": "ContinuousState", + "qualifiedName": "io:UptimeState" + } + ], + "dataProperties": [ + { + "value": "500", + "qualifiedName": "core:identifyInterval" + } + ], + "widgetName": "AtlanticElectricalHeaterWithAdjustableTemperatureSetpoint", + "uiProfiles": [ + "StatefulOperatingModeHeating", + "OperatingModeHeating", + "StatefulThermostat", + "Thermostat" + ], + "uiClass": "HeatingSystem", + "uiClassifiers": ["emitter"], + "qualifiedName": "io:AtlanticElectricalHeaterWithAdjustableTemperatureSetpointIOComponent", + "type": "ACTUATOR" + }, + "states": [ + { + "name": "core:NameState", + "type": 3, + "value": "**" + }, + { + "name": "core:VersionState", + "type": 3, + "value": "2d202020ffffff240000" + }, + { + "name": "core:PriorityLockTimerState", + "type": 1, + "value": 0 + }, + { + "name": "core:CommandLockLevelsState", + "type": 3, + "value": "[]", + "lastUpdateTime": 1722420286000 + }, + { + "name": "core:OnOffState", + "type": 3, + "value": "on" + }, + { + "name": "io:TargetHeatingLevelState", + "type": 3, + "value": "eco" + }, + { + "name": "core:StatusState", + "type": 3, + "value": "available" + }, + { + "name": "core:DiscreteRSSILevelState", + "type": 3, + "value": "good" + }, + { + "name": "core:RSSILevelState", + "type": 2, + "value": 94.0 + }, + { + "name": "core:IdentifierState", + "type": 3, + "value": "00000000" + }, + { + "name": "io:MaximumHeatingLevelState", + "type": 3, + "value": "unknown" + }, + { + "name": "io:TimerForTransitoryStateState", + "type": 1, + "value": 65535 + }, + { + "name": "core:ComfortRoomTemperatureState", + "type": 1, + "value": 20 + }, + { + "name": "core:EcoRoomTemperatureState", + "type": 2, + "value": 3.5 + }, + { + "name": "core:OperatingModeState", + "type": 3, + "value": "external" + }, + { + "name": "core:OccupancyActivationState", + "type": 3, + "value": "inactive" + }, + { + "name": "core:MaximumHeatingTargetTemperatureState", + "type": 2, + "value": 28.0 + }, + { + "name": "core:MaximumTargetTemperatureState", + "type": 2, + "value": 28.0 + }, + { + "name": "core:TargetTemperatureState", + "type": 2, + "value": 20.0 + }, + { + "name": "io:SetpointLoweringTemperatureInProgModeState", + "type": 2, + "value": 3.5 + }, + { + "name": "core:OpenWindowDetectionActivationState", + "type": 3, + "value": "inactive" + }, + { + "name": "io:InternalExternalSchedulingTypeState", + "type": 3, + "value": "external" + }, + { + "name": "core:DateTimeState", + "type": 11, + "value": { + "month": 3, + "hour": 10, + "year": 2025, + "weekday": 0, + "day": 24, + "minute": 20, + "second": 10 + } + }, + { + "name": "io:LocalLeadTimeState", + "type": 1, + "value": 3498 + }, + { + "name": "core:RegulationModeState", + "type": 3, + "value": "none" + }, + { + "name": "core:ManufacturerNameState", + "type": 3, + "value": "Atlantic" + }, + { + "name": "io:ModelState", + "type": 3, + "value": "Calissia" + }, + { + "name": "io:PowerState", + "type": 1, + "value": 750 + }, + { + "name": "io:TensionState", + "type": 1, + "value": 230 + }, + { + "name": "core:DerogatedTargetTemperatureState", + "type": 2, + "value": 0.0 + }, + { + "name": "io:NativeFunctionalLevelState", + "type": 3, + "value": "Base" + }, + { + "name": "io:TemperatureProbeCalibrationOffsetState", + "type": 2, + "value": 0.0 + }, + { + "name": "io:CumulatedLoweringState", + "type": 2, + "value": 0.0 + }, + { + "name": "io:RoomDeletionThresholdState", + "type": 3, + "value": "-2\u00b0C" + }, + { + "name": "io:EffectiveTemperatureSetpointState", + "type": 2, + "value": 16.5 + }, + { + "name": "io:ControllerAddressState", + "type": 1, + "value": 11009626 + }, + { + "name": "io:AutoProgramState", + "type": 11, + "value": { + "sunday": [ + "CONF_NIV1", + "CONF_NIV1", + "CONF_NIV1", + "CONF_NIV1", + "CONF_NIV1", + "CONF_NIV1", + "CONF_NIV1", + "CONF_NIV1", + "CONF_NIV1", + "CONF_NIV1", + "CONF_NIV1", + "CONF_NIV1", + "CONF_NIV1", + "CONF_NIV1", + "CONF_NIV1", + "CONF_NIV1", + "CONF_NIV1", + "CONF_NIV1", + "CONF_NIV1", + "CONF_NIV1", + "CONF_NIV1", + "CONF_NIV1", + "CONF_NIV1", + "CONF_NIV1", + "CONF_NIV1", + "CONF_NIV1", + "CONF_NIV1", + "CONF_NIV1", + "CONF_NIV1", + "CONF_NIV1", + "CONF_NIV1", + "CONF_NIV1", + "CONF_NIV1", + "CONF_NIV1", + "CONF_NIV1", + "CONF_NIV1", + "CONF_NIV1", + "CONF_NIV1", + "CONF_NIV1", + "CONF_NIV1", + "CONF_NIV1", + "CONF_NIV1", + "CONF_NIV1", + "CONF_NIV1", + "CONF_NIV1", + "CONF_NIV1", + "CONF_NIV1", + "CONF_NIV1" + ], + "saturday": [ + "CONF_NIV1", + "CONF_NIV1", + "CONF_NIV1", + "CONF_NIV1", + "CONF_NIV1", + "CONF_NIV1", + "CONF_NIV1", + "CONF_NIV1", + "CONF_NIV1", + "CONF_NIV1", + "CONF_NIV1", + "CONF_NIV1", + "CONF_NIV1", + "CONF_NIV1", + "CONF_NIV1", + "CONF_NIV1", + "CONF_NIV1", + "CONF_NIV1", + "CONF_NIV1", + "CONF_NIV1", + "CONF_NIV1", + "CONF_NIV1", + "CONF_NIV1", + "CONF_NIV1", + "CONF_NIV1", + "CONF_NIV1", + "CONF_NIV1", + "CONF_NIV1", + "CONF_NIV1", + "CONF_NIV1", + "CONF_NIV1", + "CONF_NIV1", + "CONF_NIV1", + "CONF_NIV1", + "CONF_NIV1", + "CONF_NIV1", + "CONF_NIV1", + "CONF_NIV1", + "CONF_NIV1", + "CONF_NIV1", + "CONF_NIV1", + "CONF_NIV1", + "CONF_NIV1", + "CONF_NIV1", + "CONF_NIV1", + "CONF_NIV1", + "CONF_NIV1", + "CONF_NIV1" + ], + "tuesday": [ + "CONF_NIV1", + "CONF_NIV1", + "CONF_NIV1", + "CONF_NIV1", + "CONF_NIV1", + "CONF_NIV1", + "CONF_NIV1", + "CONF_NIV1", + "CONF_NIV1", + "CONF_NIV1", + "CONF_NIV1", + "CONF_NIV1", + "CONF_NIV1", + "CONF_NIV1", + "CONF_NIV1", + "CONF_NIV1", + "CONF_NIV1", + "CONF_NIV1", + "CONF_NIV1", + "CONF_NIV1", + "CONF_NIV1", + "CONF_NIV1", + "CONF_NIV1", + "CONF_NIV1", + "CONF_NIV1", + "CONF_NIV1", + "CONF_NIV1", + "CONF_NIV1", + "CONF_NIV1", + "CONF_NIV1", + "CONF_NIV1", + "CONF_NIV1", + "CONF_NIV1", + "CONF_NIV1", + "CONF_NIV1", + "CONF_NIV1", + "CONF_NIV1", + "CONF_NIV1", + "CONF_NIV1", + "CONF_NIV1", + "CONF_NIV1", + "CONF_NIV1", + "CONF_NIV1", + "CONF_NIV1", + "CONF_NIV1", + "CONF_NIV1", + "CONF_NIV1", + "CONF_NIV1" + ], + "wednesday": [ + "CONF_NIV1", + "CONF_NIV1", + "CONF_NIV1", + "CONF_NIV1", + "CONF_NIV1", + "CONF_NIV1", + "CONF_NIV1", + "CONF_NIV1", + "CONF_NIV1", + "CONF_NIV1", + "CONF_NIV1", + "CONF_NIV1", + "CONF_NIV1", + "CONF_NIV1", + "CONF_NIV1", + "CONF_NIV1", + "CONF_NIV1", + "CONF_NIV1", + "CONF_NIV1", + "CONF_NIV1", + "CONF_NIV1", + "CONF_NIV1", + "CONF_NIV1", + "CONF_NIV1", + "CONF_NIV1", + "CONF_NIV1", + "CONF_NIV1", + "CONF_NIV1", + "CONF_NIV1", + "CONF_NIV1", + "CONF_NIV1", + "CONF_NIV1", + "CONF_NIV1", + "CONF_NIV1", + "CONF_NIV1", + "CONF_NIV1", + "CONF_NIV1", + "CONF_NIV1", + "CONF_NIV1", + "CONF_NIV1", + "CONF_NIV1", + "CONF_NIV1", + "CONF_NIV1", + "CONF_NIV1", + "CONF_NIV1", + "CONF_NIV1", + "CONF_NIV1", + "CONF_NIV1" + ], + "thursday": [ + "CONF_NIV1", + "CONF_NIV1", + "CONF_NIV1", + "CONF_NIV1", + "CONF_NIV1", + "CONF_NIV1", + "CONF_NIV1", + "CONF_NIV1", + "CONF_NIV1", + "CONF_NIV1", + "CONF_NIV1", + "CONF_NIV1", + "CONF_NIV1", + "CONF_NIV1", + "CONF_NIV1", + "CONF_NIV1", + "CONF_NIV1", + "CONF_NIV1", + "CONF_NIV1", + "CONF_NIV1", + "CONF_NIV1", + "CONF_NIV1", + "CONF_NIV1", + "CONF_NIV1", + "CONF_NIV1", + "CONF_NIV1", + "CONF_NIV1", + "CONF_NIV1", + "CONF_NIV1", + "CONF_NIV1", + "CONF_NIV1", + "CONF_NIV1", + "CONF_NIV1", + "CONF_NIV1", + "CONF_NIV1", + "CONF_NIV1", + "CONF_NIV1", + "CONF_NIV1", + "CONF_NIV1", + "CONF_NIV1", + "CONF_NIV1", + "CONF_NIV1", + "CONF_NIV1", + "CONF_NIV1", + "CONF_NIV1", + "CONF_NIV1", + "CONF_NIV1", + "CONF_NIV1" + ], + "friday": [ + "CONF_NIV1", + "CONF_NIV1", + "CONF_NIV1", + "CONF_NIV1", + "CONF_NIV1", + "CONF_NIV1", + "CONF_NIV1", + "CONF_NIV1", + "CONF_NIV1", + "CONF_NIV1", + "CONF_NIV1", + "CONF_NIV1", + "CONF_NIV1", + "CONF_NIV1", + "CONF_NIV1", + "CONF_NIV1", + "CONF_NIV1", + "CONF_NIV1", + "CONF_NIV1", + "CONF_NIV1", + "CONF_NIV1", + "CONF_NIV1", + "CONF_NIV1", + "CONF_NIV1", + "CONF_NIV1", + "CONF_NIV1", + "CONF_NIV1", + "CONF_NIV1", + "CONF_NIV1", + "CONF_NIV1", + "CONF_NIV1", + "CONF_NIV1", + "CONF_NIV1", + "CONF_NIV1", + "CONF_NIV1", + "CONF_NIV1", + "CONF_NIV1", + "CONF_NIV1", + "CONF_NIV1", + "CONF_NIV1", + "CONF_NIV1", + "CONF_NIV1", + "CONF_NIV1", + "CONF_NIV1", + "CONF_NIV1", + "CONF_NIV1", + "CONF_NIV1", + "CONF_NIV1" + ], + "anticipTime": 3498, + "anticipNb": 20, + "monday": [ + "CONF_NIV1", + "CONF_NIV1", + "CONF_NIV1", + "CONF_NIV1", + "CONF_NIV1", + "CONF_NIV1", + "CONF_NIV1", + "CONF_NIV1", + "CONF_NIV1", + "CONF_NIV1", + "CONF_NIV1", + "CONF_NIV1", + "CONF_NIV1", + "CONF_NIV1", + "CONF_NIV1", + "CONF_NIV1", + "CONF_NIV1", + "CONF_NIV1", + "CONF_NIV1", + "CONF_NIV1", + "CONF_NIV1", + "CONF_NIV1", + "CONF_NIV1", + "CONF_NIV1", + "CONF_NIV1", + "CONF_NIV1", + "CONF_NIV1", + "CONF_NIV1", + "CONF_NIV1", + "CONF_NIV1", + "CONF_NIV1", + "CONF_NIV1", + "CONF_NIV1", + "CONF_NIV1", + "CONF_NIV1", + "CONF_NIV1", + "CONF_NIV1", + "CONF_NIV1", + "CONF_NIV1", + "CONF_NIV1", + "CONF_NIV1", + "CONF_NIV1", + "CONF_NIV1", + "CONF_NIV1", + "CONF_NIV1", + "CONF_NIV1", + "CONF_NIV1", + "CONF_NIV1" + ] + } + }, + { + "name": "core:PreviousTargetTemperatureState", + "type": 2, + "value": 21.0 + }, + { + "name": "core:TimeProgramState", + "type": 10, + "value": [ + { + "monday": [ + { + "start": "08:00", + "end": "14:00" + }, + { + "start": "19:00", + "end": "24:00" + }, + { + "start": "00:00", + "end": "00:00" + } + ] + }, + { + "tuesday": [ + { + "start": "08:00", + "end": "14:00" + }, + { + "start": "19:00", + "end": "24:00" + }, + { + "start": "00:00", + "end": "00:00" + } + ] + }, + { + "wednesday": [ + { + "start": "08:00", + "end": "14:00" + }, + { + "start": "19:00", + "end": "24:00" + }, + { + "start": "00:00", + "end": "00:00" + } + ] + }, + { + "thursday": [ + { + "start": "08:00", + "end": "14:00" + }, + { + "start": "19:00", + "end": "24:00" + }, + { + "start": "00:00", + "end": "00:00" + } + ] + }, + { + "friday": [ + { + "start": "08:00", + "end": "14:00" + }, + { + "start": "17:00", + "end": "24:00" + }, + { + "start": "00:00", + "end": "00:00" + } + ] + }, + { + "saturday": [ + { + "start": "12:00", + "end": "24:00" + }, + { + "start": "00:00", + "end": "00:00" + }, + { + "start": "00:00", + "end": "00:00" + } + ] + }, + { + "sunday": [ + { + "start": "19:00", + "end": "24:00" + }, + { + "start": "00:00", + "end": "00:00" + }, + { + "start": "00:00", + "end": "00:00" + } + ] + } + ] + }, + { + "name": "io:CurrentWorkingRateState", + "type": 2, + "value": 0.0 + } + ], + "attributes": [ + { + "name": "core:Manufacturer", + "type": 3, + "value": "Atlantic Group" + }, + { + "name": "core:FirmwareRevision", + "type": 3, + "value": "2d202020ffffff240000" + } + ], + "available": true, + "enabled": true, + "placeOID": "61435d6a-4ba6-4c96-b7b5-105bb31d3b87", + "widget": "AtlanticElectricalHeaterWithAdjustableTemperatureSetpoint", + "type": 1, + "oid": "aea8fe99-ce54-4256-ba7d-d08fab636d4e", + "uiClass": "HeatingSystem" + }, + { + "creationTime": 1602324374000, + "lastUpdateTime": 1602324374000, + "label": "Living Room Heater Temperature", + "deviceURL": "io://1234-5678-5643/11009627#2", + "shortcut": false, + "controllableName": "io:TemperatureInCelciusIOSystemDeviceSensor", + "definition": { + "commands": [], + "states": [ + { + "type": "DiscreteState", + "values": ["available", "unavailable"], + "qualifiedName": "core:StatusState" + }, + { + "type": "ContinuousState", + "qualifiedName": "core:TemperatureState" + } + ], + "dataProperties": [], + "widgetName": "TemperatureSensor", + "uiProfiles": ["Temperature"], + "uiClass": "TemperatureSensor", + "qualifiedName": "io:TemperatureInCelciusIOSystemDeviceSensor", + "type": "SENSOR" + }, + "states": [ + { + "name": "core:StatusState", + "type": 3, + "value": "available" + }, + { + "name": "core:TemperatureState", + "type": 2, + "value": 20.5 + } + ], + "attributes": [ + { + "name": "core:Manufacturer", + "type": 3, + "value": "Atlantic Group" + }, + { + "name": "core:FirmwareRevision", + "type": 3, + "value": "2d202020ffffff240000" + }, + { + "name": "core:MeasuredValueType", + "type": 3, + "value": "core:TemperatureInCelcius" + }, + { + "name": "core:PowerSourceType", + "type": 3, + "value": "mainSupply" + } + ], + "available": true, + "enabled": true, + "placeOID": "61435d6a-4ba6-4c96-b7b5-105bb31d3b87", + "widget": "TemperatureSensor", + "type": 2, + "oid": "2aeab205-1d3a-4a87-b171-ff6484e67852", + "uiClass": "TemperatureSensor" } ], "features": [], diff --git a/tests/components/overkiz/snapshots/test_climate.ambr b/tests/components/overkiz/snapshots/test_climate.ambr index 91e4b14aa5d9..a4da16cfc752 100644 --- a/tests/components/overkiz/snapshots/test_climate.ambr +++ b/tests/components/overkiz/snapshots/test_climate.ambr @@ -174,6 +174,100 @@ 'state': 'heat', }) # --- +# name: test_climate_entities_snapshot[cloud_atlantic_cozytouch.json][climate.my_home_living_room_heater-entry] + EntityRegistryEntrySnapshot({ + 'aliases': list([ + None, + ]), + 'area_id': None, + 'capabilities': dict({ + : list([ + , + , + , + ]), + : 35, + : 7, + : list([ + 'none', + 'frost_protection', + 'eco', + 'comfort', + 'comfort-1', + 'comfort-2', + 'auto', + 'boost', + 'external', + 'prog', + ]), + }), + 'config_entry_id': , + 'config_subentry_id': , + 'device_class': None, + 'device_id': , + 'disabled_by': None, + 'domain': 'climate', + 'entity_category': None, + 'entity_id': 'climate.my_home_living_room_heater', + 'has_entity_name': True, + 'hidden_by': None, + 'icon': None, + 'id': , + 'labels': set({ + }), + 'name': None, + 'object_id_base': None, + 'options': dict({ + }), + 'original_device_class': None, + 'original_icon': None, + 'original_name': None, + 'platform': 'overkiz', + 'previous_unique_id': None, + 'suggested_object_id': None, + 'supported_features': , + 'translation_key': 'overkiz', + 'unique_id': 'io://1234-5678-5643/11009627#1', + 'unit_of_measurement': None, + }) +# --- +# name: test_climate_entities_snapshot[cloud_atlantic_cozytouch.json][climate.my_home_living_room_heater-state] + StateSnapshot({ + 'attributes': ReadOnlyDict({ + : 20.5, + : 'Living Room Heater', + : , + : list([ + , + , + , + ]), + : 35, + : 7, + : 'eco', + : list([ + 'none', + 'frost_protection', + 'eco', + 'comfort', + 'comfort-1', + 'comfort-2', + 'auto', + 'boost', + 'external', + 'prog', + ]), + : , + : 16.5, + }), + 'context': , + 'entity_id': 'climate.my_home_living_room_heater', + 'last_changed': , + 'last_reported': , + 'last_updated': , + 'state': 'auto', + }) +# --- # name: test_climate_entities_snapshot[cloud_hi_kumo_europe.json][climate.somfy_tahoma_switch_yutaki_zone_1-entry] EntityRegistryEntrySnapshot({ 'aliases': list([ diff --git a/tests/components/overkiz/snapshots/test_number.ambr b/tests/components/overkiz/snapshots/test_number.ambr index fc922663a26b..cec3148a2367 100644 --- a/tests/components/overkiz/snapshots/test_number.ambr +++ b/tests/components/overkiz/snapshots/test_number.ambr @@ -247,6 +247,130 @@ 'state': '3', }) # --- +# name: test_number_entities_snapshot[cloud_atlantic_cozytouch.json][number.my_home_living_room_heater_comfort_room_temperature-entry] + EntityRegistryEntrySnapshot({ + 'aliases': list([ + None, + ]), + 'area_id': None, + 'capabilities': dict({ + : 30, + : 7, + : , + : 1.0, + }), + 'config_entry_id': , + 'config_subentry_id': , + 'device_class': None, + 'device_id': , + 'disabled_by': None, + 'domain': 'number', + 'entity_category': , + 'entity_id': 'number.my_home_living_room_heater_comfort_room_temperature', + 'has_entity_name': True, + 'hidden_by': None, + 'icon': None, + 'id': , + 'labels': set({ + }), + 'name': None, + 'object_id_base': 'Comfort room temperature', + 'options': dict({ + }), + 'original_device_class': , + 'original_icon': 'mdi:home-thermometer-outline', + 'original_name': 'Comfort room temperature', + 'platform': 'overkiz', + 'previous_unique_id': None, + 'suggested_object_id': None, + 'supported_features': 0, + 'translation_key': None, + 'unique_id': 'io://1234-5678-5643/11009627#1-core:ComfortRoomTemperatureState', + 'unit_of_measurement': , + }) +# --- +# name: test_number_entities_snapshot[cloud_atlantic_cozytouch.json][number.my_home_living_room_heater_comfort_room_temperature-state] + StateSnapshot({ + 'attributes': ReadOnlyDict({ + : 'temperature', + : 'Living Room Heater Comfort room temperature', + : 'mdi:home-thermometer-outline', + : 30, + : 7, + : , + : 1.0, + : , + }), + 'context': , + 'entity_id': 'number.my_home_living_room_heater_comfort_room_temperature', + 'last_changed': , + 'last_reported': , + 'last_updated': , + 'state': '20', + }) +# --- +# name: test_number_entities_snapshot[cloud_atlantic_cozytouch.json][number.my_home_living_room_heater_eco_room_temperature-entry] + EntityRegistryEntrySnapshot({ + 'aliases': list([ + None, + ]), + 'area_id': None, + 'capabilities': dict({ + : 29, + : 6, + : , + : 1.0, + }), + 'config_entry_id': , + 'config_subentry_id': , + 'device_class': None, + 'device_id': , + 'disabled_by': None, + 'domain': 'number', + 'entity_category': , + 'entity_id': 'number.my_home_living_room_heater_eco_room_temperature', + 'has_entity_name': True, + 'hidden_by': None, + 'icon': None, + 'id': , + 'labels': set({ + }), + 'name': None, + 'object_id_base': 'Eco room temperature', + 'options': dict({ + }), + 'original_device_class': , + 'original_icon': 'mdi:thermometer', + 'original_name': 'Eco room temperature', + 'platform': 'overkiz', + 'previous_unique_id': None, + 'suggested_object_id': None, + 'supported_features': 0, + 'translation_key': None, + 'unique_id': 'io://1234-5678-5643/11009627#1-core:EcoRoomTemperatureState', + 'unit_of_measurement': , + }) +# --- +# name: test_number_entities_snapshot[cloud_atlantic_cozytouch.json][number.my_home_living_room_heater_eco_room_temperature-state] + StateSnapshot({ + 'attributes': ReadOnlyDict({ + : 'temperature', + : 'Living Room Heater Eco room temperature', + : 'mdi:thermometer', + : 29, + : 6, + : , + : 1.0, + : , + }), + 'context': , + 'entity_id': 'number.my_home_living_room_heater_eco_room_temperature', + 'last_changed': , + 'last_reported': , + 'last_updated': , + 'state': '3.5', + }) +# --- # name: test_number_entities_snapshot[cloud_atlantic_cozytouch.json][number.my_home_patio_water_heating_away_mode_duration-entry] EntityRegistryEntrySnapshot({ 'aliases': list([ diff --git a/tests/components/overkiz/snapshots/test_sensor.ambr b/tests/components/overkiz/snapshots/test_sensor.ambr index 6d75dfd7d337..cac6bdb103e2 100644 --- a/tests/components/overkiz/snapshots/test_sensor.ambr +++ b/tests/components/overkiz/snapshots/test_sensor.ambr @@ -280,6 +280,287 @@ 'state': '74', }) # --- +# name: test_sensor_entities_snapshot[cloud_atlantic_cozytouch.json][sensor.my_home_living_room_heater_discrete_rssi_level-entry] + EntityRegistryEntrySnapshot({ + 'aliases': list([ + None, + ]), + 'area_id': None, + 'capabilities': dict({ + : list([ + 'verylow', + 'low', + 'normal', + 'good', + ]), + }), + 'config_entry_id': , + 'config_subentry_id': , + 'device_class': None, + 'device_id': , + 'disabled_by': None, + 'domain': 'sensor', + 'entity_category': , + 'entity_id': 'sensor.my_home_living_room_heater_discrete_rssi_level', + 'has_entity_name': True, + 'hidden_by': None, + 'icon': None, + 'id': , + 'labels': set({ + }), + 'name': None, + 'object_id_base': 'Discrete RSSI level', + 'options': dict({ + }), + 'original_device_class': , + 'original_icon': 'mdi:wifi', + 'original_name': 'Discrete RSSI level', + 'platform': 'overkiz', + 'previous_unique_id': None, + 'suggested_object_id': None, + 'supported_features': 0, + 'translation_key': 'discrete_rssi_level', + 'unique_id': 'io://1234-5678-5643/11009627#1-core:DiscreteRSSILevelState', + 'unit_of_measurement': None, + }) +# --- +# name: test_sensor_entities_snapshot[cloud_atlantic_cozytouch.json][sensor.my_home_living_room_heater_discrete_rssi_level-state] + StateSnapshot({ + 'attributes': ReadOnlyDict({ + : 'enum', + : 'Living Room Heater Discrete RSSI level', + : 'mdi:wifi', + : list([ + 'verylow', + 'low', + 'normal', + 'good', + ]), + }), + 'context': , + 'entity_id': 'sensor.my_home_living_room_heater_discrete_rssi_level', + 'last_changed': , + 'last_reported': , + 'last_updated': , + 'state': 'good', + }) +# --- +# name: test_sensor_entities_snapshot[cloud_atlantic_cozytouch.json][sensor.my_home_living_room_heater_living_room_heater_temperature_temperature-entry] + EntityRegistryEntrySnapshot({ + 'aliases': list([ + None, + ]), + 'area_id': None, + 'capabilities': dict({ + : , + }), + 'config_entry_id': , + 'config_subentry_id': , + 'device_class': None, + 'device_id': , + 'disabled_by': None, + 'domain': 'sensor', + 'entity_category': None, + 'entity_id': 'sensor.my_home_living_room_heater_living_room_heater_temperature_temperature', + 'has_entity_name': True, + 'hidden_by': None, + 'icon': None, + 'id': , + 'labels': set({ + }), + 'name': None, + 'object_id_base': 'Living Room Heater Temperature Temperature', + 'options': dict({ + 'sensor': dict({ + 'suggested_display_precision': 1, + }), + }), + 'original_device_class': , + 'original_icon': None, + 'original_name': 'Living Room Heater Temperature Temperature', + 'platform': 'overkiz', + 'previous_unique_id': None, + 'suggested_object_id': None, + 'supported_features': 0, + 'translation_key': None, + 'unique_id': 'io://1234-5678-5643/11009627#2-core:TemperatureState', + 'unit_of_measurement': , + }) +# --- +# name: test_sensor_entities_snapshot[cloud_atlantic_cozytouch.json][sensor.my_home_living_room_heater_living_room_heater_temperature_temperature-state] + StateSnapshot({ + 'attributes': ReadOnlyDict({ + : 'temperature', + : 'Living Room Heater Living Room Heater Temperature Temperature', + : , + : , + }), + 'context': , + 'entity_id': 'sensor.my_home_living_room_heater_living_room_heater_temperature_temperature', + 'last_changed': , + 'last_reported': , + 'last_updated': , + 'state': '20.5', + }) +# --- +# name: test_sensor_entities_snapshot[cloud_atlantic_cozytouch.json][sensor.my_home_living_room_heater_priority_lock_originator-entry] + EntityRegistryEntrySnapshot({ + 'aliases': list([ + None, + ]), + 'area_id': None, + 'capabilities': None, + 'config_entry_id': , + 'config_subentry_id': , + 'device_class': None, + 'device_id': , + 'disabled_by': None, + 'domain': 'sensor', + 'entity_category': None, + 'entity_id': 'sensor.my_home_living_room_heater_priority_lock_originator', + 'has_entity_name': True, + 'hidden_by': None, + 'icon': None, + 'id': , + 'labels': set({ + }), + 'name': None, + 'object_id_base': 'Priority lock originator', + 'options': dict({ + }), + 'original_device_class': None, + 'original_icon': 'mdi:lock', + 'original_name': 'Priority lock originator', + 'platform': 'overkiz', + 'previous_unique_id': None, + 'suggested_object_id': None, + 'supported_features': 0, + 'translation_key': 'priority_lock_originator', + 'unique_id': 'io://1234-5678-5643/11009627#1-io:PriorityLockOriginatorState', + 'unit_of_measurement': None, + }) +# --- +# name: test_sensor_entities_snapshot[cloud_atlantic_cozytouch.json][sensor.my_home_living_room_heater_priority_lock_originator-state] + StateSnapshot({ + 'attributes': ReadOnlyDict({ + : 'Living Room Heater Priority lock originator', + : 'mdi:lock', + }), + 'context': , + 'entity_id': 'sensor.my_home_living_room_heater_priority_lock_originator', + 'last_changed': , + 'last_reported': , + 'last_updated': , + 'state': 'unknown', + }) +# --- +# name: test_sensor_entities_snapshot[cloud_atlantic_cozytouch.json][sensor.my_home_living_room_heater_priority_lock_timer-entry] + EntityRegistryEntrySnapshot({ + 'aliases': list([ + None, + ]), + 'area_id': None, + 'capabilities': None, + 'config_entry_id': , + 'config_subentry_id': , + 'device_class': None, + 'device_id': , + 'disabled_by': None, + 'domain': 'sensor', + 'entity_category': None, + 'entity_id': 'sensor.my_home_living_room_heater_priority_lock_timer', + 'has_entity_name': True, + 'hidden_by': None, + 'icon': None, + 'id': , + 'labels': set({ + }), + 'name': None, + 'object_id_base': 'Priority lock timer', + 'options': dict({ + }), + 'original_device_class': None, + 'original_icon': 'mdi:lock-clock', + 'original_name': 'Priority lock timer', + 'platform': 'overkiz', + 'previous_unique_id': None, + 'suggested_object_id': None, + 'supported_features': 0, + 'translation_key': None, + 'unique_id': 'io://1234-5678-5643/11009627#1-core:PriorityLockTimerState', + 'unit_of_measurement': , + }) +# --- +# name: test_sensor_entities_snapshot[cloud_atlantic_cozytouch.json][sensor.my_home_living_room_heater_priority_lock_timer-state] + StateSnapshot({ + 'attributes': ReadOnlyDict({ + : 'Living Room Heater Priority lock timer', + : 'mdi:lock-clock', + : , + }), + 'context': , + 'entity_id': 'sensor.my_home_living_room_heater_priority_lock_timer', + 'last_changed': , + 'last_reported': , + 'last_updated': , + 'state': 'unknown', + }) +# --- +# name: test_sensor_entities_snapshot[cloud_atlantic_cozytouch.json][sensor.my_home_living_room_heater_rssi_level-entry] + EntityRegistryEntrySnapshot({ + 'aliases': list([ + None, + ]), + 'area_id': None, + 'capabilities': dict({ + : , + }), + 'config_entry_id': , + 'config_subentry_id': , + 'device_class': None, + 'device_id': , + 'disabled_by': None, + 'domain': 'sensor', + 'entity_category': , + 'entity_id': 'sensor.my_home_living_room_heater_rssi_level', + 'has_entity_name': True, + 'hidden_by': None, + 'icon': None, + 'id': , + 'labels': set({ + }), + 'name': None, + 'object_id_base': 'RSSI level', + 'options': dict({ + }), + 'original_device_class': , + 'original_icon': None, + 'original_name': 'RSSI level', + 'platform': 'overkiz', + 'previous_unique_id': None, + 'suggested_object_id': None, + 'supported_features': 0, + 'translation_key': None, + 'unique_id': 'io://1234-5678-5643/11009627#1-core:RSSILevelState', + 'unit_of_measurement': 'dB', + }) +# --- +# name: test_sensor_entities_snapshot[cloud_atlantic_cozytouch.json][sensor.my_home_living_room_heater_rssi_level-state] + StateSnapshot({ + 'attributes': ReadOnlyDict({ + : 'signal_strength', + : 'Living Room Heater RSSI level', + : , + : 'dB', + }), + 'context': , + 'entity_id': 'sensor.my_home_living_room_heater_rssi_level', + 'last_changed': , + 'last_reported': , + 'last_updated': , + 'state': '94', + }) +# --- # name: test_sensor_entities_snapshot[cloud_atlantic_cozytouch.json][sensor.my_home_patio_water_heating_bottom_tank_water_temperature-entry] EntityRegistryEntrySnapshot({ 'aliases': list([ diff --git a/tests/components/overkiz/test_climate.py b/tests/components/overkiz/test_climate.py index 8d11067804c8..d032668a54a2 100644 --- a/tests/components/overkiz/test_climate.py +++ b/tests/components/overkiz/test_climate.py @@ -45,6 +45,12 @@ COZYTOUCH = FixtureDevice( "modbuslink://1234-5678-5643/1#1", "climate.living_room_heater", ) +# Atlantic Calissia (io:AtlanticElectricalHeaterWithAdjustableTemperatureSetpointIOComponent) +ELECTRICAL_HEATER_ADJUSTABLE = FixtureDevice( + "setup/cloud_atlantic_cozytouch.json", + "io://1234-5678-5643/11009627#1", + "climate.my_home_living_room_heater", +) # Hitachi Yutaki 2-zone air-to-water heat pump YUTAKI_ZONE_1 = FixtureDevice( @@ -171,6 +177,145 @@ async def test_events_for_unknown_device_url( assert state is not None +async def test_electrical_heater_adjustable_target_temperature( + hass: HomeAssistant, + freezer: FrozenDateTimeFactory, + mock_client: MockOverkizClient, + setup_overkiz_integration: SetupOverkizIntegration, +) -> None: + """Test target_temperature tracks the effective setpoint only in auto mode.""" + await setup_overkiz_integration(fixture=ELECTRICAL_HEATER_ADJUSTABLE.fixture) + + # Fixture starts in auto (external) mode with the eco preset active. + state = hass.states.get(ELECTRICAL_HEATER_ADJUSTABLE.entity_id) + assert state is not None + assert state.attributes[ATTR_TEMPERATURE] == 16.5 + + # The preset changes to comfort while still scheduled (auto). + await async_deliver_events( + hass, + freezer, + mock_client, + [ + device_state_changed_event( + device_url=ELECTRICAL_HEATER_ADJUSTABLE.device_url, + device_states=[ + { + "name": OverkizState.IO_TARGET_HEATING_LEVEL, + "type": 3, + "value": "comfort", + }, + { + "name": OverkizState.IO_EFFECTIVE_TEMPERATURE_SETPOINT, + "type": 2, + "value": 20.0, + }, + ], + ) + ], + ) + state = hass.states.get(ELECTRICAL_HEATER_ADJUSTABLE.entity_id) + assert state is not None + assert state.attributes[ATTR_TEMPERATURE] == 20.0 + + # While scheduled (auto), setting a temperature derogates the active + # preset instead of overwriting the comfort setpoint. + await hass.services.async_call( + "climate", + "set_temperature", + {"entity_id": ELECTRICAL_HEATER_ADJUSTABLE.entity_id, ATTR_TEMPERATURE: 19.0}, + blocking=True, + ) + assert_command_call( + mock_client, + device_url=ELECTRICAL_HEATER_ADJUSTABLE.device_url, + command_name="setDerogatedTargetTemperature", + parameters=[19.0], + ) + + # The device reports the derogation by updating the effective setpoint. + await async_deliver_events( + hass, + freezer, + mock_client, + [ + device_state_changed_event( + device_url=ELECTRICAL_HEATER_ADJUSTABLE.device_url, + device_states=[ + { + "name": OverkizState.IO_EFFECTIVE_TEMPERATURE_SETPOINT, + "type": 2, + "value": 19.0, + }, + ], + ) + ], + ) + state = hass.states.get(ELECTRICAL_HEATER_ADJUSTABLE.entity_id) + assert state is not None + assert state.attributes[ATTR_TEMPERATURE] == 19.0 + + mock_client.execute_action_group.reset_mock() + + # Leaving auto (scheduled) mode for manual falls back to + # core:TargetTemperatureState, and setting a temperature now targets + # that state directly instead of derogating. + await async_deliver_events( + hass, + freezer, + mock_client, + [ + device_state_changed_event( + device_url=ELECTRICAL_HEATER_ADJUSTABLE.device_url, + device_states=[ + { + "name": OverkizState.CORE_OPERATING_MODE, + "type": 3, + "value": "manual", + }, + ], + ) + ], + ) + state = hass.states.get(ELECTRICAL_HEATER_ADJUSTABLE.entity_id) + assert state is not None + assert state.attributes[ATTR_TEMPERATURE] == 20.0 + + await hass.services.async_call( + "climate", + "set_temperature", + {"entity_id": ELECTRICAL_HEATER_ADJUSTABLE.entity_id, ATTR_TEMPERATURE: 21.0}, + blocking=True, + ) + assert_command_call( + mock_client, + device_url=ELECTRICAL_HEATER_ADJUSTABLE.device_url, + command_name="setTargetTemperature", + parameters=[21.0], + ) + + await async_deliver_events( + hass, + freezer, + mock_client, + [ + device_state_changed_event( + device_url=ELECTRICAL_HEATER_ADJUSTABLE.device_url, + device_states=[ + { + "name": OverkizState.CORE_TARGET_TEMPERATURE, + "type": 2, + "value": 21.0, + }, + ], + ) + ], + ) + state = hass.states.get(ELECTRICAL_HEATER_ADJUSTABLE.entity_id) + assert state is not None + assert state.attributes[ATTR_TEMPERATURE] == 21.0 + + async def test_hitachi_air_to_water_heating_zone_2( hass: HomeAssistant, setup_overkiz_integration: SetupOverkizIntegration,