8000 Sensibo component broken if AC without target temperature is present · Issue #10767 · home-assistant/core · GitHub
[go: up one dir, main page]
More Web Proxy on the site http://driver.im/
Skip to content

Sensibo component broken if AC without target temperature is present #10767

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Closed
ohadbenita opened this issue Nov 23, 2017 · 10 comments · Fixed by #10801
Closed

Sensibo component broken if AC without target temperature is present #10767

ohadbenita opened this issue Nov 23, 2017 · 10 comments · Fixed by #10801

Comments

@ohadbenita
Copy link
ohadbenita commented Nov 23, 2017

Home Assistant release (hass --version):0.58
Python release (python3 --version):3.6
Component/platform:Sensibo
Description of problem:Error in HA log following restart, platform isn't loaded
Expected: Platform loaded successfully
Problem-relevant configuration.yaml entries and steps to reproduce:

climate:
  - platform: sensibo
    api_key: !secret sensibo_api_key

Traceback (if applicable):

2017-11-23 20:59:53 ERROR (MainThread) [homeassistant.components.climate] Error while setting up platform sensibo
Traceback (most recent call last):
  File "/srv/homeassistant/lib/python3.5/site-packages/homeassistant/helpers/entity_component.py", line 171, in _async_setup_platform
    SLOW_SETUP_MAX_WAIT, loop=self.hass.loop)
  File "/usr/lib/python3.5/asyncio/tasks.py", line 400, in wait_for
    return fut.result()
  File "/usr/lib/python3.5/asyncio/futures.py", line 293, in result
    raise self._exception
  File "/usr/lib/python3.5/asyncio/tasks.py", line 239, in _step
    result = coro.send(None)
  File "/srv/homeassistant/lib/python3.5/site-packages/homeassistant/components/climate/sensibo.py", line 55, in async_setup_platform
    devices.append(SensiboClimate(client, dev))
  File "/srv/homeassistant/lib/python3.5/site-packages/homeassistant/components/climate/sensibo.py", line 76, in __init__
    self._do_update(data)
  File "/srv/homeassistant/lib/python3.5/site-packages/homeassistant/components/climate/sensibo.py", line 87, in _do_update
    temperature_unit_key = self._ac_states['temperatureUnit']
KeyError: 'temperatureUnit'

Additional info:

@tinloaf
Copy link
Contributor
tinloaf commented Nov 24, 2017

That is weird and shouldn't happen. That code wasn't touched, and the library wasn't updated. @andrey-git ?

@andrey-git
Copy link
Contributor

@ohadbenita did the same unit worked before 0.57?

Could you post the result of
curl "https://home.sensibo.com/api/v2/pods/POD_ID?apiKey=API_KEY&fields=*"
Don't forget the quotes. Remove any sensitive info.

@ohadbenita
Copy link
Author
ohadbenita commented Nov 25, 2017

I did it from my Windows browser and the result:

{"status": "success", "result": {"configGroup": "stable", "macAddress": "MY_MAC_ADDRESS", "cleanFiltersNotificationEnabled": true, "measurements": {"batteryVoltage": null, "temperature": 20.9, "humidity": 43.5, "time": {"secondsAgo": 32, "time": "2017-11-25T06:15:56.993000Z"}, "rssi": -34, "piezo": [null, null]}, "firmwareType": "cc3100_stm32f0", "productModel": "skyv2", "currentlyAvailableFirmwareVersion": "IN010050", "temperatureUnit": "C", "isGeofenceOnExitEnabled": false, "connectionStatus": {"isAlive": true, "lastSeen": {"secondsAgo": 32, "time": "2017-11-25T06:15:56.993000Z"}}, "acState": {"on": true, "fanLevel": "auto", "temperatureUnit": "C", "targetTemperature": 23, "mode": "heat", "swing": "stopped"}, "smartMode": null, "shouldShowFilterCleaningNotification": false, "location": {"latLon": [0, 0], "updateTime": null, "country": "X", "createTime": {"secondsAgo": 10099806, "time": "2017-07-31T08:46:23Z"}, "address": ["MY_STREET", "MY_CITY"], "id": "My_ID"}, "remoteCapabilities": {"modes": {"dry": {"swing": ["stopped", "fixedTop", "fixedMiddleTop", "fixedMiddle", "fixedMiddleBottom", "fixedBottom", "rangeTop", "rangeMiddle", "rangeBottom", "rangeFull"], "temperatures": {"C": {"isNative": true, "values": [16, 17, 18, 19, 20, 21, 22, 23, 24, 25, 26, 27, 28, 29, 30]}, "F": {"isNative": false, "values": [61, 63, 64, 66, 68, 70, 72, 73, 75, 77, 79, 81, 82, 84, 86]}}, "fanLevels": ["low"]}, "auto": {"swing": ["stopped", "fixedTop", "fixedMiddleTop", "fixedMiddle", "fixedMiddleBottom", "fixedBottom", "rangeTop", "rangeMiddle", "rangeBottom", "rangeFull"], "temperatures": {}, "fanLevels": ["low", "medium", "high", "auto", "strong"]}, "heat": {"swing": ["stopped", "fixedTop", "fixedMiddleTop", "fixedMiddle", "fixedMiddleBottom", "fixedBottom", "rangeTop", "rangeMiddle", "rangeBottom", "rangeFull"], "temperatures": {"C": {"isNative": true, "values": [16, 17, 18, 19, 20, 21, 22, 23, 24, 25, 26, 27, 28, 29, 30]}, "F": {"isNative": false, "values": [61, 63, 64, 66, 68, 70, 72, 73, 75, 77, 79, 81, 82, 84, 86]}}, "fanLevels": ["low", "medium", "high", "auto", "strong"]}, "fan": {"swing": ["stopped", "fixedTop", "fixedMiddleTop", "fixedMiddle", "fixedMiddleBottom", "fixedBottom", "rangeTop", "rangeMiddle", "rangeBottom", "rangeFull"], "temperatures": {"C": {"isNative": true, "values": [16, 17, 18, 19, 20, 21, 22, 23, 24, 25, 26, 27, 28, 29, 30]}, "F": {"isNative": false, "values": [61, 63, 64, 66, 68, 70, 72, 73, 75, 77, 79, 81, 82, 84, 86]}}, "fanLevels": ["low", "medium", "high", "auto", "strong"]}, "cool": {"swing": ["stopped", "fixedTop", "fixedMiddleTop", "fixedMiddle", "fixedMiddleBottom", "fixedBottom", "rangeTop", "rangeMiddle", "rangeBottom", "rangeFull"], "temperatures": {"C": {"isNative": true, "values": [16, 17, 18, 19, 20, 21, 22, 23, 24, 25, 26, 27, 28, 29, 30]}, "F": {"isNative": false, "values": [61, 63, 64, 66, 68, 70, 72, 73, 75, 77, 79, 81, 82, 84, 86]}}, "fanLevels": ["low", "medium", "high", "auto", "strong"]}}}, "id": "MY_POD_ID", "firmwareVersion": "IN010050", "room": {"name": "Living Room AC", "icon": "Livingroom"}}}

However, when I run curl from the RPI where the HA is running I get :

$ {"status": "success", "result": {"id": "POD_ID"}}

@ohadbenita
Copy link
Author
ohadbenita commented Nov 25, 2017

Doing another attempt following reboot :

{"status": "success", "result": {"configGroup": "stable", "macAddress": "MAC_ADDRESS", "cleanFiltersNotificationEnabled": true, "measurements": {"batteryVoltage": null, "temperature": 20.0, "humidity": 41.9, "time": {"secondsAgo": 2, "time": "2017-11-25T10:57:13.759000Z"}, "rssi": -37, "piezo": [null, null]}, "firmwareType": "cc3100_stm32f0", "productModel": "skyv2", "currentlyAvailableFirmwareVersion": "IN010050", "temperatureUnit": "C", "isGeofenceOnExitEnabled": false, "connectionStatus": {"isAlive": true, "lastSeen": {"secondsAgo": 2, "time": "2017-11-25T10:57:13.759000Z"}}, "acState": {"on": false, "fanLevel": "auto", "temperatureUnit": "C", "targetTemperature": 23, "mode": "heat", "swing": "stopped"}, "smartMode": null, "shouldShowFilterCleaningNotification": false, "location": {"latLon": [0,0], "updateTime": null, "country": "X", "createTime": {"secondsAgo": 10116653, "time": "2017-07-31T08:46:23Z"}, "address": ["MY_ADDRESS", "MY_ADDRESS"], "id": "rTdSSLf6BS"}, "remoteCapabilities": {"modes": {"dry": {"swing": ["stopped", "fixedTop", "fixedMiddleTop", "fixedMiddle", "fixedMiddleBottom", "fixedBottom", "rangeTop", "rangeMiddle", "rangeBottom", "rangeFull"], "temperatures": {"C": {"isNative": true, "values": [16, 17, 18, 19, 20, 21, 22, 23, 24, 25, 26, 27, 28, 29, 30]}, "F": {"isNative": false, "values": [61, 63, 64, 66, 68, 70, 72, 73, 75, 77, 79, 81, 82, 84, 86]}}, "fanLevels": ["low"]}, "auto": {"swing": ["stopped", "fixedTop", "fixedMiddleTop", "fixedMiddle", "fixedMiddleBottom", "fixedBottom", "rangeTop", "rangeMiddle", "rangeBottom", "rangeFull"], "temperatures": {}, "fanLevels": ["low", "medium", "high", "auto", "strong"]}, "heat": {"swing": ["stopped", "fixedTop", "fixedMiddleTop", "fixedMiddle", "fixedMiddleBottom", "fixedBottom", "rangeTop", "rangeMiddle", "rangeBottom", "rangeFull"], "temperatures": {"C": {"isNative": true, "values": [16, 17, 18, 19, 20, 21, 22, 23, 24, 25, 26, 27, 28, 29, 30]}, "F": {"isNative": false, "values": [61, 63, 64, 66, 68, 70, 72, 73, 75, 77, 79, 81, 82, 84, 86]}}, "fanLevels": ["low", "medium", "high", "auto", "strong"]}, "fan": {"swing": ["stopped", "fixedTop", "fixedMiddleTop", "fixedMiddle", "fixedMiddleBottom", "fixedBottom", "rangeTop", "rangeMiddle", "rangeBottom", "rangeFull"], "temperatures": {"C": {"isNative": true, "values": [16, 17, 18, 19, 20, 21, 22, 23, 24, 25, 26, 27, 28, 29, 30]}, "F": {"isNative": false, "values": [61, 63, 64, 66, 68, 70, 72, 73, 75, 77, 79, 81, 82, 84, 86]}}, "fanLevels": ["low", "medium", "high", "auto", "strong"]}, "cool": {"swing": ["stopped", "fixedTop", "fixedMiddleTop", "fixedMiddle", "fixedMiddleBottom", "fixedBottom", "rangeTop", "rangeMiddle", "rangeBottom", "rangeFull"], "temperatures": {"C": {"isNative": true, "values": [16, 17, 18, 19, 20, 21, 22, 23, 24, 25, 26, 27, 28, 29, 30]}, "F": {"isNative": false, "values": [61, 63, 64, 66, 68, 70, 72, 73, 75, 77, 79, 81, 82, 84, 86]}}, "fanLevels": ["low", "medium", "high", "auto", "strong"]}}}, "id": "ID", "firmwareVersion": "IN010050", "room": {"name": "Living Room AC", "icon": "Livingroom"}}

And still the issue persists

@andrey-git
Copy link
Contributor

Try
curl "https://home.sensibo.com/api/v2/users/me/pods?apiKey=API_KEY&fields=id,room{name},measurements,remoteCapabilities,acState,connectionStatus{isAlive}"

@ohadbenita
Copy link
Author

{"status": "success", "result": [{"acState": {"on": false, "fanLevel": "auto", "temperatureUnit": "C", "targetTemperature": 23, "mode": "heat", "swing": "stopped"}, "remoteCapabilities": {"modes": {"dry": {"swing": ["stopped", "fixedTop", "fixedMiddleTop", "fixedMiddle", "fixedMiddleBottom", "fixedBottom", "rangeTop", "rangeMiddle", "rangeBottom", "rangeFull"], "temperatures": {"C": {"isNative": true, "values": [16, 17, 18, 19, 20, 21, 22, 23, 24, 25, 26, 27, 28, 29, 30]}, "F": {"isNative": false, "values": [61, 63, 64, 66, 68, 70, 72, 73, 75, 77, 79, 81, 82, 84, 86]}}, "fanLevels": ["low"]}, "auto": {"swing": ["stopped", "fixedTop", "fixedMiddleTop", "fixedMiddle", "fixedMiddleBottom", "fixedBottom", "rangeTop", "rangeMiddle", "rangeBottom", "rangeFull"], "temperatures": {}, "fanLevels": ["low", "medium", "high", "auto", "strong"]}, "heat": {"swing": ["stopped", "fixedTop", "fixedMiddleTop", "fixedMiddle", "fixedMiddleBottom", "fixedBottom", "rangeTop", "rangeMiddle", "rangeBottom", "rangeFull"], "temperatures": {"C": {"isNative": true, "values": [16, 17, 18, 19, 20, 21, 22, 23, 24, 25, 26, 27, 28, 29, 30]}, "F": {"isNative": false, "values": [61, 63, 64, 66, 68, 70, 72, 73, 75, 77, 79, 81, 82, 84, 86]}}, "fanLevels": ["low", "medium", "high", "auto", "strong"]}, "fan": {"swing": ["stopped", "fixedTop", "fixedMiddleTop", "fixedMiddle", "fixedMiddleBottom", "fixedBottom", "rangeTop", "rangeMiddle", "rangeBottom", "rangeFull"], "temperatures": {"C": {"isNative": true, "values": [16, 17, 18, 19, 20, 21, 22, 23, 24, 25, 26, 27, 28, 29, 30]}, "F": {"isNative": false, "values": [61, 63, 64, 66, 68, 70, 72, 73, 75, 77, 79, 81, 82, 84, 86]}}, "fanLevels": ["low", "medium", "high", "auto", "strong"]}, "cool": {"swing": ["stopped", "fixedTop", "fixedMiddleTop", "fixedMiddle", "fixedMiddleBottom", "fixedBottom", "rangeTop", "rangeMiddle", "rangeBottom", "rangeFull"], "temperatures": {"C": {"isNative": true, "values": [16, 17, 18, 19, 20, 21, 22, 23, 24, 25, 26, 27, 28, 29, 30]}, "F": {"isNative": false, "values": [61, 63, 64, 66, 68, 70, 72, 73, 75, 77, 79, 81, 82, 84, 86]}}, "fanLevels": ["low", "medium", "high", "auto", "strong"]}}}, "measurements": {"batteryVoltage": null, "temperature": 20.0, "humidity": 42.2, "time": {"secondsAgo": 16, "time": "2017-11-25T19:22:55.425000Z"}, "rssi": -38, "piezo": [null, null]}, "id": "MY_ID"}, {"acState": {"on": false, "swing": "stopped", "mode": "auto", "fanLevel": "auto"}, "remoteCapabilities": {"modes": {"dry": {"swing": ["stopped", "fixedTop", "fixedMiddleTop", "fixedMiddle", "fixedMiddleBottom", "fixedBottom", "rangeTop", "rangeMiddle", "rangeBottom", "rangeFull"], "temperatures": {"C": {"isNative": true, "values": [16, 17, 18, 19, 20, 21, 22, 23, 24, 25, 26, 27, 28, 29, 30]}, "F": {"isNative": false, "values": [61, 63, 64, 66, 68, 70, 72, 73, 75, 77, 79, 81, 82, 84, 86]}}, "fanLevels": ["low"]}, "auto": {"swing": ["stopped", "fixedTop", "fixedMiddleTop", "fixedMiddle", "fixedMiddleBottom", "fixedBottom", "rangeTop", "rangeMiddle", "rangeBottom", "rangeFull"], "temperatures": {}, "fanLevels": ["low", "medium", "high", "auto", "strong"]}, "heat": {"swing": ["stopped", "fixedTop", "fixedMiddleTop", "fixedMiddle", "fixedMiddleBottom", "fixedBottom", "rangeTop", "rangeMiddle", "rangeBottom", "rangeFull"], "temperatures": {"C": {"isNative": true, "values": [16, 17, 18, 19, 20, 21, 22, 23, 24, 25, 26, 27, 28, 29, 30]}, "F": {"isNative": false, "values": [61, 63, 64, 66, 68, 70, 72, 73, 75, 77, 79, 81, 82, 84, 86]}}, "fanLevels": ["low", "medium", "high", "auto", "strong"]}, "fan": {"swing": ["stopped", "fixedTop", "fixedMiddleTop", "fixedMiddle", "fixedMiddleBottom", "fixedBottom", "rangeTop", "rangeMiddle", "rangeBottom", "rangeFull"], "temperatures": {"C": {"isNative": true, "values": [16, 17, 18, 19, 20, 21, 22, 23, 24, 25, 26, 27, 28, 29, 30]}, "F": {"isNative": false, "values": [61, 63, 64, 66, 68, 70, 72, 73, 75, 77, 79, 81, 82, 84, 86]}}, "fanLevels": ["low", "medium", "high", "auto", "strong"]}, "cool": {"swing": ["stopped", "fixedTop", "fixedMiddleTop", "fixedMiddle", "fixedMiddleBottom", "fixedBottom", "rangeTop", "rangeMiddle", "rangeBottom", "rangeFull"], "temperatures": {"C": {"isNative": true, "values": [16, 17, 18, 19, 20, 21, 22, 23, 24, 25, 26, 27, 28, 29, 30]}, "F": {"isNative": false, "values": [61, 63, 64, 66, 68, 70, 72, 73, 75, 77, 79, 81, 82, 84, 86]}}, "fanLevels": ["low", "medium", "high", "auto", "strong"]}}}, "measurements": {"batteryVoltage": null, "temperature": 18.3, "humidity": 53.7, "time": {"secondsAgo": 79, "time": "2017-11-25T19:21:52.965000Z"}, "rssi": -66, "piezo": [null, null]}, "id": "MY_ID_2"}, {"acState": {"on": false, "fanLevel": "low", "temperatureUnit": "C", "targetTemperature": 23, "mode": "heat", "swing": "stopped"}, "remoteCapabilities": {"modes": {"dry": {"swing": ["stopped", "fixedTop", "fixedMiddleTop", "fixedMiddle", "fixedMiddleBottom", "fixedBottom", "rangeTop", "rangeMiddle", "rangeBottom", "rangeFull"], "temperatures": {"C": {"isNative": true, "values": [16, 17, 18, 19, 20, 21, 22, 23, 24, 25, 26, 27, 28, 29, 30]}, "F": {"isNative": false, "values": [61, 63, 64, 66, 68, 70, 72, 73, 75, 77, 79, 81, 82, 84, 86]}}, "fanLevels": ["low"]}, "auto": {"swing": ["stopped", "fixedTop", "fixedMiddleTop", "fixedMiddle", "fixedMiddleBottom", "fixedBottom", "rangeTop", "rangeMiddle", "rangeBottom", "rangeFull"], "temperatures": {}, "fanLevels": ["low", "medium", "high", "auto", "strong"]}, "heat": {"swing": ["stopped", "fixedTop", "fixedMiddleTop", "fixedMiddle", "fixedMiddleBottom", "fixedBottom", "rangeTop", "rangeMiddle", "rangeBottom", "rangeFull"], "temperatures": {"C": {"isNative": true, "values": [16, 17, 18, 19, 20, 21, 22, 23, 24, 25, 26, 27, 28, 29, 30]}, "F": {"isNative": false, "values": [61, 63, 64, 66, 68, 70, 72, 73, 75, 77, 79, 81, 82, 84, 86]}}, "fanLevels": ["low", "medium", "high", "auto", "strong"]}, "fan": {"swing": ["stopped", "fixedTop", "fixedMiddleTop", "fixedMiddle", "fixedMiddleBottom", "fixedBottom", "rangeTop", "rangeMiddle", "rangeBottom", "rangeFull"], "temperatures": {"C": {"isNative": true, "values": [16, 17, 18, 19, 20, 21, 22, 23, 24, 25, 26, 27, 28, 29, 30]}, "F": {"isNative": false, "values": [61, 63, 64, 66, 68, 70, 72, 73, 75, 77, 79, 81, 82, 84, 86]}}, "fanLevels": ["low", "medium", "high", "auto", "strong"]}, "cool": {"swing": ["stopped", "fixedTop", "fixedMiddleTop", "fixedMiddle", "fixedMiddleBottom", "fixedBottom", "rangeTop", "rangeMiddle", "rangeBottom", "rangeFull"], "temperatures": {"C": {"isNative": true, "values": [16, 17, 18, 19, 20, 21, 22, 23, 24, 25, 26, 27, 28, 29, 30]}, "F": {"isNative": false, "values": [61, 63, 64, 66, 68, 70, 72, 73, 75, 77, 79, 81, 82, 84, 86]}}, "fanLevels": ["low", "medium", "high", "auto", "strong"]}}}, "measurements": {"batteryVoltage": null, "temperature": 18.6, "humidity": 47.8, "time": {"secondsAgo": 85, "time": "2017-11-25T19:21:46.508000Z"}, "rssi": -51, "piezo": [null, null]}, "id": "MY_ID_3"}]}

@andrey-git
Copy link
Contributor

OK, so I see that for all 3 your A/C units in "auto" mode the "temperatures" is empty in capabilities.

For the 2nd unit the temperature is also missing from acState. What kind of AC is that? This seems like a bug in Sensibo API to me.

@omere2
Copy link
omere2 commented Nov 26, 2017

So, auto mode on this AC doesn't display temperature, so it doesn't exist.
However, we have added to the API temperatureUnit outside of the specific acState which always exists. So the integration can be fixed by taking temperature unit from the device itself:
try https://home.sensibo.com/api/v2/pods/POD_UID?fields=temperatureUnit

@andrey-git
Copy link
Contributor

Thanks, I added it to #10801

@andrey-git andrey-git changed the title Sensibo component broken in 0.58 Sensibo component broken if AC without target temperature is present Nov 27, 2017
@andrey-git
Copy link
Contributor

I edited the issue title to indicate the rootcause

@home-assistant home-assistant locked and limited conversation to collaborators Mar 2, 2018
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
None yet
Projects
None yet
Development

Successfully merging a pull request may close this issue.

4 participants
0