shenxn / ha-dyson

HomeAssitant custom integration for dyson
MIT License
307 stars 59 forks source link

Cannot import name 'DysonPurifierHumidifyCoolFormaldehyde' from 'libdyson' #171

Open erd82 opened 1 year ago

erd82 commented 1 year ago

As mentioned in a former post, my dyson integration sometimes appears as "not loaded" and then the dyson fan cannot be controlled anymore in HA. image

These logs for dyson_cloud are showing these error messages:

2022-12-01 11:19:54.439 WARNING (SyncWorker_0) [homeassistant.loader] We found a custom integration dyson_cloud which has not been tested by Home Assistant. This component might cause stability problems, be sure to disable it if you experience issues with Home Assistant
2022-12-01 11:20:09.905 INFO (MainThread) [homeassistant.bootstrap] Setting up stage 2: {'ibeacon', 'onboarding', 'repairs', 'energy', 'ipp', 'diagnostics', 'application_credentials', 'remote', 'nuki_ng', 'dyson_cloud', 'fully_kiosk', 'speedtestdotnet', 'accuweather', 'radio_browser', 'rpi_power', 'search', 'mqtt', 'tradfri', 'mjpeg', 'xiaomi_miio', 'system_health', 'upnp', 'person', 'auth', 'group', 'esphome', 'philips_js', 'fritzbox_callmonitor', 'homeassistant_alerts', 'config', 'stihl_imow', 'switch_as_x', 'input_datetime', 'analytics', 'default_config', 'influxdb', 'heos', 'my', 'shell_command', 'mobile_app', 'octoprint', 'hacs', 'automation', 'hue', 'met', 'input_button', 'sensor', 'map', 'history', 'intent_script', 'device_tracker', 'skodaconnect', 'bosch_shc', 'zwave_js', 'denonavr', 'hardware', 'deconz', 'input_select', 'media_source', 'input_text', 'logbook', 'camera', 'dyson_local', 'counter', 'input_number', 'synology_dsm', 'input_boolean', 'schedule', 'script', 'raspberry_pi', 'discovery', 'elgato', 'image', 'timer', 'switch', 'binary_sensor', 'utility_meter', 'fritz', 'lovelace', 'scene', 'sonos', 'device_automation', 'fritzbox', 'cast', 'harmony', 'tag', 'tts', 'file_upload', 'intent', 'python_script', 'dlna_dmr', 'zone', 'blueprint', 'persistent_notification', 'home_connect', 'sun', 'trace'}
2022-12-01 11:20:38.442 ERROR (MainThread) [homeassistant.setup] Setup failed for custom integration dyson_cloud: Unable to import component: cannot import name 'DysonPurifierHumidifyCoolFormaldehyde' from 'libdyson' (/usr/local/lib/python3.10/site-packages/libdyson/__init__.py)

The same appears sfor dyson_local:

2022-12-01 11:19:54.444 WARNING (SyncWorker_0) [homeassistant.loader] We found a custom integration dyson_local which has not been tested by Home Assistant. This component might cause stability problems, be sure to disable it if you experience issues with Home Assistant
2022-12-01 11:20:09.905 INFO (MainThread) [homeassistant.bootstrap] Setting up stage 2: {'ibeacon', 'onboarding', 'repairs', 'energy', 'ipp', 'diagnostics', 'application_credentials', 'remote', 'nuki_ng', 'dyson_cloud', 'fully_kiosk', 'speedtestdotnet', 'accuweather', 'radio_browser', 'rpi_power', 'search', 'mqtt', 'tradfri', 'mjpeg', 'xiaomi_miio', 'system_health', 'upnp', 'person', 'auth', 'group', 'esphome', 'philips_js', 'fritzbox_callmonitor', 'homeassistant_alerts', 'config', 'stihl_imow', 'switch_as_x', 'input_datetime', 'analytics', 'default_config', 'influxdb', 'heos', 'my', 'shell_command', 'mobile_app', 'octoprint', 'hacs', 'automation', 'hue', 'met', 'input_button', 'sensor', 'map', 'history', 'intent_script', 'device_tracker', 'skodaconnect', 'bosch_shc', 'zwave_js', 'denonavr', 'hardware', 'deconz', 'input_select', 'media_source', 'input_text', 'logbook', 'camera', 'dyson_local', 'counter', 'input_number', 'synology_dsm', 'input_boolean', 'schedule', 'script', 'raspberry_pi', 'discovery', 'elgato', 'image', 'timer', 'switch', 'binary_sensor', 'utility_meter', 'fritz', 'lovelace', 'scene', 'sonos', 'device_automation', 'fritzbox', 'cast', 'harmony', 'tag', 'tts', 'file_upload', 'intent', 'python_script', 'dlna_dmr', 'zone', 'blueprint', 'persistent_notification', 'home_connect', 'sun', 'trace'}
2022-12-01 11:22:32.721 ERROR (MainThread) [homeassistant.setup] Setup failed for custom integration dyson_local: Unable to import component: cannot import name 'DysonPurifierHumidifyCoolFormaldehyde' from 'libdyson' (/usr/local/lib/python3.10/site-packages/libdyson/__init__.py)

How to get rid of this problem?

danvy commented 1 year ago

I've got the exact same error

Ulrar commented 1 year ago

That's intermittent? It looks like it may be loading an outdated version of libdyson for some reason. Have you tried deleting it and re-adding it ?

erd82 commented 1 year ago

That's intermittent? It looks like it may be loading an outdated version of libdyson for some reason. Have you tried deleting it and re-adding it ?

yes, many times

micahqcade commented 1 year ago

I have the same issue. I have dyson cloud and dyson local both loaded and use my cloud credentials to use dyson local.

Here is the exact error I get Logger: homeassistant.setup Source: setup.py:210 First occurred: 10:40:32 PM (1 occurrences) Last logged: 10:40:32 PM

Setup failed for custom integration dyson_cloud: Unable to import component: cannot import name 'DysonPurifierHumidifyCoolFormaldehyde' from 'libdyson' (/usr/local/lib/python3.10/site-packages/libdyson/init.py)

niemtec commented 1 year ago

I've seen the same issue on my installation (done about an hour ago)

Ulrar commented 1 year ago

Can you check which version of libdyson is installed ? Looks like you'd find it here : /usr/local/lib/python3.10/site-packages/

In my case I have libdyson-0.8.11 in there

micahqcade commented 1 year ago

It was 8.11, I removed the integration from HACS, both local and cloud, reloaded it and it now works. I think this is an intermittent problem, somehow the library either doesn't load at runtime or gets lost. To add, the initial installation worked, then somehow broke, and after I deleted and reloaded everything a few times, worked properly.

erd82 commented 1 year ago

I found a solution for me now: https://github.com/shenxn/ha-dyson/issues/178. Maybe it also helps others.

dotvezz commented 1 year ago

Unfortunately this integration is no longer maintained, but I've created a new fork and am actively working on the new Formaldehyde models. Have a look at #185 for more information, and let me know if you have any questions.