{"record":{"id":"00668c4824c969ff","repo":"home-assistant/core","slug":"invalid-target-state","errorCode":"INVALID_TARGET_STATE","errorMessage":"The current target temperature is not set, cannot adjust target temperature","messagePattern":"The current target temperature is not set, cannot adjust target temperature","errorType":"exception","errorClass":"AlexaUnsupportedThermostatTargetStateError","httpStatus":null,"severity":"error","filePath":"homeassistant/components/alexa/handlers.py","lineNumber":990,"sourceCode":"\n        response.add_context_property(\n            {\n                \"name\": \"upperSetpoint\",\n                \"namespace\": \"Alexa.ThermostatController\",\n                \"value\": {\"value\": target_temp_high, \"scale\": API_TEMP_UNITS[unit]},\n            }\n        )\n        response.add_context_property(\n            {\n                \"name\": \"lowerSetpoint\",\n                \"namespace\": \"Alexa.ThermostatController\",\n                \"value\": {\"value\": target_temp_low, \"scale\": API_TEMP_UNITS[unit]},\n            }\n        )\n    else:\n        current_target_temp: str | None = entity.attributes.get(ATTR_TEMPERATURE)\n        if current_target_temp is None:\n            raise AlexaUnsupportedThermostatTargetStateError(\n                \"The current target temperature is not set, \"\n                \"cannot adjust target temperature\"\n            )\n        target_temp = float(current_target_temp) + temp_delta\n\n        if target_temp < min_temp or target_temp > max_temp:\n            raise AlexaTempRangeError(hass, target_temp, min_temp, max_temp)\n\n        data = {ATTR_ENTITY_ID: entity.entity_id, ATTR_TEMPERATURE: target_temp}\n        response.add_context_property(\n            {\n                \"name\": \"targetSetpoint\",\n                \"namespace\": \"Alexa.ThermostatController\",\n                \"value\": {\"value\": target_temp, \"scale\": API_TEMP_UNITS[unit]},\n            }\n        )\n\n    service = SERVICE_SET_TEMPERATURE[domain]","sourceCodeStart":972,"sourceCodeEnd":1008,"githubUrl":"https://github.com/home-assistant/core/blob/58a3fdb3ea0538617f0a07efcfba6294de64fd59/homeassistant/components/alexa/handlers.py#L972-L1008","documentation":"For AdjustTargetTemperature on a single-setpoint thermostat (no target_temp_high/low), HA reads the current target temperature from the entity's temperature attribute. If it is None - the thermostat has no current target set - it raises AlexaUnsupportedThermostatTargetStateError (INVALID_TARGET_STATE) because there is no baseline to add the delta to.","triggerScenarios":"'Alexa, make it warmer by 2 degrees' on a climate entity whose temperature attribute is currently absent (off, uninitialized, or integration did not report a target).","commonSituations":"Thermostat turned off or integration (e.g. generic_thermostat, DIY MQTT climate) that clears temperature when idle; newly added entities before their first setpoint; voice adjusting before any manual set.","solutions":["First set an absolute target ('set the thermostat to 21 degrees'), then use adjust commands.","If the attribute should have a value, fix the underlying integration so temperature is always reported when the device is controllable.","Turn the thermostat on if it is off and re-check the temperature attribute in developer tools."],"exampleFix":null,"handlingStrategy":"validation","validationCode":"current = state.attributes.get('temperature')\nif current is None:\n    # seed an absolute setpoint first, then adjust\n    await hass.services.async_call(\n        'climate', 'set_temperature',\n        {'entity_id': eid, 'temperature': 21.0}, blocking=True,\n    )","typeGuard":"def has_target_temp(attrs: dict) -> bool:\n    return attrs.get('temperature') is not None","tryCatchPattern":"try:\n    await process_directive(directive)\nexcept AlexaUnsupportedThermostatTargetStateError:\n    _LOGGER.info('No current target on %s; set absolute temperature first', eid)","preventionTips":["Ensure the climate entity always reports a target temperature while controllable.","In routines, issue an absolute set before any relative adjust.","Fix integrations that clear the temperature attribute when idle/off."],"tags":["alexa","smart-home","climate","thermostat","missing-state","invalid-target-state"],"backgroundTag":null,"analyzedSha":"58a3fdb3ea0538617f0a07efcfba6294de64fd59","analyzedAt":"2026-08-14T20:54:38.818Z","schemaVersion":2},"datasetVersion":"2026-08-15T22:17:37.221Z"}