syssi / xiaomi_airpurifier

Xiaomi Mi Air Purifier and Xiaomi Mi Air Humidifier integration for Home Assistant
Apache License 2.0
450 stars 110 forks source link

Roadmap: UI config and devices with multiples entities #138

Open Kirmas opened 3 years ago

Kirmas commented 3 years ago

This is more questions than Issue.

As I understand current vision of the deviсes in home assistant is a deviсe object with multiply entity(switches, sensors, fans, etc.). But in current component, as I understand, deviсe implemented as fans entity with addition values, without any sensors.

To more understanding about what I say pictures from yeelight integration: image

I think about changing this. As I understand for this I must:

Amount off how many device this integration support I think its big amount of job. And I will spend a lot of time to implementation and bug fixing.

What do you think about this? Maybe its a bad idea, why? Maybe you already have a plans about this?

Best regard.

syssi commented 3 years ago

This is the way to go! This (custom) component was born at a time there didn't exist devices in Home Assistant. The architecture of Home Assistant has changed and evolved. This is the roadmap which should be tacked (but my time is the limiting factor here at moment):

  1. Provide a platform called xiaomi_miio or xiaomi_miio at the lowest level of the configuration.yaml (xiaomi_miio/__init__.py).
  2. Refactor the speed property. Only official supportes values are allowed here to be alexa/google home compatible. We have to move the speed / operation mode of the xiaomi device to a new service.
  3. Use this platform to configure all supported devices. Expose devices and spawn multiple entities (fan, sensor, climate etc) as needed. Don't provide sensor values as attributes anymore.
  4. Dispatch state updates received by __init__.py to all related entities (sensors, switches, etc.).
  5. Implement a config_flow to setup the platform via the UI. Tests are required.

Do you like to join? ;-)

Kirmas commented 3 years ago

You 100% true about time factor. All of us have main job, and family.

Maybe you have better place for communicate about this project than issue. Im very new with home assistant thats why, I can ask some question, but not a lot, I don't trying to find mentor (Home Assistant development docs sometimes don't enough) :).

I haven't understand clearly what "lowest level of the configuration.yaml" means.

But I have some devices that this component support, and I want to help improve integration.

If you OK with this. What can I help with first?

spacecakes commented 2 years ago

This would be great. I didn't manage to get the official Miio integration working (seems broken at the moment, judging from the people replying to issues) and found this one. Still works!

Are there still plans to make this a device platform or merge it with the official integration?