core: Toon is not working again :(

Home Assistant release with the issue: v0.100.3

Last working Home Assistant release (if known): Not sure. Not working for me for the last 2 or 3 versions already

Operating environment (Hass.io/Docker/Windows/etc.): hass.io

Integration: https://www.home-assistant.io/integrations/toon/

Description of problem: The issue is that toon integration stoped working for me since some time (a month or so). Initially i was thinking that this is related to API limit, but the issue didn’t disappear by itself. Today i noticed, that API actually returns something, but looks like library cannot parse response properly? Please see trackback for more info.

Traceback (if applicable):

2019-10-30 09:14:18 ERROR (MainThread) [homeassistant.config_entries] Error setting up entry eneco-001-334514 for toon
Traceback (most recent call last):
  File "/usr/local/lib/python3.7/site-packages/toonapilib/toonapilib.py", line 388, in _get_status_value
    output = self.status[value]
KeyError: 'gasUsage'

During handling of the above exception, another exception occurred:

Traceback (most recent call last):
  File "/usr/src/homeassistant/homeassistant/config_entries.py", line 190, in async_setup
    hass, self
  File "/usr/src/homeassistant/homeassistant/components/toon/__init__.py", line 83, in async_setup_entry
    toon_data = ToonData(hass, entry, toon)
  File "/usr/src/homeassistant/homeassistant/components/toon/__init__.py", line 125, in __init__
    self.gas = toon.gas
  File "/usr/local/lib/python3.7/site-packages/toonapilib/toonapilib.py", line 396, in gas
    usage = self._get_status_value('gasUsage')
  File "/usr/local/lib/python3.7/site-packages/toonapilib/toonapilib.py", line 390, in _get_status_value
    raise IncompleteStatus(self.status)
toonapilib.toonapilibexceptions.IncompleteStatus: {'thermostatStates': {'state': [{'id': 0, 'tempValue': 1650, 'dhw': 1}, {'id': 1, 'tempValue': 1650, 'dhw': 1}, {'id': 2, 'tempValue': 1600, 'dhw': 1}, {'id': 3, 'tempValue': 1200, 'dhw': 1}, {'id': 4, 'tempValue': 1300, 'dhw': 1}], 'lastUpdatedFromDisplay': 1572423258008}, 'thermostatInfo': {'currentSetpoint': 1200, 'currentHumidity': None, 'currentDisplayTemp': 1800, 'programState': 1, 'activeState': 3, 'nextProgram': 1, 'nextState': 0, 'nextTime': 1572454800, 'nextSetpoint': 1650, 'hasBoilerFault': 0, 'errorFound': 255, 'boilerModuleConnected': 1, 'realSetpoint': 1200, 'burnerInfo': '0', 'otCommError': '0', 'currentModulationLevel': 0, 'haveOTBoiler': 0, 'lastUpdatedFromDisplay': 1572423257761}, 'deviceConfigInfo': {'device': [{'devUUID': '4f788930-7ce8-4d47-9bd9-123faf6297b2', 'devType': 'NAS_WR01Z', 'name': 'NAS_WR01Z-1', 'flowGraphUuid': 'bef66d8c-78a8-4106-9c7e-3af9e144bfb4', 'quantityGraphUuid': '7ec115dd-669a-4ea8-b6fb-5d9a137226c4', 'position': 0, 'inSwitchAll': 1, 'inSwitchSchedule': 0, 'switchLocked': 0, 'usageCapable': 1, 'currentState': None, 'rgbColor': None, 'zwuuid': 'e82cdd72-a995-459f-a62e-ff9c66b0e35a'}], 'lastUpdatedFromDisplay': 1572423257228}, 'deviceStatusInfo': {'device': [{'devUUID': '4f788930-7ce8-4d47-9bd9-123faf6297b2', 'name': 'NAS_WR01Z-1', 'currentUsage': 0.0, 'dayUsage': 0.0, 'avgUsage': 0.0, 'currentState': 0, 'isConnected': 0, 'networkHealthState': 1, 'rgbColor': None}], 'inSwitchAllTotal': {'currentState': 0, 'currentUsage': 0.0, 'dayUsage': 0.0, 'avgUsage': 0.0}, 'lastUpdatedFromDisplay': 1572423257503}, 'powerUsage': {'value': 802, 'dayCost': 0.43, 'valueProduced': 0, 'dayCostProduced': None, 'valueSolar': 0, 'maxSolar': 0, 'dayCostSolar': None, 'avgSolarValue': None, 'avgValue': 404.46, 'avgDayValue': 9707.14, 'avgProduValue': 0, 'avgDayProduValue': None, 'meterReading': 1013875, 'meterReadingLow': 1375276, 'meterReadingProdu': 0, 'meterReadingLowProdu': 0, 'dayUsage': 1866, 'dayLowUsage': 2730, 'todayLowestUsage': None, 'isSmart': 1, 'lowestDayValue': 182, 'solarProducedToday': 0, 'lastUpdatedFromDisplay': 1572423258204}, 'lastUpdateFromDisplay': 1572423258206, 'serverTime': 1572423258338}

Additional information: Taking into account my limited knowledge of Python i can conclude that response doesn’t contain gasUsage key in response status dictionary (and indeed it doesn’t). Did toon API change?

About this issue

  • Original URL
  • State: closed
  • Created 5 years ago
  • Comments: 29 (6 by maintainers)

Most upvoted comments

I’ve been making progress, most functionality is now in, fully async, with OAuth2 handling.

Same issue here, there is no way i can get Toon to work in Homeassistant, on configuration (after adding to configuration.yaml) it shows my credentials are incorrect (which are not). The toon app does function, and shows data.

It this a generic issue? Or is it something in my setup, i also have ‘stadsverwarming’ i’m willing to help out for improvements on that part (if needed).

Indeed, it works. However, i don’t see “Current Gas” anymore. It is always at 0. Screenshot 2019-11-18 at 12 32 28

As of yesterday, the issue started appearing in my own setup as well. Are they rolling out changes in phases or something? Seems like the gas usage has been removed from the API?

I might need to take this up with the author of the ToonAPILib, that powers this integration.