artem-sedykh / mini-humidifier

Minimalistic humidifier card for Home Assistant Lovelace UI
MIT License
156 stars 26 forks source link

Purifier #27

Closed abcjoint closed 4 years ago

abcjoint commented 4 years ago

Is it possible to add Xiaomi purifier support to your plugin?

artem-sedykh commented 4 years ago

of course you can add, the plugin is made universal, you can add all devices from the fan domain.
Have you figured out how to do this, or do you need help?

abcjoint commented 4 years ago

It seems, I need help..

entity: fan.purifier
target_humidity:
  change_action: |
    (selected, _, entity) => {
      const options = { entity_id: entity.entity_id, fan_set_favorite_level: selected };
      return this.call_service('xiaomi_miio', 'fan_set_favorite_level', options);
    }
  icon: 'mdi:fan'
  max: 14
  min: 0
  state:
    attribute: sensor.xiaomi_airpurifier_speed
  step: 1
  unit: ''
type: 'custom:mini-humidifier'

tried this setting, got an error

screenshot 2020-06-09 в 23 04 01

additional buttons work well

the main question is how to set favourite level

artem-sedykh commented 4 years ago

What integration do you use?
This? https://www.home-assistant.io/integrations/fan.xiaomi_miio/ try like this const options = { entity_id: entity.entity_id, level: selected };

abcjoint commented 4 years ago

Yes, it works! Thanks! is it possible to show rpm?

  state:
    attribute: sensor.xiaomi_airpurifier_speed
artem-sedykh commented 4 years ago

You can try calling the service at http://ip or name/developer-tools/service sometimes there are even examples

image

abcjoint commented 4 years ago
screenshot 2020-06-09 в 23 18 27

how to change this parameter to motor_speed?

artem-sedykh commented 4 years ago
- type: custom:mini-humidifier
  entity: fan.xiaomi_miio_device
  indicators:
    depth:
      hide: on
    motor_speed:
      icon: your icon
      order: 0
      source:
        attribute: motor_speed
      ...

see

abcjoint commented 4 years ago

Perfect! Thanks!