So I removed the ‘/100’ on line 446 of climate.py and got the following error message:
Mon Jan 06 2020 17:04:59 GMT-0500 (Eastern Standard Time)
Failed PUT Request:
Url: /houses/698509/xxl_thermostats/1052143/humidity_setpoints
Payload {'id': 1052143, 'humidify_setpoint': True, 'dehumidify_setpoint': 0.5, 'humidify_allowed': True, 'dehumidify_allowed': True, 'current_relative_humidity': 0.4366, 'display': {'humidity': 44, 'humidify_setpoint': 100, 'dehumidify_setpoint': 50, 'humidify_allowed': True, 'dehumidify_allowed': True, 'both_humidify_and_dehumidify_allowed': True, 'show_humidity_setpoint_changer': True, 'heat': False}}
_content: b'<!DOCTYPE HTML>\n<!--[if IE 7 ]> <html class="ie7"> <![endif]-->\n<!--[if IE 8 ]> <html class="ie8"> <![endif]-->\n<!--[if IE 9 ]> <html class="ie8"> <![endif]-->\n<!--[if (gt IE 9)|!(IE)]><!--> <html> <!--<![endif]-->\n<head>\n <meta charset="utf-8">\n <meta http-equiv="X-UA-Compatible" content="IE=edge,chrome=1">\n <meta name="viewport" content="width=device-width, initial-scale=1.0">\n <title>Nexia™</title>\n\n <link href="/assets/nexia/favicon.ico" rel="shortcut icon" type="image/vnd.microsoft.icon" />\n <link href="/assets/static_page.css?body=1" media="screen" rel="stylesheet" type="text/css" />\n\n <!--[if lt IE 9]>\n <script src="//html5shim.googlecode.com/svn/trunk/html5.js"></script>\n <![endif]-->\n\n</head>\n<body id="login-body">\n <div id="footer_wrapper">\n <header>\n <div id="header-utility">\n <div class="header-utility-content">\n <div class="right">\n </div>\n <div class="left">\n </div>\n </div>\n </div>\n <nav id="header-navigation">\n <div class="header-navigation-content">\n <div class="left">\n <a href="/"><img alt="Link_logo" src="/assets/nexia/link_logo.png"></a>\n </div>\n <div class="right">\n </div>\n </div>\n </nav>\n </header>\n\n <div id="content">\n <div id="external-wrapper">\n <div id="external-content">\n <div class="nexia_content"> <!-- Main body content: .com -->\n <h2>We\'re sorry, an error has occurred (500).</h2>\n <p>In order to provide you with the best possible service and reliability, we have logged this error and will do our best to correct it as quickly as possible.</p>\n <p>In the meantime, please click the link below to return to the Nexia™ website. If you need further assistance, please contact Nexia support at 877-288-7707 or [email protected].</p>\n <p>\n <a href="/">Return to <span class="system_name">Nexia™</span></a>\n </p>\n </div>\n </div>\n </div>\n </div>\n <div id="footer_push"></div>\n </div>\n <footer id="content_footer">\n <div class="footer-content">\n <div class="column-a">\n <a href="/privacy_policy.html" target="_blank">Privacy Policy</a>\n <a href="/terms_and_conditions.html" target="_blank">Terms and Conditions</a>\n <a href="http://mynexiahome.com" target="_blank">Subscriber Community</a>\n </div>\n <div class="column-b">\n <a href="http://www.nexiahome.com" target="_blank">Where to Buy</a>\n <a href="http://www.nexiahome.com/faq/" target="_blank">Contact Nexia</a>\n <a href="https://mynexia.helpdocsonline.com" id="help_button" target="_blank">Help <span></span></a>\n </div>\n <div class="copyright">\n \xc2\xa9 2015 Nexia Intelligence LLC\n </div>\n <div class="social-buttons">\n <a href="https://twitter.com/NexiaHome" class="twitter" target="_blank">Twitter</a>\n <a href="https://www.facebook.com/NexiaHome" class="facebook" target="_blank">Facebook</a>\n <a href="https://www.youtube.com/user/NexiaHome" class="youtube" target="_blank">YouTube</a>\n </div>\n </div>\n </footer>\n</body>\n</html>\n'
status_code: 500
headers: {'Content-Type': 'text/html; charset=utf-8', 'Date': 'Mon, 06 Jan 2020 22:04:59 GMT', 'Server': 'nginx/1.15.8 + Phusion Passenger', 'Status': '500 Internal Server Error', 'Strict-Transport-Security': 'max-age=631139040; includeSubdomains', 'Vary': 'Origin', 'X-Content-Type-Options': 'nosniff', 'X-Download-Options': 'noopen', 'X-Frame-Options': 'SAMEORIGIN', 'X-Permitted-Cross-Domain-Policies': 'none', 'X-Powered-By': 'Phusion Passenger Enterprise', 'X-Request-Id': 'd23922c8-fd36-4d16-abbb-b939228b99f5', 'X-Runtime': '0.040871', 'X-XSS-Protection': '1; mode=block', 'Content-Length': '3244', 'Connection': 'keep-alive'}
url: https://www.mynexia.com/houses/698509/xxl_thermostats/1052143/humidity_setpoints
history: []
encoding: utf-8
reason: Internal Server Error
cookies: <RequestsCookieJar[]>
elapsed: 0:00:00.116483
request: <PreparedRequest [PUT]>
Traceback (most recent call last):
File "/usr/src/homeassistant/homeassistant/components/websocket_api/commands.py", line 133, in handle_call_service
connection.context(msg),
File "/usr/src/homeassistant/homeassistant/core.py", line 1235, in async_call
await asyncio.shield(self._execute_service(handler, service_call))
File "/usr/src/homeassistant/homeassistant/core.py", line 1262, in _execute_service
await self._hass.async_add_executor_job(handler.func, service_call)
File "/usr/local/lib/python3.7/concurrent/futures/thread.py", line 57, in run
result = self.fn(*self.args, **self.kwargs)
File "/config/custom_components/nexia/climate.py", line 71, in humidify_set_service
zone.set_humidify_setpoint(humidity)
File "/config/custom_components/nexia/climate.py", line 447, in set_humidify_setpoint
self._device.set_humidify_setpoint(humidify_setpoint, self._thermostat_id)
File "/config/custom_components/nexia/nexia_thermostat.py", line 1011, in set_humidify_setpoint
thermostat_id=thermostat_id)
File "/config/custom_components/nexia/nexia_thermostat.py", line 980, in set_humidity_setpoints
self._put_url(url, data)
File "/config/custom_components/nexia/nexia_thermostat.py", line 181, in _put_url
request)
File "/config/custom_components/nexia/nexia_thermostat.py", line 255, in _check_response
raise Exception(f"{error_text}\n{response}")
Exception: Failed PUT Request:
Url: /houses/698509/xxl_thermostats/1052143/humidity_setpoints
Payload {'id': 1052143, 'humidify_setpoint': True, 'dehumidify_setpoint': 0.5, 'humidify_allowed': True, 'dehumidify_allowed': True, 'current_relative_humidity': 0.4366, 'display': {'humidity': 44, 'humidify_setpoint': 100, 'dehumidify_setpoint': 50, 'humidify_allowed': True, 'dehumidify_allowed': True, 'both_humidify_and_dehumidify_allowed': True, 'show_humidity_setpoint_changer': True, 'heat': False}}
_content: b'<!DOCTYPE HTML>\n<!--[if IE 7 ]> <html class="ie7"> <![endif]-->\n<!--[if IE 8 ]> <html class="ie8"> <![endif]-->\n<!--[if IE 9 ]> <html class="ie8"> <![endif]-->\n<!--[if (gt IE 9)|!(IE)]><!--> <html> <!--<![endif]-->\n<head>\n <meta charset="utf-8">\n <meta http-equiv="X-UA-Compatible" content="IE=edge,chrome=1">\n <meta name="viewport" content="width=device-width, initial-scale=1.0">\n <title>Nexia™</title>\n\n <link href="/assets/nexia/favicon.ico" rel="shortcut icon" type="image/vnd.microsoft.icon" />\n <link href="/assets/static_page.css?body=1" media="screen" rel="stylesheet" type="text/css" />\n\n <!--[if lt IE 9]>\n <script src="//html5shim.googlecode.com/svn/trunk/html5.js"></script>\n <![endif]-->\n\n</head>\n<body id="login-body">\n <div id="footer_wrapper">\n <header>\n <div id="header-utility">\n <div class="header-utility-content">\n <div class="right">\n </div>\n <div class="left">\n </div>\n </div>\n </div>\n <nav id="header-navigation">\n <div class="header-navigation-content">\n <div class="left">\n <a href="/"><img alt="Link_logo" src="/assets/nexia/link_logo.png"></a>\n </div>\n <div class="right">\n </div>\n </div>\n </nav>\n </header>\n\n <div id="content">\n <div id="external-wrapper">\n <div id="external-content">\n <div class="nexia_content"> <!-- Main body content: .com -->\n <h2>We\'re sorry, an error has occurred (500).</h2>\n <p>In order to provide you with the best possible service and reliability, we have logged this error and will do our best to correct it as quickly as possible.</p>\n <p>In the meantime, please click the link below to return to the Nexia™ website. If you need further assistance, please contact Nexia support at 877-288-7707 or [email protected].</p>\n <p>\n <a href="/">Return to <span class="system_name">Nexia™</span></a>\n </p>\n </div>\n </div>\n </div>\n </div>\n <div id="footer_push"></div>\n </div>\n <footer id="content_footer">\n <div class="footer-content">\n <div class="column-a">\n <a href="/privacy_policy.html" target="_blank">Privacy Policy</a>\n <a href="/terms_and_conditions.html" target="_blank">Terms and Conditions</a>\n <a href="http://mynexiahome.com" target="_blank">Subscriber Community</a>\n </div>\n <div class="column-b">\n <a href="http://www.nexiahome.com" target="_blank">Where to Buy</a>\n <a href="http://www.nexiahome.com/faq/" target="_blank">Contact Nexia</a>\n <a href="https://mynexia.helpdocsonline.com" id="help_button" target="_blank">Help <span></span></a>\n </div>\n <div class="copyright">\n \xc2\xa9 2015 Nexia Intelligence LLC\n </div>\n <div class="social-buttons">\n <a href="https://twitter.com/NexiaHome" class="twitter" target="_blank">Twitter</a>\n <a href="https://www.facebook.com/NexiaHome" class="facebook" target="_blank">Facebook</a>\n <a href="https://www.youtube.com/user/NexiaHome" class="youtube" target="_blank">YouTube</a>\n </div>\n </div>\n </footer>\n</body>\n</html>\n'
status_code: 500
headers: {'Content-Type': 'text/html; charset=utf-8', 'Date': 'Mon, 06 Jan 2020 22:04:59 GMT', 'Server': 'nginx/1.15.8 + Phusion Passenger', 'Status': '500 Internal Server Error', 'Strict-Transport-Security': 'max-age=631139040; includeSubdomains', 'Vary': 'Origin', 'X-Content-Type-Options': 'nosniff', 'X-Download-Options': 'noopen', 'X-Frame-Options': 'SAMEORIGIN', 'X-Permitted-Cross-Domain-Policies': 'none', 'X-Powered-By': 'Phusion Passenger Enterprise', 'X-Request-Id': 'd23922c8-fd36-4d16-abbb-b939228b99f5', 'X-Runtime': '0.040871', 'X-XSS-Protection': '1; mode=block', 'Content-Length': '3244', 'Connection': 'keep-alive'}
url: https://www.mynexia.com/houses/698509/xxl_thermostats/1052143/humidity_setpoints
history: []
encoding: utf-8
reason: Internal Server Error
cookies: <RequestsCookieJar[]>
elapsed: 0:00:00.116483
request: <PreparedRequest [PUT]>
Your ‘is_percent’ function in init.py is broken and just returns True if between 1 and 100 and False otherwise. I added a # to comment out everything from the “AND” afterwards on the line and now it changes the Humidify settings.
I’ve used this as a means to learn more Python so I’ll look at adding the bounds checking that works to return a number.
I added an if-elif-else block to limit it to 0-100 in is_percent and it works well now.