Closed vigilcoma closed 3 years ago
New version of xiaomi_miio_airpurifier integration use 'preset_mode' instead 'speed'. I fixed it in pull request https://github.com/artem-sedykh/mini-humidifier/pull/58
Where should I put this new attribute 'preset_mode'?
//rus Где мне нужно заменить 'speed'на 'preset_mode'? В конфиге карточки такого не нашел.
Where should I put this new attribute 'preset_mode'?
//rus Где мне нужно заменить 'speed'на 'preset_mode'? В конфиге карточки такого не нашел.
Можете пока использовать так, пока разработчик не принял pull requests и не выложил новую версию.
- type: custom:mini-humidifier entity: fan.humidifierbedroom model: 'xiaomi_miio_airpurifier:zhimi.humidifier.ca4' buttons: mode: icon: 'mdi:fan' order: 1 type: dropdown state: attribute: mode source: Auto: Auto Low: Low Mid: Mid High: High active: "(state, entity) => (entity.state !== 'off')" disabled: "(state, entity) => (entity.attributes.depth === 0)" change_action: > (selected, state, entity) => { const options = { entity_id: entity.entity_id, preset_mode: selected }; return this.call_service('fan', 'set_preset_mode', options); } clean: icon: 'mdi:dishwasher' order: 5 state: attribute: clean_mode mapper: "(state) => (state ? 'on' : 'off')" toggle_action: > (state, entity) => { if (state === 'on') { const selected = entity.attributes.preset_mode; const options = { entity_id: entity.entity_id, preset_mode: selected }; return this.call_service('fan', 'set_preset_mode', options); } else { const service = 'fan_set_clean_mode_on'; const options = { entity_id: entity.entity_id }; return this.call_service('xiaomi_miio_airpurifier', service, options); } }
Card config:
- type: 'custom:mini-humidifier'
entity: fan.bedroom_humidifier
model: 'xiaomi_miio_airpurifier:zhimi.humidifier.ca4'
This button has stoped working. Services fan.set_speed and xiaomi_miio_airpurifier.fan_set_fan_level from dev tools also doesn't work.