home-assistant / core

:house_with_garden: Open source home automation that puts local control and privacy first.
https://www.home-assistant.io
Apache License 2.0
72.1k stars 30.18k forks source link

Honeywell Total Connect Comfort (US) invalid climate.set_temperature #101994

Closed f-dub-e closed 10 months ago

f-dub-e commented 11 months ago

The problem

I have had a working thermostat during the summer, and now that the colder months are here, I wanted to heat the house a little bit. The Honeywell TCC returns a "Failed to call service climate.set_temperature. Unknown error" when the set_tempearture is above or equal to 22.5.

I've tried with the Service under the Developer tools, and it looks like all the temperature below 22.5 works, but none above (i.e. 22.5, 23, 23.5, etc.). I do recall this was working last winter.

I've noticed this since I have an automation that sets the temperature at 22.5 at 0530. Here is the log:

Logger: homeassistant.components.automation.hvac_schedule_0530 Source: helpers/script.py:468 Integration: Automation (documentation, issues) First occurred: October 13, 2023 at 5:30:00 AM (2 occurrences) Last logged: 5:30:00 AM

HVAC Schedule 0530: Error executing script. Unexpected error for call_service at pos 1: Honeywell set temperature failed: invalid temperature 22.5. Traceback (most recent call last): File "/usr/src/homeassistant/homeassistant/components/honeywell/climate.py", line 352, in _set_temperature await self._device.set_setpoint_heat(temperature) File "/usr/local/lib/python3.11/site-packages/aiosomecomfort/device.py", line 177, in set_setpoint_heat await self._client.set_thermostat_settings( File "/usr/local/lib/python3.11/site-packages/aiosomecomfort/init.py", line 213, in set_thermostat_settings result = await self._post_json(url, json=data) ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ File "/usr/local/lib/python3.11/site-packages/aiosomecomfort/init.py", line 171, in _post_json return await self._request_json("post", *args, **kwargs) ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ File "/usr/local/lib/python3.11/site-packages/aiosomecomfort/init.py", line 165, in _request_json raise UnexpectedResponse("API returned %s, %s" % (resp.status, req)) aiosomecomfort.exceptions.UnexpectedResponse: API returned 200, /portal/Device/SubmitControlScreenChanges

The above exception was the direct cause of the following exception:

Traceback (most recent call last): File "/usr/src/homeassistant/homeassistant/helpers/script.py", line 468, in _async_step await getattr(self, handler)() File "/usr/src/homeassistant/homeassistant/helpers/script.py", line 704, in _async_call_service_step response_data = await self._async_run_long_action( ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ File "/usr/src/homeassistant/homeassistant/helpers/script.py", line 666, in _async_run_long_action return long_task.result() ^^^^^^^^^^^^^^^^^^ File "/usr/src/homeassistant/homeassistant/core.py", line 2012, in async_call response_data = await coro ^^^^^^^^^^ File "/usr/src/homeassistant/homeassistant/core.py", line 2049, in _execute_service return await target(service_call) ^^^^^^^^^^^^^^^^^^^^^^^^^^ File "/usr/src/homeassistant/homeassistant/helpers/entity_component.py", line 235, in handle_service return await service.entity_service_call( ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ File "/usr/src/homeassistant/homeassistant/helpers/service.py", line 876, in entity_service_call response_data = await _handle_entity_call( ^^^^^^^^^^^^^^^^^^^^^^^^^^ File "/usr/src/homeassistant/homeassistant/helpers/service.py", line 948, in _handle_entity_call result = await task ^^^^^^^^^^ File "/usr/src/homeassistant/homeassistant/components/climate/init.py", line 632, in async_service_temperature_set await entity.async_set_temperature(kwargs) File "/usr/src/homeassistant/homeassistant/components/honeywell/climate.py", line 363, in async_set_temperature await self._set_temperature(kwargs) File "/usr/src/homeassistant/homeassistant/components/honeywell/climate.py", line 356, in _set_temperature raise ValueError( ValueError: Honeywell set temperature failed: invalid temperature 22.5.

What version of Home Assistant Core has the issue?

core-2023.10.1

What was the last working version of Home Assistant Core?

No response

What type of installation are you running?

Home Assistant OS

Integration causing the issue

Honeywell Total Connect Comfort (US)

Link to integration documentation on our website

https://www.home-assistant.io/integrations/honeywell

Diagnostics information

home-assistant_honeywell_2023-10-14T11-49-37.757Z.log

Example YAML snippet

service: climate.set_temperature
target:
  entity_id: climate.thermostat
data:
  temperature: 22.5
  hvac_mode: heat

Anything in the logs that might be useful for us?

No response

Additional information

No response

home-assistant[bot] commented 11 months ago

Hey there @rdfurman, @mkmer, mind taking a look at this issue as it has been labeled with an integration (honeywell) you are listed as a code owner for? Thanks!

Code owner commands Code owners of `honeywell` can trigger bot actions by commenting: - `@home-assistant close` Closes the issue. - `@home-assistant rename Awesome new title` Renames the issue. - `@home-assistant reopen` Reopen the issue. - `@home-assistant unassign honeywell` Removes the current integration label and assignees on the issue, add the integration domain after the command.

(message by CodeOwnersMention)


honeywell documentation honeywell source (message by IssueLinks)

mkmer commented 11 months ago

The API is checking against the max/min set point configured in the thermostat. Maybe you have the max set below 22.5? https://github.com/mkmer/AIOSomecomfort/blob/3e41e5e75794a64a637ef185a2372514208b6623/aiosomecomfort/device.py#L175-L177

Maybe the energy cops decided 68f is high enough :)

Actually - looking a bit further up the log, the base issue is probably the unexpected response from the API thus finding invalid setpoints. We have been chasing issues with the web site https://github.com/home-assistant/core/issues/100491 and https://github.com/home-assistant/core/issues/100664.

The site throws these errors when they reset the backend, requiring a new key/login amongst other buggy reasons. It's difficult to anticipate WHEN they will do this. I suppose a bit more robustness and retrying is in order.

It's not going to be a quick fix :(

f-dub-e commented 11 months ago

Hey, Thanks for your quick reply.

I verified the min/max, and this is not the case for my case. I am also able to set the temperature to above this value with the TCC iOS app.

I also relooked at my automation, and was using a set_temperature to 26deg all summer for my A/C when no one was at home and didn't recall it not working.

For : I suppose a bit more robustness and retrying is in order, is this an action item for me or for you?

mkmer commented 11 months ago

Even if the API / Component retries a couple of times, there is still a case where it can/will fail.
I suppose the automation should do some sort of retry when a setting fails (an action for you).
Action for me will be to work on a possible retry operation when an action fails.

izdivad commented 11 months ago

I'm having the same issue. A couple of days ago the integration was working fine. Now when I try setting the temp above 68 I get "Honeywell set temperature failed: invalid temperature 69.0." this happens while just trying to change the temp normally without use of automations

mkmer commented 11 months ago

@izdivad : Please turn on debug and share the resulting file. I suspect it's the same problem, but can't be sure without a log. Your existing log file should already contain some error info like this: https://github.com/home-assistant/core/blob/22126a1280af23031f1b691313b550330b141328/homeassistant/components/honeywell/climate.py#L357

izdivad commented 11 months ago

@mkmer No Problem. Thanks for your reply.

Logger: homeassistant.components.websocket_api.http.connection
Source: components/websocket_api/commands.py:226
Integration: Home Assistant WebSocket API ([documentation](https://www.home-assistant.io/integrations/websocket_api), [issues](https://github.com/home-assistant/core/issues?q=is%3Aissue+is%3Aopen+label%3A%22integration%3A+websocket_api%22))
First occurred: 7:43:17 AM (12 occurrences)
Last logged: 7:58:15 AM

[140243338613568] Honeywell set temperature failed: invalid temperature 69.0.
[140243338613568] Honeywell set temperature failed: invalid temperature 70.0.
[140243338613568] Honeywell set temperature failed: invalid temperature 71.0.
[140243338613568] Honeywell set temperature failed: invalid temperature 72.0.
Traceback (most recent call last):
  File "/usr/src/homeassistant/homeassistant/components/honeywell/climate.py", line 352, in _set_temperature
    await self._device.set_setpoint_heat(temperature)
  File "/usr/local/lib/python3.11/site-packages/aiosomecomfort/device.py", line 177, in set_setpoint_heat
    await self._client.set_thermostat_settings(
  File "/usr/local/lib/python3.11/site-packages/aiosomecomfort/__init__.py", line 213, in set_thermostat_settings
    result = await self._post_json(url, json=data)
             ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
  File "/usr/local/lib/python3.11/site-packages/aiosomecomfort/__init__.py", line 171, in _post_json
    return await self._request_json("post", *args, **kwargs)
           ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
  File "/usr/local/lib/python3.11/site-packages/aiosomecomfort/__init__.py", line 165, in _request_json
    raise UnexpectedResponse("API returned %s, %s" % (resp.status, req))
aiosomecomfort.exceptions.UnexpectedResponse: API returned 200, /portal/Device/SubmitControlScreenChanges

The above exception was the direct cause of the following exception:

Traceback (most recent call last):
  File "/usr/src/homeassistant/homeassistant/components/websocket_api/commands.py", line 226, in handle_call_service
    await hass.services.async_call(
  File "/usr/src/homeassistant/homeassistant/core.py", line 2012, in async_call
    response_data = await coro
                    ^^^^^^^^^^
  File "/usr/src/homeassistant/homeassistant/core.py", line 2049, in _execute_service
    return await target(service_call)
           ^^^^^^^^^^^^^^^^^^^^^^^^^^
  File "/usr/src/homeassistant/homeassistant/helpers/entity_component.py", line 235, in handle_service
    return await service.entity_service_call(
           ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
  File "/usr/src/homeassistant/homeassistant/helpers/service.py", line 876, in entity_service_call
    response_data = await _handle_entity_call(
                    ^^^^^^^^^^^^^^^^^^^^^^^^^^
  File "/usr/src/homeassistant/homeassistant/helpers/service.py", line 948, in _handle_entity_call
    result = await task
             ^^^^^^^^^^
  File "/usr/src/homeassistant/homeassistant/components/climate/__init__.py", line 632, in async_service_temperature_set
    await entity.async_set_temperature(**kwargs)
  File "/usr/src/homeassistant/homeassistant/components/honeywell/climate.py", line 363, in async_set_temperature
    await self._set_temperature(**kwargs)
  File "/usr/src/homeassistant/homeassistant/components/honeywell/climate.py", line 356, in _set_temperature
    raise ValueError(
ValueError: Honeywell set temperature failed: invalid temperature 69.0.
mkmer commented 11 months ago

Does this happen 100% of the time or just occasionally?
I'm not sure why the site is returning HTML here when it's supposed to return XML. You would need to turn on debugging for the API to actually see the HTML in the log file (assuming it was useful).

izdivad commented 11 months ago

It's happening all the time any time I set it above 68.

On Tue, Oct 31, 2023, 11:27 AM mkmer @.***> wrote:

Does this happen 100% of the time or just occasionally? I'm not sure why the site is returning HTML here when it's supposed to return XML. You would need to turn on debugging for the API to actually see the HTML in the log file (assuming it was useful).

— Reply to this email directly, view it on GitHub https://github.com/home-assistant/core/issues/101994#issuecomment-1787450793, or unsubscribe https://github.com/notifications/unsubscribe-auth/AZDOIDL6TQV5I2NN4NFNLL3YCEKFNAVCNFSM6AAAAAA6AGONHCVHI2DSMVQWIX3LMV43OSLTON2WKQ3PNVWWK3TUHMYTOOBXGQ2TANZZGM . You are receiving this because you were mentioned.Message ID: @.***>

mkmer commented 11 months ago

Please attach the diagnostics info from the device page.

izdivad commented 11 months ago

@mkmer Is this what you are looking for? I see there are 2 lines that say ""ScheduleHeatSp": 68.0, "ScheduleCoolSp": 72.0," I'm assuming that is my issue. if it is, how would i change those values? "integration_manifest": {

    "domain": "honeywell",
    "name": "Honeywell Total Connect Comfort (US)",
    "codeowners": [
      "@rdfurman",
      "@mkmer"
    ],
    "config_flow": true,
    "documentation": "https://www.home-assistant.io/integrations/honeywell",
    "iot_class": "cloud_polling",
    "loggers": [
      "somecomfort"
    ],
    "requirements": [
      "AIOSomecomfort==0.0.17"
    ],
    "is_built_in": true
  },
  "data": {
    "Device 5233816": {
      "UI Data": {
        "DispTemperature": 67.0,
        "HeatSetpoint": 67.0,
        "CoolSetpoint": 72.0,
        "DisplayUnits": "F",
        "StatusHeat": 2,
        "StatusCool": 2,
        "HoldUntilCapable": true,
        "ScheduleCapable": true,
        "VacationHold": 0,
        "DualSetpointStatus": false,
        "HeatNextPeriod": 33,
        "CoolNextPeriod": 33,
        "HeatLowerSetptLimit": 40.0,
        "HeatUpperSetptLimit": 90.0,
        "CoolLowerSetptLimit": 50.0,
        "CoolUpperSetptLimit": 99.0,
        "ScheduleHeatSp": 68.0,
        "ScheduleCoolSp": 72.0,
        "SwitchAutoAllowed": true,
        "SwitchCoolAllowed": true,
        "SwitchOffAllowed": true,
        "SwitchHeatAllowed": true,
        "SwitchEmergencyHeatAllowed": true,
        "SystemSwitchPosition": 1,
        "Deadband": 3.0,
        "IndoorHumidity": 128.0,
        "DeviceID": 5233816,
        "Commercial": false,
        "DispTemperatureAvailable": true,
        "IndoorHumiditySensorAvailable": false,
        "IndoorHumiditySensorNotFault": true,
        "VacationHoldUntilTime": 0,
        "TemporaryHoldUntilTime": 0,
        "IsInVacationHoldMode": false,
        "VacationHoldCancelable": false,
        "SetpointChangeAllowed": true,
        "OutdoorTemperature": 128.0,
        "OutdoorHumidity": 128.0,
        "OutdoorHumidityAvailable": false,
        "OutdoorTemperatureAvailable": false,
        "DispTemperatureStatus": 0,
        "IndoorHumidStatus": 128,
        "OutdoorTempStatus": 128,
        "OutdoorHumidStatus": 128,
        "OutdoorTemperatureSensorNotFault": true,
        "OutdoorHumiditySensorNotFault": true,
        "CurrentSetpointStatus": 2,
        "EquipmentOutputStatus": 0
      },
      "Fan Data": {
        "fanMode": 0,
        "fanModeAutoAllowed": true,
        "fanModeOnAllowed": true,
        "fanModeCirculateAllowed": false,
        "fanModeFollowScheduleAllowed": false,
        "fanIsRunning": true
      },
      "DR Data": {
        "CoolSetpLimit": null,
        "HeatSetpLimit": null,
        "Phase": -1,
        "OptOutable": false,
        "DeltaCoolSP": null,
        "DeltaHeatSP": null,
        "Load": null
mkmer commented 11 months ago

These are the values returned by Honeywell site reflecting the values in the T-stat.
These are the values we check against to throw the error "HeatLowerSetptLimit": 40.0, "HeatUpperSetptLimit": 90.0, "CoolLowerSetptLimit": 50.0, "CoolUpperSetptLimit": 99.0, When you send a setpoint command, it checks against these, which appear to be "right" and "available". The setpoint command executes this code: https://github.com/home-assistant/core/blob/4d475a9758fce481a069e84870751a57559ba8f6/homeassistant/components/honeywell/climate.py#L323-L360

Which I think is failing trying to set heat setpoint: https://github.com/home-assistant/core/blob/4d475a9758fce481a069e84870751a57559ba8f6/homeassistant/components/honeywell/climate.py#L353-L354

Which calls this code the actually attempt to set the temp: https://github.com/mkmer/AIOSomecomfort/blob/3e41e5e75794a64a637ef185a2372514208b6623/aiosomecomfort/device.py#L167-L180

If it's <"HeatLowerSetptLimit": 40.0, or > "HeatUpperSetptLimit": 90.0, it should throw this error.

Clearly I'm missing something here as this looks like it should be "ok" and work.

mkmer commented 11 months ago

_LOGGER.error("Invalid temperature %.1f: %s", temperature, err) should result in an entry in the log file with a bit more information - Do you see it in there?

mkmer commented 11 months ago

Hold on - I think see what's going on. When we send the JSON_post command, Honeywell is returning HTML instead of JSON. I think that's the root cause here.

izdivad commented 11 months ago

@mkmer Is there anything i can do to fix this? or is it something that will have to be fixed in the backend?

mkmer commented 11 months ago

We need to see what HTML the site is sending back when the JSON message is sent. In "normal" operation, a JSON message is the response. Hopefully there is something useful in the HTML message to help decide the next path. There should be an error message in the log file (home-assistant.log) with the HTML that you can share.

izdivad commented 11 months ago

@mkmer Here is what i found in the Log

2023-10-31 07:47:33.302 DEBUG (MainThread) [somecomfort] Sending Data: {'DeviceID': 5233816, 'SystemSwitch': None, 'HeatSetpoint': 69.0, 'CoolSetpoint': None, 'HeatNextPeriod': None, 'CoolNextPeriod': None, 'StatusHeat': None, 'StatusCool': None, 'FanMode': None}
2023-10-31 07:47:33.536 ERROR (MainThread) [somecomfort] API returned 200 from /portal/Device/SubmitControlScreenChanges request
2023-10-31 07:47:33.536 DEBUG (MainThread) [somecomfort] request json response <ClientResponse(https://www.mytotalconnectcomfort.com/portal/Error?aspxerrorpath=/portal/Device/SubmitControlScreenChanges) [200 OK]>
<CIMultiDictProxy('Cache-Control': 'no-cache, no-store, must-revalidate', 'Pragma': 'no-cache', 'Content-Type': 'text/html; charset=utf-8', 'Content-Encoding': 'gzip', 'Expires': '-1', 'Vary': 'Accept-Encoding', 'Server': 'Microsoft-IIS/8.5', 'ADRUM_0': 'g:1de17d41-d8c0-4bc9-b762-c82d1a02b297', 'ADRUM_1': 'n:honeywell-prod_f7be1c76-506d-4111-81c5-fc62766aedb7', 'ADRUM_2': 'i:197987', 'ADRUM_3': 'e:28', 'X-Frame-Options': 'DENY', 'X-XSS-Protection': '1; mode=block', 'X-UA-Compatible': 'IE=edge', 'Date': 'Tue, 31 Oct 2023 11:47:33 GMT', 'Content-Length': '3110', 'Set-Cookie': 'NSC_NZUDD-443-WT=ffffffff090ecc0345525d5f4f58455e445a4a42378b;expires=Tue, 31-Oct-2023 11:44:29 GMT;path=/;secure;httponly')>
 with payload <!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Strict//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-strict.dtd">

<!--[if IE 8 ]>    <html class="ie8" xmlns="http://www.w3.org/1999/xhtml"> <![endif]-->
<!--[if IE 9 ]>    <html class="ie9" xmlns="http://www.w3.org/1999/xhtml"> <![endif]-->
<!--[if (gt IE 9)|!(IE)]><!-->
<html xmlns="http://www.w3.org/1999/xhtml">
<!--<![endif]-->
<head><title>

Unexpected Error

</title>

    <!--[if IE]>
        <style>
            .page { 
                    height: auto !important;
                  }
        </style>
    <![endif]-->

    <script type="text/javascript" src="/portal/Scripts/jquery-1.12.0.min.js"></script>
    <script type="text/javascript" src="/portal/Scripts/jquery.unobtrusive-ajax.js"></script>
    <script type="text/javascript" src="/portal/Scripts/jquery.validate.min.js"></script>
    <script type="text/javascript" src="/portal/Scripts/jquery.validate.unobtrusive.min.js"></script>
    <script type="text/javascript" src="/portal/Scripts/jquery-ui-1.10.4.min.js"></script>
    <script type="text/javascript" src="/portal/Scripts/jquery.qtip.min.js"></script>
    <script type="text/javascript" src="/portal/Scripts/jquery.idletimer.js"></script>
    <script type="text/javascript" src="/portal/Scripts/jquery.idletimeout.js"></script>

    <link rel="stylesheet" type="text/css" href="/portal/Content/TrueHome/jquery.qtip.truehome.css" />

    <link rel="stylesheet" type="text/css" href="/portal/Content/TrueHome/jquery.ui.truhome.css" />

    <link rel="stylesheet" type="text/css" href="/portal/Content/TrueHome/Layout.css?v=2.11.13" />
    <link rel="stylesheet" type="text/css" href="/portal/Content/TrueHome/Site.css?v=2.11.13" />
    <link rel="stylesheet" type="text/css" href="/portal/Content/TrueHome/Buttons.css?v=2.11.13" />
    <link rel="stylesheet" type="text/css" href="/portal/Content/TrueHome/EditorTemplates.css?v=2.11.13" />
    <link rel="stylesheet" type="text/css" href="/portal/Content/TrueHome/ModalAjaxContentDialog.css?v=2.11.13" />

    <script type="text/javascript" src="/portal/Scripts/Common/SessionTimeoutHandler.js?v=2.11.13"></script>

    <script type="text/javascript" src="/portal/Scripts/Common/ModalAjaxContentDialog.js?v=2.11.13"></script>
    <script type="text/javascript" src="/portal/Scripts/Common/CustomEvents.js?v=2.11.13"></script>
    <script type="text/javascript" src="/portal/Scripts/Common/EditorTemplates.js?v=2.11.13"></script>
    <script type="text/javascript" src="/portal/Scripts/Common/BrowserDetect.js?v=2.11.13"></script>

    </head>
<body>
    <!-- dialog window markup -->
    <div id="_verticalGradientBackground">
    </div>

    <div id="_contentWrapper">
        <div id="_leftBackground">
        </div>
        <div id="_content">
            <div id="header">
                <div id="header-top">
                    <ul id="toplinks">
                        <li><a href="https://www.honeywellhome.com" target="_blank">HoneywellHome.com</a></li>                        
                    </ul>
                </div>
                <div id="logo">
                    <a href="/portal/">Honeywell Home - My Total Connect Comfort<span></span></a>
                </div>
            </div>
            <div id="menucontainer">
                <ul id="menu">
                    <li class="menulink"><a href="https://www.honeywellhome.com/en/support"
                        target="_blank">
                        Contact Us</a></li>
                    <li class="menudivider"></li>
                    <li class="menulink">
                        <a href="/portal/Home/FAQs">FAQs</a></li>
                    <li class="menudivider"></li>

                    <li class="menulink">
                        <a href="/portal/MyAccount">My Account</a></li>
                    <li class="menudivider"></li>
                    <li class="menulink">
                        <a href="/portal/">Control Center</a></li>
                    <li class="menudivider"></li>
                    <li class="menulink">
                        <a href="/portal/Account/LogOff">Sign Out</a></li>
                    <li class="menudivider"></li>
                    <li id="greeting">
                        Welcome
                        <b>
                            name</b></li>

                </ul>
            </div>
            <div id="red-grey-line">
            </div>
            <div id="breadcrumb">

    <div class="crumbs">Unexpected Error</div>

            </div>
            <div id="main">
                <noscript>
                    <div id="NoJavaScript">
                        This site will not operate without JavaScript enabled.  Refer to the FAQs tab on this site to learn about enabling JavaScript for your browser.
                    </div>
                </noscript>
                <div id="NoCookies">

This site will not operate without Cookies enabled.   Refer to the FAQs tab on this site to learn about enabling Cookies for your browser.
                </div>
                <div id="unsupportedbrowser">
                </div>
                <div id="mainContent">

 <div id="resetpassword">
        <h1>Unexpected Error</h1>
        <div class="formfield">
            <div class="rounded-bevel-border-topleftcorner">
            </div>
            <div class="rounded-bevel-border-top">
            </div>
            <div class="rounded-bevel-border-toprightcorner">
            </div>
            <div class="rounded-bevel-border-left">
                <div class="rounded-bevel-border-right">
                    <div class="whiteborder">
                        <div class="white-border-top">
                        </div>
                        <div class="white-border-left-side">
                            <div class="white-border-right-side">
                                <div id="account-success-whitebox">
                                    <div class="account-success">
                                        <div class="white-border-top">
                                        </div>
                                        <div class="white-border-left-side">
                                            <div class="white-border-right-side">

                                                <img src="/portal/Images/Icons/icon_red_x.gif?v=2.11.13" alt="Error" />
                                                <div class="Success">Error</div>
                                            </div>
                                        </div>
                                        <div class="white-border-bottom">
                                        </div>
                                    </div>
                                    <div class="success-text">
                                        <p>
                                        Sorry, an error occurred while processing your request.
                                        </p>
                                    </div>
                                </div>
                            </div>
                        </div>
                        <div class="white-border-bottom">
                        </div>
                    </div>
                    <div class="buttonarea">
                        <div class="buttonwrapper">
                            <div class="red-button-gray">
                                <a href="/portal/">Home</a>
                            </div>
                        </div>
                    </div>
                </div>
            </div>
            <div class="rounded-bevel-border-bottomleftcorner">
            </div>
            <div class="rounded-bevel-border-bottom">
            </div>
            <div class="rounded-bevel-border-bottomrightcorner">
            </div>
        </div>
    </div>

                </div>
            </div>
            <div id="gatewaylog">

            </div>
            <div id="_push">
            </div>
            <div id="_footer">
                <div>
                    Version 2.11.13 - July 06, 2023
                </div>
                <ul class="left" style="width: 700px;margin-top: 5px;">
                    <li class="rightborder">
                        <a href="/portal/Home/TermsAndConditions">Privacy Statement and End User License Agreement</a></li>
                    <li class="rightborder">
                        <a href="/portal/Home/TermsConditions">Terms &amp; Conditions</a></li>
                    <li class="rightborder"><a href="http://www.mytotalconnectcomfort.com/Account/ResetLocalisationCulture">Global Site</a></li>

                    <li class="rightborder">
                        <a href="/portal/Home/Feedback">Feedback</a></li>
                    <li><br/>&nbsp;&nbsp;<a href="https://honeywellhome.com/" target="_blank">&copy;
                        2023
                        Resideo Technologies, Inc.</a>
                        The Honeywell Home trademark is used under license from Honeywell International Inc. All rights reserved.
                    </li>
                </ul>
                <ul id="CultureControl">

<li class="rightborder"><a class="culture-link" data-ajax="false" href="/portal/Account/ChangeCulture?lang=en-US&amp;returnUrl=%2Fportal%2FError%3Faspxerrorpath%3D%2Fportal%2FDevice%2FSubmitControlScreenChanges" style="text-decoration: underline;">English</a> </li>

<li><a class="culture-link" data-ajax="false" href="/portal/Account/ChangeCulture?lang=fr-CA&amp;returnUrl=%2Fportal%2FError%3Faspxerrorpath%3D%2Fportal%2FDevice%2FSubmitControlScreenChanges" style="">Fran&#231;ais</a></li>

                </ul>
            </div>
        </div>
        <div id="_rightBackground">
        </div>
    </div>

    <div id="dialog" style="display: none">
        <div class="warning"></div>
        <ul>
            <li class="header">Your session is about to expire.</li>
            <li>You will be logged off in <span id='dialog-countdown' style='font-weight:bold'></span> seconds.</li>
            <li>Do you want to continue your session?</li>
        </ul>
    </div>

        <script type="text/javascript">
            var sessionTimeoutHandler = new SessionTimeoutHandler(
                "#dialog",
                "#dialog-countdown",
                "Yes",
                "No",
                '/portal/Account/LogOff',
                '/portal/Account/Timeout'
            );
            sessionTimeoutHandler.Initialize();
        </script>

    <script type="text/javascript" language="javascript">
        $(function ()
        {
            var isMobileDevice = false;

            if (BrowserDetect.browser == "Explorer" && parseFloat(BrowserDetect.version) < 8)
            {
                $("#unsupportedbrowser").html('The web browser you are using is not supported.  A supported browser is required to use Total Connect Comfort.  The most recent versions of Chrome, Safari, Firefox and Internet Explorer may be used.  Update or download one of these browsers to use Total Connect Comfort.');
            }
        });
    </script>
</body>
</html>

2023-10-31 07:47:33.536 ERROR (MainThread) [homeassistant.components.honeywell.const] Invalid temperature 69.0: API returned 200, /portal/Device/SubmitControlScreenChanges
2023-10-31 07:47:33.537 ERROR (MainThread) [homeassistant.components.websocket_api.http.connection] [140243338613568] Honeywell set temperature failed: invalid temperature 69.0.
mkmer commented 11 months ago

Yes, that's what I was looking for, but it's not helping :( Basically says: "An unexpected error occurred" - no reason why.

I'm looking at adding a different error message for this type of response as it's been confusing to everyone. It's not really an invalid temperature set point, it's the server complaining about a back end error. I'm not sure what to look for next. The message being sent looks fine: 2023-10-31 07:47:33.302 DEBUG (MainThread) [somecomfort] Sending Data: {'DeviceID': 5233816, 'SystemSwitch': None, 'HeatSetpoint': 69.0, 'CoolSetpoint': None, 'HeatNextPeriod': None, 'CoolNextPeriod': None, 'StatusHeat': None, 'StatusCool': None, 'FanMode': None}

Can you set the values via mytotalconnectcomfort.com for this stat?

izdivad commented 11 months ago

Yeah, I can control it just fine using the website, Play Store app and Google Home integration. It seems to just be Home Assistant's integration that is broken. Do you know if this is affecting everyone, people with just my model thermostat, or something else?

mkmer commented 11 months ago

There are a few people with "issues" recently. Some are related to the entity going unavailable and having set issues. They may be related. Since I don't have your model to play with, you could help by capturing the messages being sent on the web page (via more tools -> web developer tools on firefox, or ) and compare them to the XML sent by HA found in the previous message. It may be your stat wants some additional values.

On Wed, Nov 1, 2023 at 9:03 AM izdivad @.***> wrote:

Yeah, I can control it just fine using the website, Play Store app and Google Home integration. It seems to just be Home Assistant's integration that is broken. Do you know if this is affecting everyone, people with just my model thermostat, or something else?

David Izquierdo

Lead I.T Technician

WIRED

(828)-349-0101

@.***

Wiredinc.com

121 Highlands RD, Franklin, NC

--- original message --- On November 1, 2023 at 8:18 AM EDT @.*** wrote:

Yes, that's what I was looking for, but it's not helping :( Basically says: "An unexpected error occurred" - no reason why.

I'm looking at adding a different error message for this type of response as it's been confusing to everyone. It's not really an invalid temperature set point, it's the server complaining about a back end error.

I'm not sure what to look for next. The message being sent looks fine:

2023-10-31 07:47:33.302 DEBUG (MainThread) [somecomfort] Sending Data: {'DeviceID': 5233816, 'SystemSwitch': None, 'HeatSetpoint': 69.0, 'CoolSetpoint': None, 'HeatNextPeriod': None, 'CoolNextPeriod': None, 'StatusHeat': None, 'StatusCool': None, 'FanMode': None}

Can you set the values via mytotalconnectcomfort.com for this stat?

Reply to this email directly, view it on GitHub, or unsubscribe.

You are receiving this because you were mentioned.Message ID: @.***> --- end of original message ---

— Reply to this email directly, view it on GitHub https://github.com/home-assistant/core/issues/101994#issuecomment-1788920301, or unsubscribe https://github.com/notifications/unsubscribe-auth/AB3GVBCHFK2BJOBZD2DXKYTYCJCDRAVCNFSM6AAAAAA6AGONHCVHI2DSMVQWIX3LMV43OSLTON2WKQ3PNVWWK3TUHMYTOOBYHEZDAMZQGE . You are receiving this because you were mentioned.Message ID: @.***>

izdivad commented 11 months ago

@mkmer Here is the API Post request payload when sending a request for temp change. I'm not sure if this is what you are looking for exactly. or if you are looking for something in the headers.

{DeviceID: 5233816, SystemSwitch: null, HeatSetpoint: 66, CoolSetpoint: null, HeatNextPeriod: null,…}
CoolNextPeriod: null
CoolSetpoint: null
DeviceID: 5233816
FanMode: null
HeatNextPeriod: null
HeatSetpoint: 66
StatusCool: null
StatusHeat: null
SystemSwitch: null
mkmer commented 11 months ago

Yes, this is what I was looking for. It appears to match what HA is sending. This issue https://github.com/home-assistant/core/issues/78531 was hanging around for awhile and we never did get to the bottom of it. He was not 100% failure, but it sound similar. We used to send only the values we were changing, then I added the null values just to make sure it wasn't the cause. I don't know what they don't like - maybe you can identify it?

izdivad commented 11 months ago

@mkmer In messing around with this. I've discovered something new.

If change the heat temp on either the Total Connect mobile app or website to lets say 75, then go back down to lets say 67. I can then change the HA temp UP TO 75, If I go above that I then get the error. That works for any max temp so far. Very strange.

izdivad commented 11 months ago

When the error occurs, A HTML response is not only sent to HA causing that error, the same HTML response from a get request shows in my active tab open on my computer from the total connect website.

image

izdivad commented 11 months ago

As a temp fix, I can set the max temp to 90, that seems to fix the issue as long as I use the HA app exclusively for setting temps

mkmer commented 11 months ago

Looks like your on to something. Maybe sniff all of the XML messages being sent from the web page, see if there's something more than just he one message. There must be something extra missing. Maybe in the headers?

izdivad commented 11 months ago

@mkmer here is the Response Headers for a successful attempt

HTTP/1.1 200 OK
Cache-Control: no-cache, no-store, must-revalidate
Pragma: no-cache
Content-Type: application/json; charset=utf-8
Expires: -1
Server: [REDACTED]
ADRUM_0: [REDACTED]
ADRUM_1: [REDACTED]
ADRUM_2: [REDACTED]
ADRUM_3: [REDACTED]
X-Frame-Options: DENY
X-XSS-Protection: 1; mode=block
X-UA-Compatible: IE=edge
Date: Wed, 01 Nov 2023 15:07:46 GMT
Content-Length: 1708
Set-Cookie: [REDACTED]

and here is the unsuccessful attempt:

HTTP/1.1 200 OK
Cache-Control: no-cache, no-store, must-revalidate
Pragma: no-cache
Content-Type: text/html; charset=utf-8
Content-Encoding: gzip
Expires: -1
Vary: Accept-Encoding
Server: [REDACTED]
ADRUM_0: [REDACTED]
ADRUM_1: [REDACTED]
ADRUM_2: [REDACTED]
ADRUM_3: [REDACTED]
X-Frame-Options: DENY
X-XSS-Protection: 1; mode=block
X-UA-Compatible: IE=edge
Date: Wed, 01 Nov 2023 15:36:13 GMT
Content-Length: 7505
Set-Cookie: [REDACTED]

I don't think that shows anything that we don't already know.

So I think I came up with a hacky solution... After I changed the temp on total connects website to it's max at 90. Now everything works as it should. I can change the temp on the total connect app and website to any temp. then go above that temp in HA. Meaning, I think it's fixed as of right now. Very, Very Strange. Granted I haven't tested on System Cool yet.

f-dub-e commented 11 months ago

@izdivad, your hacky solution did resolve my issue also! This is a temporary fix and not really robust as I don't know when the wife uses the thermostat, but I'm now able to set a temperature above 22.5!

mkmer commented 11 months ago

When you say changed to max - you are adjusting the temp to 90, then dialing it back via HA? Then if you dial it back with the web site it will not longer go back up via HA?

izdivad commented 11 months ago

@mkmer after I changed the temp on the tcc app to 90. I can now change the temp on either the tcc app / website and HA without issues. Before, if i changed it on the app to lets say 68. I wouldn't be able to go above that in HA without the error. Now it seems to be working as expected without any errors.

mkmer commented 11 months ago

We must not match 100% what the web site sends in the JSON set message... but it's not obvious to me. Maybe your eyes will see it...

mkmer commented 11 months ago

@ShortPutt - does this "fix" work with your version of this problem?

ShortPutt commented 11 months ago

My problem is similar. The most recent manifestation is that HA fails every time when setting the temp to 69 or below (I'm in FL). I get the same Invalid Temperature / Unexpected Error. Clearly its not an invalid temp. For the last month or so this has been very consistent, so its different than last year where the failures were random. Needless to say I can change the temp with the iPhone app and TCC website w/o any problem. I haven't tried setting the temp to the lower limit w the app and then trying it w/ HA. Seems like an odd solution, but I will give it a try next week when I'm back in FL and let you know what I find.

Elmojomo commented 11 months ago

I just wanted to drop in to say I'm having the exact same issue (can't set above 68F), and also THANK YOU for the 'fix' of setting to max temp on the TCC web site. :) For me, the max is 85F, but now I have full control via HA again. Nice.

mkmer commented 11 months ago

Just want to be sure I understand: you are setting the temperature to some "larger" number via the web site (for heat), then adjusting the value back down in HA? After that you can adjust it via HA up to the "larger" value but not higher?

image

Elmojomo commented 11 months ago

Yep, that's exactly right. In my case, 85F is the max my 'stat will accept, so I'm not sure if HA would let me go higher, had I selected a lower max on the TCC site. I can try it and report back, if that would help with the troubleshooting on your end?

EDIT: I seems that maybe messing with the TCC site has sorta fixed something, since changing the Max heating value to 80F still allows me to set HA to whatever I want, even higher than 80F now. I no longer get the "invalid temperature" error, regardless of what setpoint I select.

mkmer commented 11 months ago

Can you attach a snap of what you are changing on the web page? I suspect yours looks different than mine (or has additional options)

Elmojomo commented 11 months ago

Mine looks identical to yours. I'm only clicking the large black "up" arrow to change the set temperature to a higher number. In my case, I set it (originally) to the highest available value, which was 85F. Once that updated in HA on my phone, I was then able to set it in HA to any value I wanted, without receiving the "invalid temperature" error that I saw previously, when choosing any value above 68F.

mkmer commented 11 months ago

Well - Mine doesn't do that :( I'll have to lean you folks to detect what is different between the web page messages being sent and the HA messages. All I can think of is some header values - maybe the referrer or something we haven't populated because it didn't seem important... We are sending the same XML command to set the temperature (supposedly), but the web page can do it and HA can't. In the mean time, I will get a note added to the docs for others to "fix" this if they run across it.

Elmojomo commented 11 months ago

Huh, strange. I wish I could help more, but I don't even know how to find logs. :/ When I go to the 'logbook' section of the HA web interface, it shows basically nothing for the past couple days, so I know that's not the right place. Beyond that, I'm clueless. lol

ShortPutt commented 11 months ago

I ran some tests I have 2 tstats. Both fail w/ "Invalid Temperature" when setting target temp to 69 w HA service. The html returned w the Invalid Temperature message has 'Content-Type': 'text/html; charset=utf-8' I set both tstats to 60 - the lowest temp, then back to following schedule w the iPhone app. Then used HA service to set to 69 - same error. I set both tstats to 60 w the iPhone app, then to 69 w the HA service - this worked. It wasn't in the log but the content type had to have been json for it to succeed. I set both tstats to follow schedule, then to 69 w the HA service - Failed w same error.

So the fix does not work for me, or maybe it doesn't work for cool, but it is interesting that the HA service succeeds setting the target temp to 69 after setting it to 60 w the iPhone. BTW in earlier testing I tried every temp <70 w the HA service and they all fail, so it appears its not specifically 69 that causes the issue.

Here are the attributes of the climate entity in HA. I include these to demonstrate I'm not bumping into the min_temp. hvac_modes: off, heat_cool, cool, heat min_temp: 60 max_temp: 99 fan_modes: on, auto, diffuse preset_modes: none, away, Hold current_temperature: 76 temperature: 76 target_temp_high: null target_temp_low: null current_humidity: 54 fan_mode: diffuse hvac_action: idle preset_mode: Hold fan_action: idle permanent_hold: true dr_phase: -1 friendly_name: redacted supported_features: 27

mkmer commented 11 months ago

Thanks for checking this out. I think the guys above were changing the values on the web page (don't ask me why this makes a difference or if it does). You may be on to something with the follow schedule - if you change the temp while following schedule, it should go to a temporary (or permanent) hold on the stat.
I think you said it works when HA try to set it in hold mode but not in follow schedule? Maybe we are missing something to kick it into hold mode.

ShortPutt commented 11 months ago

I can confirm that using HA to change the target temperature when the tstat is in Cool mode and either following schedule or in temporary hold results in the tstat being in temporary hold. Additionally, using HA to change the target temperature when the tstat is in permanent hold leaves the tstat in permanent hold. Currently these only work when the target temp is > 69.

I ran the same tests I reported earlier using a browser and the Honeywell Home TCC website (mytotalconnectcomfort.com) instead of the iPhone app and achieved the same results. I tested when tstat was in both Cool and Auto modes.

Not sure I said this before, but my tstats are Honeywell Home RTH9585WF Wi-Fi Smart Color Thermostats.

Maybe someone can try using a different controller - IFTTT, Google Assistant, Amazon Alexa,,, It would be interesting to know if controlling the tstat w those controllers results in the same problem. I don't have any of those controllers, so it would be a bit of an effort for me to test it.

mkmer commented 11 months ago

Even more frustrating: I also have the RTH9585WF1004.
I guess we need to keep digging into settings/options and/or differences in the xml/header messages sent from the web page to TCC. At this point, I believe it's a 100% match, but clearly it's not or it would work like the web page does. Something must be different.

XavitoHA19 commented 11 months ago

I was having the same problem and I think that I found a solution. I have the rth6580wf thermostat and the behavior was similar to what was described here. After a lot of testing I discovered the following:

You must call the following services on the order specified:

- service: climate.set_hvac_mode
  target:
    entity_id: 
  data:
    hvac_mode: (heat/cool)

- service: climate.set_preset_mode
  target:
    entity_id: 
  data:
    preset_mode: Hold
- service: climate.set_temperature
  target:
    entity_id: 
  data:
    temperature: 

If I change the order, then I start having errors, but not all the time.
Also, on the preset mode I need to specify Hold

I hope this helps someone.

ShortPutt commented 10 months ago

I tried @XavitoHA19's solution. Doesn't work for me.

I've looked at every aspect of the calls from the web and HA. Everything is identical, so I think the headers, payload, json etc is all good.

The only thing that I can find that's different is the code that blanks out the expiration date in the .ASPXAUTH_TRUEHOME cookie in __init__.py. The comment says it had to be done to work w AIOhttp, but I wonder if that's causing the problem w TCC. Obviously that cookie is not getting modified when using the website or the iPhone app.

I tried commenting out the code and I tried changing the expiration date to a future dttm. Both fail with the null cookie exception.

@mkmer have you looked into this aspect?

mkmer commented 10 months ago

@ShortPutt Thank you for reviewing the messages. I've stared at them multiple times and couldn't see a difference either. As for the expiration date, the site is providing a bad expiration on the cookie - I think it has something to do with UTC vs local time. If I remember right, it looks like they are populating local time and declaring it UTC (or something like that), so AIOHTTP drops the key from the internally implemented cookie jar (this was VERY painful to figure out). By clearing the expiration date (yes a hack on my part), AIOHTTP puts the cookie in the jar, otherwise it drops the cookie and nothing works. Requests did not appear to care about the timestamp.

ShortPutt commented 10 months ago

Hmm, ok. So you don't think that's the issue? From what I can see it's the only thing that's different between our HA calls and the web calls.

Do you know if the old somecomfort synchronous version had the same issue? Wondering if testing w/ that version might help us diagnose this problem.

btw, I hear you on figuring that out. I can imagine it was quite the challenge.

mkmer commented 10 months ago

There were a LOT of problems before moving to asyncIO and AIOHttp. This was the only one I couldn't figure out, but I believe it was there before moving to AIOHttp. I think it was your issue that existed before I started moving stuff: https://github.com/home-assistant/core/issues/78531 only closed due to inactivity. Additionally, because the API was polling the whole web page instead of just the XML data, the integration would be rate limited quite often obfuscating issues - one never knew for sure if it was rate limit or another error. REALLY frustrating for sure.

Maybe we need to sniff out the whole path - login, then change temp and see if any extra payloads are sent to the site via the web interface. Maybe there is an extra message?!?

ShortPutt commented 10 months ago

I'll keep looking. Are you able to replicate the problem?