mediter / homebridge-xiaomi-fan

1 stars 0 forks source link

Support for zhimi.fan.za3 and .za4 #1

Open CooperCGN opened 5 years ago

CooperCGN commented 5 years ago

continued from here: https://github.com/YinHangCode/homebridge-mi-fan/issues/10

So from what I actually could test now everything is exact as the older natural wind fans except for the "humidity" and the "temp_dec" commands which return ["null"] as output.

mediter commented 5 years ago

then that means these fans don't have those sensors. I think all the fans in Xiaomi ecosystem do not have those 2 sensors.

mediter commented 5 years ago

what is the result from 'get_prop' '["battery"]'?

Is .za4 the one with built-in battery?

CooperCGN commented 5 years ago

Yes, .za4 with and .za3 without battery. Anyway get_prop returns “null” for battery.

mediter commented 5 years ago

"null" for both za3 and za4?

CooperCGN commented 5 years ago

I only have the one WITH battery and it returns null, there is also nothing shown in the Mi app if that is of any importance.

mediter commented 5 years ago

Maybe try this:

miio protocol call device_ip 'get_prop' '[["all"]]'
CooperCGN commented 5 years ago

returns this

pi@raspberrypi:~ $ miio protocol call 10.0.1.238 'get_prop' '[["all"]]'
 INFO  Attempting to call get_prop on 10.0.1.238

 INFO  Device found, making call

 INFO  Got result:
[
  "null"
]
mediter commented 5 years ago

For power state property, did u use “power” or “ac_power” ?

Sent with GitHawk

CooperCGN commented 5 years ago

While the fan is turned off I get this:

pi@raspberrypi:~ $ miio protocol call 10.0.1.238 "get_prop" '["power"]'
 INFO  Attempting to call get_prop on 10.0.1.238

 INFO  Device found, making call

 INFO  Got result:
[
  "off"
]
pi@raspberrypi:~ $ miio protocol call 10.0.1.238 "get_prop" '["ac_power"]'
 INFO  Attempting to call get_prop on 10.0.1.238

 INFO  Device found, making call

 INFO  Got result:
[
  "on"
]

seems there is a difference although I have no idea what ac_power could mean as it doesn't change when I unplug the fan from the wall socket.

mediter commented 5 years ago

While the fan is turned off I get this: ...

@CooperCGN maybe ac_power is what’s used in za3 as the property name for power state

Sent with GitHawk

mediter commented 5 years ago

Could u help confirm the following property names: angle poweroff_time

Also the following methods: Method: set_angle Parameter: an Int in [30, 60, 90, 120]

Method:  set_poweroff_time 

Parameter: 60 * [0-8]

Method: set_move

Parameter: right / left

Method: set_led_b

Parameter: 0 / 1 / 2

2: off 1: dim 0: bright

CooperCGN commented 5 years ago

property angel sends back 30,60,90 and 120 depending on what is set in the Mi app. poweroff_time sends back 0 to 28800 depending on what I set in Mi app.

set_poweroff_time works with values between 0 to 28800 (both seems to be in seconds) set_move works set_led_b works

also there is parental controls, get_prop child_lock sends back on and off using set_child_lock works with on and off

mediter commented 5 years ago

Thank you

CooperCGN commented 5 years ago

By the way: there is another plugin here with the same name https://github.com/merdok/homebridge-xiaomi-fan

I haven't tried it yet but it seems to do background polling so that changes directly on the fan are reflected back into HomeKit.

mediter commented 5 years ago

Thanks for the tip! I will be sure to have a look at it

CooperCGN commented 5 years ago

Just out of curiosity I tried that plugin mentioned above but for some reason it stalled my homebridge instance. If I only would be a bit more experienced in coding, it can't be too hard to add another version of that ZhiMiNaturalWindFan just without the sensors.

CooperCGN commented 4 years ago

Is this still active?

malmentm commented 4 years ago

+1 for adding support for these two new fans