cjkrolak / ThermostatSupervisor

supervisor to detect and correct thermostat deviations
MIT License
0 stars 0 forks source link

pyhtcc.pyhtcc.UnexpectedError: Expected json data in the response on Honeywell #626

Closed cjkrolak closed 1 year ago

cjkrolak commented 1 year ago

new error message with pyhtcc 0.1.53:

Traceback (most recent call last):
  File "/usr/lib/python3.9/runpy.py", line 197, in _run_module_as_main
    return _run_code(code, main_globals, None,
  File "/usr/lib/python3.9/runpy.py", line 87, in _run_code
    exec(code, run_globals)
  File "/home/pi/github/ThermostatSupervisor/thermostatsupervisor/supervise.py", line 133, in <module>
    exec_supervise(debug=True, argv_list=argv_inputs)
  File "/home/pi/github/ThermostatSupervisor/thermostatsupervisor/supervise.py", line 113, in exec_supervise
    supervisor(api.uip.get_user_inputs(api.uip.parent_keys[0],
  File "/home/pi/github/ThermostatSupervisor/thermostatsupervisor/supervise.py", line 76, in supervisor
    measurement = Zone.supervisor_loop(Thermostat, session_count,
  File "/home/pi/github/ThermostatSupervisor/thermostatsupervisor/thermostat_common.py", line 1048, in supervisor_loop
    self.refresh_zone_info()
  File "/home/pi/github/ThermostatSupervisor/thermostatsupervisor/honeywell.py", line 721, in refresh_zone_info
    all_zones_info = self.pyhtcc.get_zones_info()
  File "/home/pi/github/ThermostatSupervisor/thermostatsupervisor/honeywell.py", line 248, in get_zones_info
    more_data = self._get_check_data_session(device_id)
  File "/home/pi/.local/lib/python3.9/site-packages/pyhtcc/pyhtcc.py", line 631, in _get_check_data_session
    return self._request_json(
  File "/home/pi/.local/lib/python3.9/site-packages/pyhtcc/pyhtcc.py", line 671, in _request_json
    raise UnexpectedError("Expected json data in the response")
pyhtcc.pyhtcc.UnexpectedError: Expected json data in the response
cjkrolak commented 1 year ago

raw site response:

 <!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.4" />
    <link rel="stylesheet" type="text/css" href="/portal/Content/TrueHome/Site.css?v=2.11.4" />
    <link rel="stylesheet" type="text/css" href="/portal/Content/TrueHome/Buttons.css?v=2.11.4" />
    <link rel="stylesheet" type="text/css" href="/portal/Content/TrueHome/EditorTemplates.css?v=2.11.4" />
    <link rel="stylesheet" type="text/css" href="/portal/Content/TrueHome/ModalAjaxContentDialog.css?v=2.11.4" />

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

    <script type="text/javascript" src="/portal/Scripts/Common/ModalAjaxContentDialog.js?v=2.11.4"></script>
    <script type="text/javascript" src="/portal/Scripts/Common/CustomEvents.js?v=2.11.4"></script>
    <script type="text/javascript" src="/portal/Scripts/Common/EditorTemplates.js?v=2.11.4"></script>
    <script type="text/javascript" src="/portal/Scripts/Common/BrowserDetect.js?v=2.11.4"></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>
                            Christopher</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">

                </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.4" 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.4 - February 15, 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%2FCheckDataSession%2F1457408" 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%2FCheckDataSession%2F1457408" 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>
cjkrolak commented 1 year ago

now catching both connection and unknown errors, intent is to force re-connection for both occurrences, need to test this code out to determine if re-connect flow is correct.