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
73.99k stars 31.04k forks source link

Honeywell Lyric integration unable to make changes #48801

Closed wtadler closed 3 years ago

wtadler commented 3 years ago

The problem

The Lyric integration seems to be reading the thermostat status just fine. But I cannot make changes. No error is made visible in Lovelace. But I do get the below error in the log, printed once for each time I try to make a change.

What is version of Home Assistant Core has the issue?

core-2021.4.0

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

Lyric

Link to integration documentation on our website

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

Example YAML snippet

No response

Anything in the logs that might be useful for us?

2021-04-07 16:34:07 ERROR (MainThread) [homeassistant.components.lyric.climate] {'request': {'method': 'POST', 'url': 'https://api.honeywell.com/v2/devices/thermostats/TCC-2728972?apikey=XXXX&locationId=XXX', 'headers': {'Authorization': 'Bearer XXXX', 'Content-Type': 'application/json'}, 'json': {'mode': 'Off', 'heatSetpoint': 75, 'coolSetpoint': 78, 'autoChangeoverActive': False}}, 'response': {'code': 400, 'message': "'EmergencyHeatActive' is required."}, 'status': 400}
probot-home-assistant[bot] commented 3 years ago

lyric documentation lyric source (message by IssueLinks)

probot-home-assistant[bot] commented 3 years ago

Hey there @timmo001, mind taking a look at this issue as its been labeled with an integration (lyric) you are listed as a codeowner for? Thanks! (message by CodeOwnersMention)

thedude0101 commented 3 years ago

I am also unable to send any setpoint commands to my device. The thermostat lights up like it is receiving something but the setpoint doesn't change the log reads: {'code': 400, 'message': 'Cool setpoint can not be lower than heat setpoint plus deadband.'}, 'status': 400}. Even if I try to manually adjust the setpoints I get the same error.

timmo001 commented 3 years ago

According to the API docs: https://developer.honeywellhome.com/lyric/apis/post/devices/thermostats/%7BdeviceId%7D

Field Name/Location Data Type Definition
EmergencyHeatActive Boolean Indicates if emergency heating is active. Do not send if Emergency Heat is false.

@wtadler What thermostat are you using? The docs don't make much sense of whether this setting should be set or not in the request..

@thedude0101 That error is different. Can you open another issue detailing your thermostat and the errors with any other logs you can find? If you know how, you can set the logger component/integration to debug to find the request made to Lyric.

homeassistant.components.lyric: debug
lyric: debug
timmo001 commented 3 years ago

Just to confuse things even more:

changeableValues.emergencyHeatActive Boolean Indicates if emergency heating is active. When this field is returned (it is nullable and does not have to be in the response) - it means that the device handles emergency heating independently of the mode. When this field is returned (it is nullable and does not have to be in the response) - device will not accept EmergencyHeat as an allowed value. When emergency heating is active you cannot set thermostat's mode to other value than Off and you cannot change autochangeover.
wtadler commented 3 years ago

It's a Honeywell Lyric Round RCH9310WF.

ecelonghorn commented 3 years ago

I also have a lyric round and am experiencing this issue. It only happens in cool mode. Heat Mode works perfect.

Logs:

{'request': {'method': 'POST', 'url': 'https://api.honeywell.com/v2/devices/thermostats/TCC-4559684?apikey=VghRFeH6UDYmmoUEAvA3Jno08mJvGEsx&locationId=2181062', 'headers': {'Authorization': 'Bearer yI8toAnGd7JG4iTDGFo4nKZcxmS4', 'Content-Type': 'application/json'}, 'json': {'mode': 'Cool', 'heatSetpoint': 70.0, 'coolSetpoint': 68, 'autoChangeoverActive': False}}, 'response': {'code': 400, 'message': 'Cool setpoint can not be lower than heat setpoint plus deadband.'}, 'status': 400}

ecelonghorn commented 3 years ago

@timmo001

I believe the issue of the thermostat not updating may be tied to the code not setting the coolsetpoint when the mode is cool. The following error messages show the heatsetpoint being updated even though the mode = cool, and the coolsetpoint is not. No changes are accepted by the thermostat when it is in cool mode, and when coolsetpoint is raised "too high" it throws an error because the cool setpoint is too low compared to the heat setpoint.

Errors showing code is only updating the heatsetpoint even when in cool mode:

`{'request': {'method': 'POST', 'url': 'https://api.honeywell.com/v2/devices/thermostats/TCC-4559684?apikey=VghRFeH6UDYmmoUEAvA3Jno08mJvGEsx&locationId=2181062', 'headers': {'Authorization': 'Bearer cBFpYekMn1l4AXeA06HNFob1TFgK', 'Content-Type': 'application/json'}, 'json': {'mode': 'Cool', 'heatSetpoint': 72.0, 'coolSetpoint': 68, 'autoChangeoverActive': False}}, 'response': {'code': 400, 'message': 'Cool setpoint can not be lower than heat setpoint plus deadband.'}, 'status': 400}

{'request': {'method': 'POST', 'url': 'https://api.honeywell.com/v2/devices/thermostats/TCC-4559684?apikey=VghRFeH6UDYmmoUEAvA3Jno08mJvGEsx&locationId=2181062', 'headers': {'Authorization': 'Bearer cBFpYekMn1l4AXeA06HNFob1TFgK', 'Content-Type': 'application/json'}, 'json': {'mode': 'Cool', 'heatSetpoint': 75.0, 'coolSetpoint': 68, 'autoChangeoverActive': False}}, 'response': {'code': 400, 'message': 'Cool setpoint can not be lower than heat setpoint plus deadband.'}, 'status': 400}`

My assumption of where the code is mishandling temp setting is in the climate.py file. The set_temperature function odesnt hcnage the cool set point.

Function: async def async_set_temperature

else: temp = kwargs.get(ATTR_TEMPERATURE) _LOGGER.debug("Set temperature: %s", temp) try: await self._update_thermostat(self.location, device, heatSetpoint=temp) except LYRIC_EXCEPTIONS as exception: _LOGGER.error(exception) await self.coordinator.async_refresh()

The set temp only changes heatSetPoint, which means coolsetpoint is never changed, hence the issue and the errors

mazcoder commented 3 years ago

I am seeing this same thing. I change the setpoint on the GUI and get the error below indicating the heat setpoint is changed instead of the coolSetpoint.....

EDIT: Sorry forgot some info regarding my systems... Lyric T5 Home Assistant 2021.4.6

Error: Logger: homeassistant.components.lyric.climate Source: components/lyric/climate.py:263 Integration: Honeywell Lyric (documentation, issues) First occurred: 3:28:22 PM (3 occurrences) Last logged: 3:29:37 PM

{'request': {'method': 'POST', 'url': 'https://api.honeywell.com/v2/devices/thermostats/LCC-00D02DB15F97?apikey=MJXYUi2JoMsTePG7l4LsBQGqJeAo6hlH&locationId=1330400', 'headers': {'Authorization': 'Bearer f8NnEVsqgCxZQaPka73V51Azs0AK', 'Content-Type': 'application/json'}, 'json': {'mode': 'Cool', 'heatSetpoint': 77.0, 'coolSetpoint': 76, 'thermostatSetpointStatus': 'PermanentHold'}}, 'response': {'code': 400, 'message': 'Thermostat already switched to Cool mode.'}, 'status': 400} {'request': {'method': 'POST', 'url': 'https://api.honeywell.com/v2/devices/thermostats/LCC-00D02DB15F97?apikey=MJXYUi2JoMsTePG7l4LsBQGqJeAo6hlH&locationId=1330400', 'headers': {'Authorization': 'Bearer f8NnEVsqgCxZQaPka73V51Azs0AK', 'Content-Type': 'application/json'}, 'json': {'mode': 'Cool', 'heatSetpoint': 72.0, 'coolSetpoint': 76, 'thermostatSetpointStatus': 'PermanentHold'}}, 'response': {'code': 400, 'message': 'Thermostat already switched to Cool mode.'}, 'status': 400} {'request': {'method': 'POST', 'url': 'https://api.honeywell.com/v2/devices/thermostats/LCC-00D02DB15F97?apikey=MJXYUi2JoMsTePG7l4LsBQGqJeAo6hlH&locationId=1330400', 'headers': {'Authorization': 'Bearer f8NnEVsqgCxZQaPka73V51Azs0AK', 'Content-Type': 'application/json'}, 'json': {'mode': 'Cool', 'heatSetpoint': 73.0, 'coolSetpoint': 76, 'thermostatSetpointStatus': 'PermanentHold'}}, 'response': {'code': 400, 'message': 'Thermostat already switched to Cool mode.'}, 'status': 400}

flxkid commented 3 years ago

I'm seeing the same thing with the cool set point not actually changing in the post request, but the response I'm getting from the server is a little different:

2021-05-05 16:19:51 ERROR (MainThread) [homeassistant.components.lyric.climate] {'request': {'method': 'POST', 'url': 'https://api.honeywell.com/v2/devices/thermostats/TCC-2014960?apikey=A0R0yNlVQtvGUDcqwKwv2ALFjgj1EkQS&locationId=77805', 'headers': {'Authorization': 'Bearer ykkBksOGzKrBQjrJf6PM8gDVUWUz', 'Content-Type': 'application/json'}, 'json': {'mode': 'Auto', 'heatSetpoint': 76, 'coolSetpoint': 77, 'autoChangeoverActive': False}}, 'response': {'code': 400, 'message': 'Mode 7 is not allowed. Allowed modes are Cool, Heat, Off.'}, 'status': 400}

timmo001 commented 3 years ago

Spotted and fixed by @yraghu in https://github.com/timmo001/aiolyric/pull/11

I'll be releasing a package update soon and updating the version here.

wtadler commented 3 years ago

Sad to report that this fix, which I believe made it into 2021.6.2, doesn't eliminate the problem. Here is what appears to be happening for me.

If I am in cooling mode, adjusting the temperature appears to be requesting a change to heatSetpoint, not coolSetpoint. If I set the target temperature high, I get the following error:

{'request': {'method': 'POST', 'url': 'https://api.honeywell.com/v2/devices/thermostats/TCC-2728972?apikey=XXXX&locationId=XXXX', 'headers': {'Authorization': 'Bearer XXXX', 'Content-Type': 'application/json'}, 'json': {'mode': 'Cool', 'heatSetpoint': 80.0, 'coolSetpoint': 72, 'autoChangeoverActive': False}}, 'response': {'code': 400, 'message': 'Cool setpoint can not be lower than heat setpoint plus deadband.'}, 'status': 400}

and if I do basically anything else (like switch to heat mode, turn it off, or set the target temperature low) I get the following error:

{'request': {'method': 'POST', 'url': 'https://api.honeywell.com/v2/devices/thermostats/TCC-2728972?apikey=XXXX&locationId=XXXX', 'headers': {'Authorization': 'Bearer XXXX', 'Content-Type': 'application/json'}, 'json': {'mode': 'Cool', 'heatSetpoint': 67.0, 'coolSetpoint': 72, 'autoChangeoverActive': False}}, 'response': {'code': 400, 'message': "'EmergencyHeatActive' is required."}, 'status': 400}

Seems like the two fixes would be to figure out why it is requesting an adjustment to heatSetpoint, and to include a boolean EmergencyHeatActive in the request, right?