diff --git a/README.md b/README.md index 67ab5b9..279ae88 100644 --- a/README.md +++ b/README.md @@ -1,14 +1,14 @@ -# homeassistant-mi-heater for zhimi.heater.mc2, zhimi.heater.zb1 and zhimi.heater.za2 +# homeassistant-mi-heater for zhimi.heater.mc2, zhimi.heater.mc2a, zhimi.heater.zb1 and zhimi.heater.za2 [![hacs_badge](https://img.shields.io/badge/HACS-Custom-orange.svg?style=for-the-badge)](https://github.com/custom-components/hacs) - Modified component what was not correctly worked in HASS new version. -- Tested on zhimi.heater.mc2 +- Tested on zhimi.heater.mc2 and zhimi.heater.mc2a - Tested on zhimi.heater.zb1 - Tested on zhimi.heater.za2 (some issues reported. If someone has the correct raw codes working, I can integrate) -Xiaomi Smart Space Heater S(zhimi.heater.mc2) component for home-assistant +Xiaomi Smart Space Heater S(zhimi.heater.mc2 or zhimi.heater.mc2a) component for home-assistant ![p](https://cdn.weasy.io/users/xiaomi/catalog/mi_smart_space_heater_s.jpg) Xiaomi Mi Smart Space Heater 1S (zhimi.heater.zb1) component for home-assistant @@ -39,7 +39,7 @@ climate: host: token: name: xiaomi_heater - model: zhimi.heater.mc2 (optional: zhimi.heater.mc2 | zhimi.heater.zb1 | zhimi.heater.za2) + model: zhimi.heater.mc2 (optional: zhimi.heater.mc2 | zhimi.heater.mc2a | zhimi.heater.zb1 | zhimi.heater.za2) ```` diff --git a/custom_components/miheater/climate.py b/custom_components/miheater/climate.py index 42826cd..f072784 100644 --- a/custom_components/miheater/climate.py +++ b/custom_components/miheater/climate.py @@ -41,6 +41,7 @@ vol.Optional(CONF_DEVICE_ID): cv.string, vol.Optional(CONF_MODEL, default=None): vol.In( ['zhimi.heater.mc2', + 'zhimi.heater.mc2a', 'zhimi.heater.zb1', 'zhimi.heater.za2', 'zhimi.heater.za1', None]), @@ -89,7 +90,7 @@ def setup_platform(hass, config, add_devices, discovery_info=None): async def set_room_temp(service): """Set room temp.""" - if DEVICE_MODEL == "zhimi.heater.mc2": + if DEVICE_MODEL == "zhimi.heater.mc2" or DEVICE_MODEL == "zhimi.heater.mc2a": aux = device.raw_command('get_properties', [{"siid":2,"piid":5,"did":DEVICE_ID}]) elif DEVICE_MODEL == "zhimi.heater.zb1" or DEVICE_MODEL == "zhimi.heater.za2": aux = device.raw_command('get_properties', [{"siid":2,"piid":6}]) @@ -182,7 +183,7 @@ def getAttrData(self): #device_info = self._device.info() #DEVICE_MODEL = device_info.model - if self._model == "zhimi.heater.mc2": + if self._model == "zhimi.heater.mc2" or self._model == "zhimi.heater.mc2a": power=self._device.raw_command('get_properties', [{"did":DEVICE_ID,"siid":2,"piid":1}]) target_temperature=self._device.raw_command('get_properties', [{"did":DEVICE_ID,"siid":2,"piid":5}]) current_temperature=self._device.raw_command('get_properties', [{"did":DEVICE_ID,"siid":4,"piid":7}]) @@ -245,7 +246,7 @@ async def async_set_temperature(self, **kwargs): #device_info = self._device.info() #DEVICE_MODEL = device_info.model - if self._model == "zhimi.heater.mc2": + if self._model == "zhimi.heater.mc2" or self._model == "zhimi.heater.mc2a": self._device.raw_command('set_properties',[{"value":int(temperature),"siid":2,"piid":5, "did":DEVICE_ID}]) elif self._model == "zhimi.heater.zb1" or self._model == "zhimi.heater.za2" : self._device.raw_command('set_properties',[{"value":int(temperature),"siid":2,"piid":6}]) @@ -260,7 +261,7 @@ async def async_turn_on(self): #device_info = self._device.info() #DEVICE_MODEL = device_info.model - if self._model == "zhimi.heater.mc2": + if self._model == "zhimi.heater.mc2" or self._model == "zhimi.heater.mc2a": self._device.raw_command('set_properties',[{"value":True,"siid":2,"piid":1, "did":DEVICE_ID}]) elif self._model == "zhimi.heater.zb1" or self._model == "zhimi.heater.za2" : self._device.raw_command('set_properties',[{"value":True,"siid":2,"piid":2}]) @@ -275,7 +276,7 @@ async def async_turn_off(self): #device_info = self._device.info() #DEVICE_MODEL = device_info.model - if self._model == "zhimi.heater.mc2": + if self._model == "zhimi.heater.mc2" or self._model == "zhimi.heater.mc2a": self._device.raw_command('set_properties',[{"value":False,"siid":2,"piid":1, "did":DEVICE_ID}]) elif self._model == "zhimi.heater.zb1" or self._model == "zhimi.heater.za2" : self._device.raw_command('set_properties',[{"value":False,"siid":2,"piid":2}]) diff --git a/info.md b/info.md index 52531c1..af93e0d 100644 --- a/info.md +++ b/info.md @@ -1,6 +1,6 @@ # Home Assistant Integration for zhimi.heaters Modified component what was not correctly worked in HASS new version. - Tested on zhimi.heater.mc2 + Tested on zhimi.heater.mc2 and zhimi.heater.mc2a Tested on zhimi.heater.zb1 Tested on zhimi.heater.za2 (some issues reported) @@ -28,7 +28,7 @@ climate: host: token: name: xiaomi_heater - model: zhimi.heater.mc2 (optional: zhimi.heater.mc2 | zhimi.heater.zb1 | zhimi.heater.za2) + model: zhimi.heater.mc2 (optional: zhimi.heater.mc2 | zhimi.heater.mc2a | zhimi.heater.zb1 | zhimi.heater.za2) ````