Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Add zhimi.heater.za2 and zhimi.heater.zb1 support #863

Closed
2esq opened this issue Nov 16, 2020 · 15 comments
Closed

Add zhimi.heater.za2 and zhimi.heater.zb1 support #863

2esq opened this issue Nov 16, 2020 · 15 comments

Comments

@2esq
Copy link

2esq commented Nov 16, 2020

Hi
I was wondering if this smart heater was implemented or not.
When I run the command miiocli device --ip <ip address> --token <token> info (with my IP and token) I get this info:

Model: zhimi.heater.za2
Hardware version: esp32
Firmware version: 2.1.4

but I can't seem to send any command to the heater.
I understand this device uses MIoT and it's still a in it's early days of development but is there a way to expose the heater to home assistant?

Thanks

@rytilahti
Copy link
Owner

The support for these devices is added in #625, you should be able to use miiocli heater to control the device. If that doesn't work, feel free to reopen this!

We don't track homeassistant implementations in this repository, the proper forum for homeassistant integration is homeassistant's community forums. Or maybe @syssi has a custom integration available (looks like the API is quite similar to some other devices :-)?

@2esq
Copy link
Author

2esq commented Nov 16, 2020

When I do miiocli heater --ip xx.x.x.xx --token 3b46e0dde8dxxxxxxxxxx45ee81b2c39 on I get:
Powering on
Error: {'code': -5001, 'message': 'command error'}

Same thing for any other command.

What could be causing this?

@rytilahti
Copy link
Owner

rytilahti commented Nov 16, 2020

Okay, that's clearly a bug so let's reopen this. That message is coming from the device, maybe this device uses different commands than the one in the implementation. Is any other command working?

Ping @bazuchan - do you have an idea?

@rytilahti rytilahti reopened this Nov 16, 2020
@bazuchan
Copy link
Contributor

Maybe get_prop vs get_properties ?

@syssi
Copy link
Collaborator

syssi commented Nov 17, 2020

The supported devices

MODEL_HEATER_ZA1 = "zhimi.heater.za1"
MODEL_HEATER_MA1 = "zhimi.elecheater.ma1"

are miIO devices. The zhimi.heater.za2 is a mioT device. In short: The ZA2 isn't supported right now.

@syssi
Copy link
Collaborator

syssi commented Nov 17, 2020

# miot specs

Service: siid 1: (Device Information): 4 props, 0 actions
  * Property piid: 4 (Current Firmware Version): (string, unit: None) (acc: ['read'], value-list: [], value-range: None)
  * Property piid: 1 (Device Manufacturer): (string, unit: None) (acc: ['read'], value-list: [], value-range: None)
  * Property piid: 2 (Device Model): (string, unit: None) (acc: ['read'], value-list: [], value-range: None)
  * Property piid: 3 (Device Serial Number): (string, unit: None) (acc: ['read'], value-list: [], value-range: None)
Service: siid 2: (Heater): 3 props, 0 actions
  * Property piid: 1 (Device Fault): (uint32, unit: None) (acc: ['read', 'notify'], value-list: [], value-range: [0, 4294967295, 1])
  * Property piid: 2 (Switch Status): (bool, unit: None) (acc: ['read', 'write', 'notify'], value-list: [], value-range: None)
  * Property piid: 6 (Target Temperature): (float, unit: celsius) (acc: ['read', 'write', 'notify'], value-list: [], value-range: [16, 28, 1])
Service: siid 3: (Alarm): 1 props, 0 actions
  * Property piid: 1 (Alarm): (bool, unit: None) (acc: ['read', 'write', 'notify'], value-list: [], value-range: None)
Service: siid 4: (Countdown): 1 props, 0 actions
  * Property piid: 1 (定时关机时间): (uint32, unit: hours) (acc: ['read', 'write', 'notify'], value-list: [], value-range: [0, 8, 1])
Service: siid 5: (Environment): 2 props, 0 actions
  * Property piid: 7 (Relative Humidity): (uint8, unit: percentage) (acc: ['read', 'notify'], value-list: [], value-range: [0, 100, 1])
  * Property piid: 8 (Temperature): (float, unit: celsius) (acc: ['read', 'notify'], value-list: [], value-range: [-30, 100, 0.1])
Service: siid 6: (Indicator Light): 1 props, 0 actions
  * Property piid: 1 (亮度): (uint8, unit: percentage) (acc: ['read', 'write', 'notify'], value-list: [], value-range: [0, 2, 1])
Service: siid 7: (Physical Control Locked): 1 props, 0 actions
  * Property piid: 1 (童锁功能): (bool, unit: None) (acc: ['read', 'write', 'notify'], value-list: [], value-range: None)
Service: siid 8: (private-service): 2 props, 0 actions
  * Property piid: 1 (按键点击): (int32, unit: None) (acc: ['notify'], value-list: [], value-range: [0, 6, 1])
  * Property piid: 7 (): (uint32, unit: seconds) (acc: ['read', 'notify'], value-list: [], value-range: [0, 4294967295, 1])
  * Event eiid 1 (high temperature exception): (args: [])
  * Event eiid 2 (温湿度传感器异常): (args: [])
  * Event eiid 3 (status report): (args: [])
  * Event eiid 4 (childlock trigger): (args: [])
  * Event eiid 5 (E2PROM 异常): (args: [])
  * Event eiid 6 (): (args: [])

@syssi syssi changed the title zhimi.heater.za2 not reachable Add zhimi.heater.za2 and zhimi.heater.zb1 support Nov 17, 2020
@syssi syssi added the miot label Nov 17, 2020
@2esq
Copy link
Author

2esq commented Nov 17, 2020

syssi, is there any way to control the heater, even with raw commands?
I reckon in homebridge there is an integration already working. https://github.com/github9984/homebridge-smartmi-heater#readme

@rezmus
Copy link

rezmus commented Nov 17, 2020

@maskiopt use above specs and send raw commands like this

{"method":"set_properties","params":[{"did":"X","siid":2,"piid":2,"value":true}],"id":123} # turn on
{"method":"get_properties","params":[{"did":"X","siid":2,"piid":6}],"id":123} # get target temperature

"did" may not be necessary (depends on device).

@devpitx
Copy link

devpitx commented Nov 23, 2020

Model: zhimi.heater.zb1

dmytro@dell-7510:/mnt/d/Desktop$ miiocli heater --ip 192.168.0.XX --token ****** off
Powering off
Error: {'code': -5001, 'message': 'command error'}

@devpitx
Copy link

devpitx commented Nov 23, 2020

how can I help you to add it to the supported list?

@rezmus
Copy link

rezmus commented Nov 23, 2020

it's miot device, it won't work via miio class.

@al-one
Copy link
Contributor

al-one commented Feb 25, 2021

al-one/hass-xiaomi-miot#12 (comment)

al-one/hass-xiaomi-miot supported zhimi.heater.ma3, Maybe you can try this component for HA.

@xztxy
Copy link

xztxy commented Mar 4, 2021

zhimi.heater.za2
image
image

al-one/hass-xiaomi-miot#12 (comment)

al-one/hass-xiaomi-miot supported zhimi.heater.ma3, Maybe you can try this component for HA.

@PRO-2684
Copy link
Contributor

PRO-2684 commented Jan 16, 2022

From this helpful link, I created heater_miot_za2.py based on heater_miot.py, which added zhimi.heater.za2 support.
PR here. #1301

@rytilahti
Copy link
Owner

This can be now closed thanks to @PRO-2684 - please open a separate issue if the miiocli heatermiot is not working for other models.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

9 participants