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

Support device model dmaker.fan.p5 #30

Open
1043717432 opened this issue May 23, 2019 · 43 comments

Comments

@1043717432
Copy link

commented May 23, 2019

Support device model dmaker.fan.p5

Hi, today I received my "xiaomi SmartmiFan 1x"
Sadly it is not yet recognised by your component. Could you please integrate it?

I try to give the same information which you required in similar requests, let me know if you need more information:
Mi Home App doesn't seem to display battery stats

Support device model dmaker.fan.p5

bash-4.4# mirobo --ip 192.168.120.157 --token df0xx25caxxcedxx7656368xx79aaxx9 raw-command get_prop "['$PROP']"
Sending cmd get_prop with params ['']
[True, 'nature', 35, True, 140, 0, True, False, False, 2]

@StanislavBolshakov

This comment has been minimized.

Copy link

commented May 24, 2019

Came across the same issue. Component returns an error on load:

Unsupported device found! Please create an issue at https://github.com/syssi/xiaomi_fan/issues and provide the following data: dmaker.fan.p5
@vandijks

This comment has been minimized.

Copy link

commented May 29, 2019

I can help testing if required, received the same device today (2019, 1X, 140deg instead of 120, wired).

@syssi

This comment has been minimized.

Copy link
Owner

commented Jun 2, 2019

Could somebody provide the output of:

for PROP in ac_power angle angle_enable bat_charge bat_state battery button_pressed buzzer child_lock humidity led led_b natural_level power poweroff_time speed speed_level temp_dec use_time
do
  mirobo --ip IP --token TOKEN raw-command get_prop "['$PROP']"
done

and

for PROP in power mode speed roll_enable roll_angle time_off light beep_sound child_lock
do
  mirobo --ip IP --token TOKEN raw-command get_prop "['$PROP']"
done

I will implement the device support as soon as the output is known.

@1043717432

This comment has been minimized.

Copy link
Author

commented Jun 2, 2019

稍等,我现在立马测试!

@syssi

This comment has been minimized.

Copy link
Owner

commented Jun 2, 2019

Cool! Thanks.

@StanislavBolshakov

This comment has been minimized.

Copy link

commented Jun 2, 2019

Sending cmd get_prop with params ['ac_power']
[True]
Sending cmd get_prop with params ['angle']
[True, 'normal', 35, False, 140, 0, True, False, False, 2]
Sending cmd get_prop with params ['angle_enable']
[True, 'normal', 35, False, 140, 0, True, False, False, 2]
Sending cmd get_prop with params ['bat_charge']
[True, 'normal', 35, False, 140, 0, True, False, False, 2]
Sending cmd get_prop with params ['bat_state']
[True, 'normal', 35, False, 140, 0, True, False, False, 2]
Sending cmd get_prop with params ['battery']
[True, 'normal', 35, False, 140, 0, True, False, False, 2]
Sending cmd get_prop with params ['button_pressed']
[True, 'normal', 35, False, 140, 0, True, False, False, 2]
Sending cmd get_prop with params ['buzzer']
[True, 'normal', 35, False, 140, 0, True, False, False, 2]
Sending cmd get_prop with params ['child_lock']
[False]
Sending cmd get_prop with params ['humidity']
[True, 'normal', 35, False, 140, 0, True, False, False, 2]
Sending cmd get_prop with params ['led']
[True, 'normal', 35, False, 140, 0, True, False, False, 2]
Sending cmd get_prop with params ['led_b']
[True, 'normal', 35, False, 140, 0, True, False, False, 2]
Sending cmd get_prop with params ['natural_level']
[True, 'normal', 35, False, 140, 0, True, False, False, 2]
Sending cmd get_prop with params ['power']
[True]
Sending cmd get_prop with params ['poweroff_time']
[True]
Sending cmd get_prop with params ['speed']
[35]
Sending cmd get_prop with params ['speed_level']
[35]
Sending cmd get_prop with params ['temp_dec']
[True, 'normal', 35, False, 140, 0, True, False, False, 2]
Sending cmd get_prop with params ['use_time']
[True, 'normal', 35, False, 140, 0, True, False, False, 2]
Sending cmd get_prop with params ['power']
[True]
Sending cmd get_prop with params ['mode']
['normal']
Sending cmd get_prop with params ['speed']
[35]
Sending cmd get_prop with params ['roll_enable']
[False]
Sending cmd get_prop with params ['roll_angle']
[140]
Sending cmd get_prop with params ['time_off']
[0]
Sending cmd get_prop with params ['light']
[True]
Sending cmd get_prop with params ['beep_sound']
[False]
Sending cmd get_prop with params ['child_lock']
[False]

Here you go.

@1043717432

This comment has been minimized.

Copy link
Author

commented Jun 2, 2019

@syssi

/config # mirobo --ip 192.168.120.129 --token df02225caf5cedxxxx563687e79aadd9 raw-command get_prop "['$PROP']" Sending cmd get_prop with params [''] [True, 'nature', 100, False, 140, 0, True, False, False, 4]
/config # mirobo --ip 192.168.120.129 --token df02225caf5cedxxxx563687e79aadd9 raw-command get_prop "['$PROP']" Sending cmd get_prop with params [''] [False, 'nature', 100, False, 140, 0, True, False, False, 4] 
/config # mirobo --ip 192.168.120.129 --token df02225caf5cedxxxx563687e79aadd9 raw-command get_prop "['$PROP']" Sending cmd get_prop with params [''] [False, 'nature', 100, False, 140, 0, True, False, False, 4] 
/config # mirobo --ip 192.168.120.129 --token df02225caf5cedxxxx563687e79aadd9 raw-command get_prop "['$PROP']" Sending cmd get_prop with params [''] [True, 'nature', 100, False, 140, 0, True, False, False, 4] 
/config # mirobo --ip 192.168.120.129 --token df02225caf5cedxxxx563687e79aadd9 raw-command get_prop "['$PROP']" Sending cmd get_prop with params [''] [True, 'nature', 1, False, 140, 0, True, False, False, 1] 
/config # mirobo --ip 192.168.120.129 --token df02225caf5cedxxxx563687e79aadd9 raw-command get_prop "['$PROP']" Sending cmd get_prop with params [''] [True, 'nature', 35, False, 140, 0, True, False, False, 2] 
/config # mirobo --ip 192.168.120.129 --token df02225caf5cedxxxx563687e79aadd9 raw-command get_prop "['$PROP']" Sending cmd get_prop with params [''] [True, 'nature', 70, False, 140, 0, True, False, False, 3] 
@syssi

This comment has been minimized.

Copy link
Owner

commented Jun 2, 2019

@StanislavBolshakov If you request a list of properties do you retrieve a proper response:

mirobo --ip IP --token TOKEN raw-command get_prop "['power','mode','speed','roll_enable','roll_angle','time_off','light','beep_sound','child_lock']"
@1043717432

This comment has been minimized.

Copy link
Author

commented Jun 2, 2019

/config # mirobo --ip 192.168.120.129 --token df02225caf5cedxxxx563687e79aadd9 raw-command get_prop "['power','mode','speed','roll_enable','roll_angle','time_off','light','beep_sound','child_lock']" Sending cmd get_prop with params ['power', 'mode', 'speed', 'roll_enable', 'roll_angle', 'time_off', 'light', 'beep_sound', 'child_lock'] [True, 'nature', 70, False, 140, 0, True, False, False]

@1043717432

This comment has been minimized.

Copy link
Author

commented Jun 2, 2019

我按一次风速和转动方向 ,都只是这样的反馈!

@1043717432

This comment has been minimized.

Copy link
Author

commented Jun 2, 2019

抱歉不会编辑回复,可能你看得有点乱!

@StanislavBolshakov

This comment has been minimized.

Copy link

commented Jun 2, 2019

@syssi yup.

Sending cmd get_prop with params ['power', 'mode', 'speed', 'roll_enable', 'roll_angle', 'time_off', 'light', 'beep_sound', 'child_lock']
[False, 'normal', 35, False, 140, 0, True, False, False]

But I believe there should be something else as well. Sending command without params returns "2" in array.

Sending cmd get_prop with params ['']
[False, 'normal', 35, False, 140, 0, True, False, False, 2]

On a side note, it reports "2" no matter what, so probably doesn't matter.

@syssi

This comment has been minimized.

Copy link
Owner

commented Jun 2, 2019

I want to request a list of properties because of future firmware updates. If the response of the empty request changes the values are mapped incorrect.

@syssi

This comment has been minimized.

Copy link
Owner

commented Jun 2, 2019

Could somebody provide a list of the different available "mode"s?

@1043717432

This comment has been minimized.

Copy link
Author

commented Jun 2, 2019

How to provide a list of different modes?

@StanislavBolshakov

This comment has been minimized.

Copy link

commented Jun 2, 2019

Could somebody provide a list of the different available "mode"s?

It's either normal or nature.

@syssi

This comment has been minimized.

Copy link
Owner

commented Jun 2, 2019

The maximum speed is 100%?

@StanislavBolshakov

This comment has been minimized.

Copy link

commented Jun 2, 2019

The maximum speed is 100%?

Yes

@syssi

This comment has been minimized.

Copy link
Owner

commented Jun 2, 2019

This is the first step (extending python-miio): rytilahti/python-miio#513

@StanislavBolshakov Do you like to install and test the feature branch?

$ pip3 install https://github.com/syssi/python-miio/archive/feature/dmaker-fan-p5-support.zip
[...]
$ miiocli fanp5
Usage: miiocli fanp5 [OPTIONS] COMMAND [ARGS]...

Options:
  --ip TEXT     [required]
  --token TEXT  [required]
  --help        Show this message and exit.

Commands:
  delay_off       Set delay off seconds.
  info            Get miIO protocol information from the device.
  off             Power off.
  on              Power on.
  raw_command     Send a raw command to the device.
  set_angle       Set the oscillation angle.
  set_buzzer      Set buzzer on/off.
  set_child_lock  Set child lock on/off.
  set_led         Turn led on/off.
  set_mode        Set mode.
  set_oscillate   Set oscillate on/off.
  set_speed       Set speed.
  status          Retrieve properties

@StanislavBolshakov

This comment has been minimized.

Copy link

commented Jun 2, 2019

Getting an error:

bash-4.4#  miiocli fanp5
Usage: miiocli [OPTIONS] COMMAND [ARGS]...
Try "miiocli --help" for help.

Error: No such command "fanp5".
@syssi

This comment has been minimized.

Copy link
Owner

commented Jun 2, 2019

In this case you have python-miio installed two times now. This should work:

~/.local/bin/miiocli fanp5
@StanislavBolshakov

This comment has been minimized.

Copy link

commented Jun 2, 2019

Missed the --upgrade key, sorry.

Works fine:

  • Info provides accurate info about device, firmware and WLAN.
  • On/off toggles the device.
  • Buzzer
  • Child mode
  • LED
  • On/off oscillating
  • Speed
  • Setting mode normal & nature
  • Status

There is space for improvement:

  • Delay_off expects minutes, not seconds. Overwise works.
  • Set_angle should receive [30,60,90,120,140], other values won't work. Will it make sense to call set_oscillate prior set_angle if oscillating currently disabled?
  • Mi Home App has controls to rotate the fan gradually without enabling oscillating mode. Is it worth to implement?
@syssi

This comment has been minimized.

Copy link
Owner

commented Jun 2, 2019

  1. Fixed.
  2. What happens if you turn off oscillation, set_angle 90 and retrieve the status afterwards. Does the property change and is the oscillation still disabled? I will restrict the accepted values.
  3. Could you test m_roll as raw_command?
miiocli fanp5 --ip IP --token TOKEN raw_command m_roll "['left']"
...multiple times...
miiocli fanp5 --ip IP --token TOKEN raw_command m_roll "['right']"
...multiple times...

I'm unsure about "left" and "right". The proper payload is unknown up to now.

@StanislavBolshakov

This comment has been minimized.

Copy link

commented Jun 2, 2019

  1. Value sets to 90. Oscillation still being disabled.
  2. Works fine.
@syssi

This comment has been minimized.

Copy link
Owner

commented Jun 2, 2019

Cool. In this case the implementation should be feature complete now:

rytilahti/python-miio@0f76c50

Could you test the new command?

$ pip3 install https://github.com/syssi/python-miio/archive/feature/dmaker-fan-p5-support.zip -U
[...]
miiocli fanp5 --ip IP --token TOKEN set_rotate left
miiocli fanp5 --ip IP --token TOKEN set_rotate right
@StanislavBolshakov

This comment has been minimized.

Copy link

commented Jun 2, 2019

It works!

@syssi

This comment has been minimized.

Copy link
Owner

commented Jun 10, 2019

A release of python-miio is needed first. Afterwards I will extend the HA component.

@yeyeyaya

This comment has been minimized.

Copy link

commented Jun 12, 2019

how to fix it?
2019-06-12 22:54:25 INFO (MainThread) [homeassistant.components.fan] Setting up fan.xiaomi_miio
2019-06-12 22:54:25 INFO (MainThread) [homeassistant.components.switch] Setting up switch.broadlink
2019-06-12 22:54:26 INFO (MainThread) [homeassistant.components.xiaomi_miio.fan] Initializing with host 192.168.3.10 (token 09d62...)
2019-06-12 22:54:26 INFO (MainThread) [homeassistant.components.xiaomi_miio.fan] dmaker.fan.p5 1.3.6 ESP8266 detected
2019-06-12 22:54:26 ERROR (MainThread) [homeassistant.components.xiaomi_miio.fan] Unsupported device found! Please create an issue at https://github.com/syssi/xiaomi_fan/issues and provide the following data: dmaker.fan.p5

@syssi

This comment has been minimized.

Copy link
Owner

commented Jun 12, 2019

You have to wait. I will extend the component soon.

@yeyeyaya

This comment has been minimized.

Copy link

commented Jun 12, 2019

You have to wait. I will extend the component soon.

thanks for reply!

@huyoupe

This comment has been minimized.

Copy link

commented Jun 17, 2019

when will the HA component be extended

@yishangfei

This comment has been minimized.

Copy link

commented Jun 18, 2019

waiting

@syssi

This comment has been minimized.

Copy link
Owner

commented Jun 18, 2019

I won't make an estimate/promise here.

@creatorMao

This comment has been minimized.

Copy link

commented Jun 27, 2019

hi, i seem to meet the problem too. i bought the fan named 1x.

@wzpan

This comment has been minimized.

Copy link

commented Jul 14, 2019

+1. Same problem on mi fan 1X.

@bg9ega

This comment has been minimized.

Copy link

commented Jul 15, 2019

Same problem on dmaker.fan.p5,waiting....

@bieniu

This comment has been minimized.

Copy link

commented Jul 25, 2019

Any news about add support for dmaker.fan.p5?

@jiafengwang

This comment has been minimized.

Copy link

commented Jul 26, 2019

Any news about add support for dmaker.fan.p5?

For temporary use

@jiafengwang

This comment has been minimized.

@bieniu

This comment has been minimized.

Copy link

commented Jul 26, 2019

I did yesterday a working version of the component for dmaker.fan.p5. It required the development version of the miio library.
https://github.com/bieniu/xiaomi_fan

@RPWO

This comment has been minimized.

Copy link

commented Aug 5, 2019

A release of python-miio is needed first. Afterwards I will extend the HA component.

I think it was updated since, not sure if it includes everything you need

@syssi

This comment has been minimized.

Copy link
Owner

commented Aug 14, 2019

I prepare the python-miio release this week. The support of your device is near!

@RPWO

This comment has been minimized.

Copy link

commented Aug 26, 2019

Cool

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
You can’t perform that action at this time.