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
69.82k stars 28.94k forks source link

Error while setting up daikin platform for sensor #84923

Closed ruimarinho closed 1 year ago

ruimarinho commented 1 year ago

The problem

Some entities fail to setup on the Daikin platform because I believe my devices do not support power monitoring.

What version of Home Assistant Core has the issue?

2023.1.0.b3

What was the last working version of Home Assistant Core?

2022.11.x

What type of installation are you running?

Home Assistant Container

Integration causing the issue

daikin

Link to integration documentation on our website

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

Anything in the logs that might be useful for us?

home-assistant       | 2022-12-31 15:55:47.332 ERROR (MainThread) [homeassistant.components.sensor] Error while setting up daikin platform for sensor
home-assistant       | Traceback (most recent call last):
home-assistant       |   File "/usr/src/homeassistant/homeassistant/helpers/entity_platform.py", line 297, in _async_setup_platform
home-assistant       |     await asyncio.gather(*pending)
home-assistant       |   File "/usr/src/homeassistant/homeassistant/helpers/entity_platform.py", line 438, in async_add_entities
home-assistant       |     await asyncio.gather(*tasks)
home-assistant       |   File "/usr/src/homeassistant/homeassistant/helpers/entity_platform.py", line 709, in _async_add_entity
home-assistant       |     await entity.add_to_platform_finish()
home-assistant       |   File "/usr/src/homeassistant/homeassistant/helpers/entity.py", line 804, in add_to_platform_finish
home-assistant       |     self.async_write_ha_state()
home-assistant       |   File "/usr/src/homeassistant/homeassistant/helpers/entity.py", line 556, in async_write_ha_state
home-assistant       |     self._async_write_ha_state()
home-assistant       |   File "/usr/src/homeassistant/homeassistant/helpers/entity.py", line 597, in _async_write_ha_state
home-assistant       |     state = self._stringify_state(available)
home-assistant       |   File "/usr/src/homeassistant/homeassistant/helpers/entity.py", line 562, in _stringify_state
home-assistant       |     if (state := self.state) is None:
home-assistant       |   File "/usr/src/homeassistant/homeassistant/components/sensor/__init__.py", line 855, in state
home-assistant       |     value = self.native_value
home-assistant       |   File "/usr/src/homeassistant/homeassistant/components/daikin/sensor.py", line 206, in native_value
home-assistant       |     return self.entity_description.value_func(self._api.device)
home-assistant       |   File "/usr/src/homeassistant/homeassistant/components/daikin/sensor.py", line 120, in <lambda>
home-assistant       |     value_func=lambda device: round(device.today_energy_consumption, 2),
home-assistant       |   File "/usr/local/lib/python3.10/site-packages/pydaikin/daikin_base.py", line 414, in today_energy_consumption
home-assistant       |     return self.today_cool_energy_consumption + self.today_heat_energy_consumption
home-assistant       | TypeError: unsupported operand type(s) for +: 'NoneType' and 'NoneType'
home-assistant[bot] commented 1 year ago

Hey there @fredrike, mind taking a look at this issue as it has been labeled with an integration (daikin) you are listed as a code owner for? Thanks!

Code owner commands Code owners of `daikin` can trigger bot actions by commenting: - `@home-assistant close` Closes the issue. - `@home-assistant rename Awesome new title` Change the title of the issue. - `@home-assistant reopen` Reopen the issue. - `@home-assistant unassign daikin` Removes the current integration label and assignees on the issue, add the integration domain after the command.

(message by CodeOwnersMention)


daikin documentation daikin source (message by IssueLinks)

issue-triage-workflows[bot] commented 1 year ago

There hasn't been any activity on this issue recently. Due to the high number of incoming GitHub notifications, we have to clean some of the old issues, as many of them have already been resolved with the latest updates. Please make sure to update to the latest Home Assistant version and check if that solves the issue. Let us know if that works for you by adding a comment 👍 This issue has now been marked as stale and will be closed if no further activity occurs. Thank you for your contributions.

dffffffff commented 1 year ago

This issue is still present in 2023.4.0

fredrike commented 1 year ago

@home-assistant close