aholstenson / miio

Control Mi Home devices, such as Mi Robot Vacuums, Mi Air Purifiers, Mi Smart Home Gateway (Aqara) and more
MIT License
1.86k stars 353 forks source link

Please add support with xiaomi.wifispeaker.v1 #41

Open uavana opened 7 years ago

uavana commented 7 years ago

xiaomi.wifispeaker.v1 supports auto-token

aholstenson commented 7 years ago

Do you have any more information about what calls this device supports? This is needed to support the device properly.

The document Protocols and commands contains a good starting point about how you can help with figuring this out. It's pretty technical so it might not be the easiest thing to do.

octa22 commented 7 years ago

Hi, please see the attached communication with the speaker (I clicked all the buttons in mi home app) -> 192.168.2.44 data= {"id":2893,"method":"get_prop","params":["umi"]} <- 192.168.2.103 data= {"result":["{ \"DeviceName\": \"Mi Internet Speaker\", \"channel_title\": \"音箱下载\", \"current_state\": \"PLAYING\", \"hardware_version\": \"S602\", \"play_mode\": \"REPEAT_ALL\", \"track_artist\": \"Kygo&M83\", \"track_duration\": \"00:04:58\", \"track_title\": \"Wait(Remix)\", \"transport_channel\": \"PLAYLIST\" }"],"id":2893} -> 192.168.2.44 data= {"id":2894,"method":"get_prop","params":["rel_time"]} <- 192.168.2.103 data= {"result":["00:04:00"],"id":2894} -> 192.168.2.44 data= {"id":2895,"method":"power","params":[]} <- 192.168.2.103 data= {"result":"ok","id":2895} -> 192.168.2.44 data= {"id":2896,"method":"get_prop","params":["rel_time"]} <- 192.168.2.103 data= {"result":["00:04:02"],"id":2896} -> 192.168.2.44 data= {"id":2897,"method":"get_prop","params":["rel_time"]} <- 192.168.2.103 data= {"result":["00:04:03"],"id":2897} -> 192.168.2.44 data= {"id":2898,"method":"vol_up","params":[5]} <- 192.168.2.103 data= {"result":"ok","id":2898} -> 192.168.2.44 data= {"id":2899,"method":"vol_down","params":[5]} <- 192.168.2.103 data= {"result":"ok","id":2899} -> 192.168.2.44 data= {"id":2900,"method":"previous_track","params":[]} <- 192.168.2.103 data= {"result":"ok","id":2900} -> 192.168.2.44 data= {"id":2901,"method":"next_track","params":[]} <- 192.168.2.103 data= {"result":"ok","id":2901} -> 192.168.2.44 data= {"id":2902,"method":"get_prop","params":["rel_time"]} <- 192.168.2.103 data= {"result":["00:00:00"],"id":2902} -> 192.168.2.44 data= {"id":2903,"method":"get_prop","params":["umi"]} <- 192.168.2.103 data= {"result":["{ \"DeviceName\": \"Mi Internet Speaker\", \"channel_title\": \"音箱下载\", \"current_state\": \"PLAYING\", \"hardware_version\": \"S602\", \"play_mode\": \"REPEAT_ALL\", \"track_artist\": \"Kygo&M83\", \"track_duration\": \"00:04:58\", \"track_title\": \"Wait(Remix)\", \"transport_channel\": \"PLAYLIST\" }"],"id":2903} -> 192.168.2.44 data= {"id":2904,"method":"get_prop","params":["rel_time"]} <- 192.168.2.103 data= {"result":["00:00:08"],"id":2904} -> 192.168.2.44 data= {"id":2905,"method":"next_channel","params":[]} <- 192.168.2.103 data= {"result":"ok","id":2905} -> 192.168.2.44 data= {"id":2906,"method":"get_prop","params":["rel_time"]} <- 192.168.2.103 data= {"result":["00:00:00"],"id":2906}

rytilahti commented 6 years ago

@octa22 could you please also try to change the play modes (currently showing REPEAT_ALL) and try to change the source (currently PLAYLIST)? Also, power just toggles the power on and off?

Btw, do you happen to know if this speaker usable outside China?

octa22 commented 6 years ago

I've captured all the commands sent by the Mi Home app. You can't control play modes neither switch it off in Mi Home afaik. (only in the dedicated mobile application) I'm using this speaker in Europe, it works quite well. The iOS version of the control application sucks (only in chineese), but Android one is quite good (in English too)