This is the forum archive of Homey. For more information about Homey, visit the Official Homey website.

The Homey Community has been moved to https://community.athom.com.

This forum is now read-only for archive purposes.
Closed Official

[APP] Xiaomi Mi Home (supports Yeelights and Mi Home WiFi devices)

1568101113

Comments

  • Phuturist said:
    Phuturist said:
    Phuturist said:
    hi i think there is a small bug in your app: (ver 2.4.3)
    trying to add the wifi power plug, have discovered the token using miio,
    but when adding it in settings it says "Cannot read property 'toUpperCase' of undefined" 
    so looks like the conversion of the token to uppercase is going wrong?
    I have just rewritten the app and updated the miio library. It's available in the beta channel. It would be great if you could test if this is still an issue. Either by installing the beta or waiting until it hits stable.
    will i have to re-pair all my yeelights when switching to the beta version?
    Nope, nothing has changed for the Yeelights with this version and you can switch between regular and beta without having to re-pair devices.
    You tested this? The Athom idea is that Beta -> Stable can't be combined or switched without losing your config just like you can't return from experimental to stable (same implementation is in the app store)
    This is only the case for app settings, not for devices. And yes, I switch myself between beta version and regular versions of apps without issues.
    Great, thanks for the answer! Always better be sure instead of losing something :)
  • mauritsivsmauritsivs Member
    edited February 2018
    Phuturist said:
    hi i think there is a small bug in your app: (ver 2.4.3)
    trying to add the wifi power plug, have discovered the token using miio,
    but when adding it in settings it says "Cannot read property 'toUpperCase' of undefined" 
    so looks like the conversion of the token to uppercase is going wrong?
    I have just rewritten the app and updated the miio library. It's available in the beta channel. It would be great if you could test if this is still an issue. Either by installing the beta or waiting until it hits stable.
    ok, we are getting closer:
    now with the beta version i get this error when testing connection: "device.powerConsumed is not a function"
    and then i cant continue the adding process

    miio inspect results:

    Type info: miio:power-plug, miio, power-outlet, power-plug
    Capabilities: switchable-power, restorable-state, power, state

    Firmware version: 1.2.4_17
    Hardware version: MW300
  • Phuturist said:
    hi i think there is a small bug in your app: (ver 2.4.3)
    trying to add the wifi power plug, have discovered the token using miio,
    but when adding it in settings it says "Cannot read property 'toUpperCase' of undefined" 
    so looks like the conversion of the token to uppercase is going wrong?
    I have just rewritten the app and updated the miio library. It's available in the beta channel. It would be great if you could test if this is still an issue. Either by installing the beta or waiting until it hits stable.
    ok, we are getting closer:
    now with the beta version i get this error when testing connection: "device.powerConsumed is not a function"
    and then i cant continue the adding process

    miio inspect results:

    Type info: miio:power-plug, miio, power-outlet, power-plug
    Capabilities: switchable-power, restorable-state, power, state

    Firmware version: 1.2.4_17
    Hardware version: MW300
    It seems the powerLoad and powerConsumed capabilities have not been implemented yet in the latest miio library. I'll remove it from the wifi plug driver in my app until it becomes available. Will push it as 2.5.2 to the beta channel later today.
  • would it not be easier if the device could be added regardless of any missing functions? so have the process of adding the device be able to continue even if it finds these kind of errors
  • would it not be easier if the device could be added regardless of any missing functions? so have the process of adding the device be able to continue even if it finds these kind of errors
    Not really, the driver would crash anyway trying to update capabilities that are not available. According to the owner of the miio library the WiFi power plug does not support the powerLoad and powerConsumed capability. Your device inspection seems to support this. Do you see any of this data in the Mi Home app for the WiFi powerplug?
  • no, in the mi home app there is no indication of power consumption or anything similar. so i guess its not available in this wifi model....
  • another small thing, concerning the yeelights:
    when using the colortemp card, i can only input 1700 or 6500, whenever i try to type anything else, for example 4000, it constantly reverts back to 6500 while typing. is this a homey-issue or an issue with your implementation of the cards. 
    right now i have to use copy paste to input anything else than 6500
  • another small thing, concerning the yeelights:
    when using the colortemp card, i can only input 1700 or 6500, whenever i try to type anything else, for example 4000, it constantly reverts back to 6500 while typing. is this a homey-issue or an issue with your implementation of the cards. 
    right now i have to use copy paste to input anything else than 6500
    That's a Homey thing. You can also work around this by typing really fast so a valid number is entered before the validation kicks in.
  • Latest version - 2018-02-05 -- v2.5.2 (beta)

    • FIX: removed powerLoad and powerConsumed capability in WiFi plug driver as these capabilities are not available for this device
  • @Phuturist
    Since you clearly know a lot about the Mii Home app, do you know if there is a way to send an activate / deactivate command for the motion detection on a Dafang camera?

    I'd really like to link this piece into my flows, so e.g. when I turn on the house alarm motion detection on the dafang turns on...
    I don't really mind how it's done, even if I have to call Tasker on my phone to do it somehow (I actually tried this with button presses etc but it was cumbersome and didn't always work if the camera struggled to connect for some reason), but it seems the API allows these kind of things on their other devices so wondering if possible on this?

    Many thanks!
  • vaderag said:
    @Phuturist
    Since you clearly know a lot about the Mii Home app, do you know if there is a way to send an activate / deactivate command for the motion detection on a Dafang camera?

    I'd really like to link this piece into my flows, so e.g. when I turn on the house alarm motion detection on the dafang turns on...
    I don't really mind how it's done, even if I have to call Tasker on my phone to do it somehow (I actually tried this with button presses etc but it was cumbersome and didn't always work if the camera struggled to connect for some reason), but it seems the API allows these kind of things on their other devices so wondering if possible on this?

    Many thanks!
    By default this camera does not have an API and there is no way to talk to it with a third party device. You can hack it though and add a custom firmware which allows this. https://github.com/EliasKotlyar/Xiaomi-Dafang-Hacks
  • Phuturist said:
    vaderag said:
    @Phuturist
    Since you clearly know a lot about the Mii Home app, do you know if there is a way to send an activate / deactivate command for the motion detection on a Dafang camera?

    I'd really like to link this piece into my flows, so e.g. when I turn on the house alarm motion detection on the dafang turns on...
    I don't really mind how it's done, even if I have to call Tasker on my phone to do it somehow (I actually tried this with button presses etc but it was cumbersome and didn't always work if the camera struggled to connect for some reason), but it seems the API allows these kind of things on their other devices so wondering if possible on this?

    Many thanks!
    By default this camera does not have an API and there is no way to talk to it with a third party device. You can hack it though and add a custom firmware which allows this. https://github.com/EliasKotlyar/Xiaomi-Dafang-Hacks
    Oooh, interesting. 
    Just been looking through that but seems that you lose a fair bit of functionality if you do that? Or is there some software that once flashed you can do much of the stuff that you can normally?

    Shame there is no way to send any command by default!
  • I just upgraded the beta release to the stable channel.

    Latest version - 2018-02-12 -- v2.5.x

    • UPDATE: updated the miio library to 0.15.5 and rewritten all device drivers
    • UPDATE: reintroduced support for the Mi Robot Vacuum Cleaner (needs re-pairing the device if coming from an older version)
    • FIX: removed powerLoad and powerConsumed capability in WiFi plug driver as these capabilities are not available for this device
  • Did anyone manage to retrieve the token from the vacuum on firmware 3.3.9_003094? I tried serveral methodes without success. With the ADB tool I only got some question marks (???) and with miio nothing at all. I have the vacuum V1.
  • rtna said:
    Did anyone manage to retrieve the token from the vacuum on firmware 3.3.9_003094? I tried serveral methodes without success. With the ADB tool I only got some question marks (???) and with miio nothing at all. I have the vacuum V1.
    I noticed that tokens are not stored in the miio2.db database anymore since an update from the Mi Home App. Looks like Xiaomi is making it tougher and tougher to control the devices through a third party. What you could try is install a previous version of the Mi Home App, re-add the device again so it gets a new token and then try one of the token retrieval methods.
  • @Phuturist Any idea how to get an old version of the app?
  • Got finaly the token through an old version (4.x) of the Mi-Home app. Will the token change after a reset or reboot?
  • rtna said:
    Got finaly the token through an old version (4.x) of the Mi-Home app. Will the token change after a reset or reboot?
    There is no way for regular users to reboot the mi robot. Reseting it will indeed reset the token as well. Just don't do this and you are fine. You can even upgrade the mi home app again if you want.
  • Just want to report that I was able to get the token from IOS with Mi Home 4.7.1
    Also able to add the Mi Robot Vacuum (firmware 3.3.9_003096).
    Can only "start" and "stop" with Homey. No returning Home or change any settings.

  • elfrigo said:
    Just want to report that I was able to get the token from IOS with Mi Home 4.7.1
    Also able to add the Mi Robot Vacuum (firmware 3.3.9_003096).
    Can only "start" and "stop" with Homey. No returning Home or change any settings.

    Odd, thusfar you are the only one reporting this. There is a small issue with the change fanSpeed card which causes the spinner to spin endlessly. This is the only setting that can currently be changed, so I assume you are talking about this. The issue with this card makes it appear that nothing has happened while it actually did change the fanSpeed. Have you actually checked through the Mi Home app that the fanSpeed is not changed when using this action card?

    How are you trying to update the vacuum cleaner state? In a flow or through the mobile device card, and in case of the latter, through the desktop, old mobile app or new mobile app?
  • PhuturistPhuturist Member
    edited February 2018
    Hey, i only have the Wi-Fi Power Strip (2, and 1 is waiting on my desk till the app supports it). I have no Single Power Plug (as this is really not interesting in the Netherlands as we have the Action stuff and KAKU, which supports grounded EU plugs). If you are adding the Power Strip, is it also possible to read out the wattage it's using? Product number: ZNCXB01ZM.
    I'm planning to implement basic support for this but it wont have power load and power consumed capabilities yet. It seems this is not implemented in the miio library which is used by my app. I have requested support for this.
  • Latest version - 2018-02-18 -- v2.6.0

    • NEW: add support for PM2.5 sensor
    • NEW: add basic support for WiFi power strips (power load and power consumed are not available for now)
    • UPDATE: update miio library to 0.15.6 which fixes:
    • ----Power and color temperature setting fixed for Philips Light Bulbs
    • ----Refreshing of vacuumcleaner state after starting and stopping cleaning
    • FIX: update vacuumcleaner state directly when using onoff capability
    • FIX: fix flow cards not showing (un)succesful execution status
    • FIX: possible fix for showing temperature for purifiers and humidifiers
  • I can confirm that the Power Strip's On / Off function is working as it should. Very nice! Good thing i kept the tokens from last time. Hopefully the power load function will also be implemented, only have to use the Mi Home App on my iPhone for the IP cam then, as all other devices i own are supported by Homey.

    Btw. minor thing: The Power Strip is added in Homey with the default name "Philips Light Bulb", instead of Mi Power Strip. Thanks Phuturist for adding this, and keep up the good work!
  • vaderag said:
    Wrong topic, this is the Xiaomi topic, not the MiLight topic. So no ... ;-)
  • Phuturist said:
    vaderag said:
    Wrong topic, this is the Xiaomi topic, not the MiLight topic. So no ... ;-)
    Phuturist said:
    vaderag said:
    Wrong topic, this is the Xiaomi topic, not the MiLight topic. So no ... ;-)
    Huh? Is that not MiHome then??? Talk about confusing branding!!
  • PhuturistPhuturist Member
    edited February 2018
    vaderag said:
    Phuturist said:
    vaderag said:
    Wrong topic, this is the Xiaomi topic, not the MiLight topic. So no ... ;-)
    Phuturist said:
    vaderag said:
    Wrong topic, this is the Xiaomi topic, not the MiLight topic. So no ... ;-)
    Huh? Is that not MiHome then??? Talk about confusing branding!!
    Xiaomi Mi Home is not MiLight. Don't think it's that confusing. Mi means something like smart in Chinese. Can't blame them for using obvious words.
  • i just returned from holiday so it took me a while but now i added the wifi powerplug to homey....
    unfortunately there are still issues:
    The device does not show up in the devices list to make a flow with it!
    i can turn it on and off by clicking it in the devices screen, and the tag shows up in the tags list.
    and a minor (funny) thing: the standard name it got after adding it to my devices was "philips lightbulb".
  • i just returned from holiday so it took me a while but now i added the wifi powerplug to homey....
    unfortunately there are still issues:
    The device does not show up in the devices list to make a flow with it!
    i can turn it on and off by clicking it in the devices screen, and the tag shows up in the tags list.
    and a minor (funny) thing: the standard name it got after adding it to my devices was "philips lightbulb".
    Will fix these issues in the next release.
This discussion has been closed.