Add support for zhimi.heater.za2

Is it possible to had support to zhimi.heater.za2 in the miio platform?

There was a custom integration done before, but it stopped working:

Also there is support for this device in this platform

so I guess most of the work is done

Pleaasssse!

Thanks in advance

Since we are asking, it would be great to also support MODEL: zhimi.heater.mc2

Using the miiocli I got the below commands working. If someone could code them into an integration it would be great!! :smiley:

###READS###
# Get Target Temperature
miiocli device --ip <<IP>> --token <<TOKEN>> raw_command get_properties '[{"piid":5,"siid":2}]' 


# Get Switch Status
miiocli device --ip <<IP>> --token <<TOKEN>> raw_command get_properties '[{"piid":1,"siid":2}]' 


# Get fault
miiocli device --ip <<IP>> --token <<TOKEN>> raw_command get_properties '[{"piid":2,"siid":2}]'

# Get Mode - ERRO
miiocli device --ip <<IP>> --token <<TOKEN>> raw_command get_properties  '[{"piid":6,"siid":2}]'

# Get Environment
miiocli device --ip <<IP>> --token <<TOKEN>> raw_command get_properties  '[{"piid":1,"siid":3}]'

# Get Temperature
miiocli device --ip <<IP>> --token <<TOKEN>> raw_command get_properties  '[{"piid":7,"siid":4}]' 


# Get Physical Control Locked stauts 
miiocli device --ip <<IP>> --token <<TOKEN>> raw_command get_properties '[{"piid":1,"siid":5}]' 

# Get Alarm stauts 
miiocli device --ip <<IP>> --token <<TOKEN>> raw_command get_properties  '[{"piid":1,"siid":6}]' 


###UPDATES###
# Switch Status
miiocli device --ip <<IP>> --token <<TOKEN>> raw_command set_properties  '[{"value":True,"siid":2,"piid":1}]'  

# Countdown
miiocli device --ip <<IP>> --token <<TOKEN>> raw_command set_properties '[{"value":36000,"siid":3,"piid":1}]'    

# Switch Status
miiocli device --ip <<IP>> --token <<TOKEN>> raw_command set_properties '[{"value":True,"siid":2,"piid":1}]'  

# Target Temperature
miiocli device --ip <<IP>> --token <<TOKEN>> raw_command set_properties '[{"value":22,"siid":2,"piid":5}]' 

# Mode
miiocli device --ip <<IP>> --token <<TOKEN>> raw_command set_properties '[{"value":1,"siid":2,"piid":6}]' 

# Physical Control Locked
miiocli device --ip <<IP>> --token <<TOKEN>> raw_command set_properties '[{"value":True,"siid":5,"piid":1}]'

# Alarm
miiocli device --ip <<IP>> --token <<TOKEN>> raw_command set_properties '[{"value":True,"siid":6,"piid":1}]'

# Indicator Light
miiocli device --ip <<IP>> --token <<TOKEN>> raw_command set_properties '[{"value":0,"siid":7,"piid":3}]' 




Likely pretty much the same, also zhimi-heater-zb1 ?

I opened an “issue” in miio and was able to locally create a crude integration, but I dont know how to try to merge it and do a pull request, not how to integrate in HA :frowning:

1 Like

I’ll try the integration as soon as python-miio support the device. Where can I find the docs related to this?

Hi. I have fork the repo homeassistant-mi-heater to work with the zhimi.heater.za2 as custom component.

Captura de pantalla 2020-12-06 a las 18.45.50

Amazing!
I changed a the raw codes and it’s working for zhimi.heater.mc2.

However, I cannot change the targeT temperature. It stays red with no error:

image

EDIT
I fixed it :smiley:
The update temperature on my devices does not need the “[]”, so I updated it to:
self._device.raw_command('set_properties',[{"did":"318921340","value":int(temperature),"siid":2,"piid":5}])

Working flawlessly!

For those who need it for Xiaomi Smart Space Heater S you can use my fork:

1 Like

Hi, could you share your card? how could i get energy values?

Hi,

The card is the Simple Thermostat: Lovelace: Simple thermostat card

I’m getting the power and cost from a smart plug, not from the heater.