jwillemsen / daikin_onecta

Home Assistant Integration for devices supported by the Daikin Onecta App
https://github.com/jwillemsen/daikin_onecta
GNU General Public License v3.0
237 stars 9 forks source link

[Issue]: Error while setting up daikin_onecta platform for select #228

Closed hannes3510 closed 2 months ago

hannes3510 commented 2 months ago
Logger: homeassistant.components.select
Source: helpers/entity_platform.py:366
integration: Select (documentation, issues)
First occurred: 17:18:30 (1 occurrences)
Last logged: 17:18:30

Error while setting up daikin_onecta platform for select
Traceback (most recent call last):
  File "/usr/src/homeassistant/homeassistant/helpers/entity_platform.py", line 366, in _async_setup_platform
    await asyncio.shield(awaitable)
  File "/config/custom_components/daikin_onecta/select.py", line 31, in async_setup_entry
    sensors.append(DaikinScheduleSelect(device, coordinator, embedded_id, management_point_type, "schedule"))
                   ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
  File "/config/custom_components/daikin_onecta/select.py", line 53, in __init__
    self.update_state()
  File "/config/custom_components/daikin_onecta/select.py", line 62, in update_state
    self._attr_options = self.get_options()
                         ^^^^^^^^^^^^^^^^^^
  File "/config/custom_components/daikin_onecta/select.py", line 145, in get_options
    readableName = scheduledict["value"]["modes"][currentMode]["schedules"][scheduleName]["name"]["value"]
                   ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~^^^^^^^^^
KeyError: 'value'
jwillemsen commented 2 months ago

Please in HA download and attach your device diagnostics, looks your device has schedule capabilities which are not as expected

jwillemsen commented 2 months ago

With a device diagnostics this should be easy to fix @hannes3510

hannes3510 commented 2 months ago

daikin_onecta-2814633e5ac074c3672025090e6a8778-Bureau-0fbab57796febe46137fc3714ac96c71.json

hannes3510 commented 2 months ago

Like this?

jwillemsen commented 2 months ago

Yes, thanks

jwillemsen commented 2 months ago

Do you now see the same error, I try to use your json in the test framework, but no error when I use it, are all states of the daikin device the same as when you reported the error?

hannes3510 commented 2 months ago

havent seen this error since yesterday. let me try to restart HA

hannes3510 commented 2 months ago
Logger: homeassistant.components.select
Source: helpers/entity_platform.py:366
integration: Select (documentation, issues)
First occurred: 14:07:57 (1 occurrences)
Last logged: 14:07:57

Error while setting up daikin_onecta platform for select
Traceback (most recent call last):
  File "/usr/src/homeassistant/homeassistant/helpers/entity_platform.py", line 366, in _async_setup_platform
    await asyncio.shield(awaitable)
  File "/config/custom_components/daikin_onecta/select.py", line 31, in async_setup_entry
    sensors.append(DaikinScheduleSelect(device, coordinator, embedded_id, management_point_type, "schedule"))
                   ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
  File "/config/custom_components/daikin_onecta/select.py", line 53, in __init__
    self.update_state()
  File "/config/custom_components/daikin_onecta/select.py", line 62, in update_state
    self._attr_options = self.get_options()
                         ^^^^^^^^^^^^^^^^^^
  File "/config/custom_components/daikin_onecta/select.py", line 145, in get_options
    readableName = scheduledict["value"]["modes"][currentMode]["schedules"][scheduleName]["name"]["value"]
                   ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~^^^^^^^^^
KeyError: 'value'
hannes3510 commented 2 months ago

seems to happen on startup home-assistant_daikin_onecta_2024-06-25T12-11-34.002Z.log

jwillemsen commented 2 months ago

OPk, I think you need to add the integration diagnostics, looks you have multiple Daikin devices and the one you attached doesn't have this issue

hannes3510 commented 2 months ago

i will , first going to reinstall with hacs, i did it manually first time, if it returns i will add the 5 logs (5 devices)

jwillemsen commented 2 months ago

Under /config/integrations/integration/daikin_onecta you should be able to download the diagnostics for the integration, contains the data of all devices

hannes3510 commented 2 months ago

issue remains at startup daikin_onecta-c5e73567ce77bde02f80913fb9119e4a-Master-d5725a472fcc744af90add0e5370f7f1.json daikin_onecta-c5e73567ce77bde02f80913fb9119e4a-Speelkamer-8b78ba62f0f5c46d3c49d7335412506c.json daikin_onecta-c5e73567ce77bde02f80913fb9119e4a-Bureau-0fbab57796febe46137fc3714ac96c71.json daikin_onecta-c5e73567ce77bde02f80913fb9119e4a-Kinderkamer 1-36ec31767a92a7c70d944e280fa698ce.json daikin_onecta-c5e73567ce77bde02f80913fb9119e4a-Kinderkamer 2-7e559aa8b6e28c94074281290d810eab.json

jwillemsen commented 2 months ago

Under the daikin_onecta integration you can download the integration diagnostics which contains the data of all daikin devices, that is easier, but the error coming from the master device

hannes3510 commented 2 months ago

The master is another type of unit, https://www.daikin.com/products/ac/lineup/skyair, connected with a wifi module: WiFi-adapter voor Daikin airconditioning BRP069B42

jwillemsen commented 2 months ago

Should be fixed by https://github.com/jwillemsen/daikin_onecta/releases/tag/v4.1.10

jwillemsen commented 2 months ago

Ok, does it work now?

hannes3510 commented 2 months ago

yes, you got the bug, good job. Thank you for making my airco integration a lot easier.