Skip to content
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

dmaker.fan.p39 not working #226

Open
Syngor opened this issue Jul 25, 2023 · 1 comment
Open

dmaker.fan.p39 not working #226

Syngor opened this issue Jul 25, 2023 · 1 comment

Comments

@Syngor
Copy link

Syngor commented Jul 25, 2023

I added the following code to my configuration.yaml:

fan:
  - platform: xiaomi_miio_fan
    name: My Fan
    host: 192.168.30.5
    token: my-token-here
    model: dmaker.fan.p39

I extracted the token using the token extractor: https://github.com/PiotrMachowski/Xiaomi-cloud-tokens-extractor. This token extractor also tells me it is a dmaker.fan.p39.

But my device remains 'unavailable'. I had to add the model to make it appear, without the model specified, it doesn't appear.

@Syngor Syngor changed the title dmaker.fan.p39 dmaker.fan.p39 not working Jul 25, 2023
@Syngor
Copy link
Author

Syngor commented Jul 27, 2023

The error found in the log is this one:

xiaomi_miio_fan: Error on device update!
Traceback (most recent call last):
File "/usr/src/homeassistant/homeassistant/helpers/entity_platform.py", line 570, in _async_add_entity
await entity.async_device_update(warning=False)
File "/usr/src/homeassistant/homeassistant/helpers/entity.py", line 940, in async_device_update
await self.async_update()
File "/config/custom_components/xiaomi_miio_fan/fan.py", line 2180, in async_update
self._natural_mode = state.mode == OperationModeFanP39.Nature
^^^^^^^^^^
File "/config/custom_components/xiaomi_miio_fan/fan.py", line 2281, in mode
return OperationModeFanP39(self.data["mode"]).name
^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
File "/usr/local/lib/python3.11/enum.py", line 711, in call
return cls.new(cls, value)
^^^^^^^^^^^^^^^^^^^^^^^
File "/usr/local/lib/python3.11/enum.py", line 1128, in new
raise ve_exc
ValueError: None is not a valid OperationModeFanP39

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant