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)

145791013

Comments

  • GeertK94 said:
    Thanks for the quick reply. Hope you at least continue with the Yeelights. The RGB bulbs work without any problems (of course because it is another API) without the cost of Hue!
    I will, next to the vacuum cleaner the Yeelights are the only devices I own myself. So I have every reason to continue support. The API is official and well documented as well.
  • I hope that too ;-)

    I finally get out some tokens from the Mi Home App, 4 of them. 1 must be that power strip. But it's an encrypted 96 character token. I still have to figure out how to decrypt them. For the normal (not ICT user) this is just no option lol. I even have difficulties figuring this out.
  • PhuturistPhuturist Member
    edited January 2018
    I hope that too ;-)

    I finally get out some tokens from the Mi Home App, 4 of them. 1 must be that power strip. But it's an encrypted 96 character token. I still have to figure out how to decrypt them. For the normal (not ICT user) this is just no option lol. I even have difficulties figuring this out.
    Go here: http://aes.online-domain-tools.com/

    • Input type: text
    • Input text (hex): your 96 character key
    • Selectbox Plaintext / Hex: Hex
    • Function: AES
    • Mode: ECB
    • Key (hex): 00000000000000000000000000000000
    • Selectbox Plaintext / Hex: Hex

    Hit the decrypt button. Your token are the first two lines of the right block of code. These two lines should contain a token of 32 characters. I have never tried this before as I dont own any Apple stuff but I seen other people confirm this works. Would be nice to know so I can add it to the docs.
  • Yeah, with these settings it's working! I was already trying some online AES de/encrypters myself, but i didn't get those settings right i guess because it was not working.

    Anyway, i found the right token, because if i test the connection to the Powerstrip i get a different error (instead of the time out): "Cannot read property "toUpperCase" of undefined".
  • Latest version - 2018-01-07 -- v2.4.1

    • FIX: some tweaks for the Yeelight JIAOYUE 650 Ceiling Light as it has seperate white (main lamp) and color (background color ring) capabilities
    • FIX: probable fix for temperature setting on Philips Light Bulbs
    • UPDATE: updated miio library to 0.14.1 to support latest model air purifier
  • I'm still having some issues controlling the Yeelights. Homey loses connection quite often. The Homey-app shows the lights as unavailable then, but when I open the official Yeelight-app, the lights are available. Afterwards, Homey is able to control them again.

  • Amelsfort said:
    I'm still having some issues controlling the Yeelights. Homey loses connection quite often. The Homey-app shows the lights as unavailable then, but when I open the official Yeelight-app, the lights are available. Afterwards, Homey is able to control them again.

    Had the same problem, but giving them a static IP in my router fixed it for me.
  • Amelsfort said:
    I'm still having some issues controlling the Yeelights. Homey loses connection quite often. The Homey-app shows the lights as unavailable then, but when I open the official Yeelight-app, the lights are available. Afterwards, Homey is able to control them again.

    I'm aware of this but don't know how to solve it (at least not without having to introduce a polling mechanisms which I would like to avoid). I'll give it some love when I can find some free time.
  • GeertK94 said:
    Amelsfort said:
    I'm still having some issues controlling the Yeelights. Homey loses connection quite often. The Homey-app shows the lights as unavailable then, but when I open the official Yeelight-app, the lights are available. Afterwards, Homey is able to control them again.

    Had the same problem, but giving them a static IP in my router fixed it for me.
    I already did that, but it didn't solve the issue. It's not a very big issue, but I'm happy to know it's a known issue.
  • Phuturist said:
    Amelsfort said:
    I'm still having some issues controlling the Yeelights. Homey loses connection quite often. The Homey-app shows the lights as unavailable then, but when I open the official Yeelight-app, the lights are available. Afterwards, Homey is able to control them again.

    I'm aware of this but don't know how to solve it (at least not without having to introduce a polling mechanisms which I would like to avoid). I'll give it some love when I can find some free time.
    Have you updated to the latest firmware for the Yeelights? I have 5 of them (all fixed IP) and have no issues at all? Had it once a month or two ago: restarted Homey then. I hope this helps, because I would also like to avoid polling. Just introduces load and should not be needed :)

    Phuturist: is there some way I can help with the modes for the Mi Air Purifier (2)?
    Right now only on/off/auto/silent work, as others have mentioned. The one setting that should really work is "Favorite". With that you can set the speed once using the app and just go back to it later using your app :)

    I am willing to do some troubleshooting, but I am not a coder. I do work in IT :)
    If need be I can even drop by with the device to do some testing (depending on where you live that could take a while).
  • PhuturistPhuturist Member
    edited January 2018
    Mecallie said:
    Phuturist said:
    Amelsfort said:
    I'm still having some issues controlling the Yeelights. Homey loses connection quite often. The Homey-app shows the lights as unavailable then, but when I open the official Yeelight-app, the lights are available. Afterwards, Homey is able to control them again.

    I'm aware of this but don't know how to solve it (at least not without having to introduce a polling mechanisms which I would like to avoid). I'll give it some love when I can find some free time.
    Have you updated to the latest firmware for the Yeelights? I have 5 of them (all fixed IP) and have no issues at all? Had it once a month or two ago: restarted Homey then. I hope this helps, because I would also like to avoid polling. Just introduces load and should not be needed :)

    Phuturist: is there some way I can help with the modes for the Mi Air Purifier (2)?
    Right now only on/off/auto/silent work, as others have mentioned. The one setting that should really work is "Favorite". With that you can set the speed once using the app and just go back to it later using your app :)

    I am willing to do some troubleshooting, but I am not a coder. I do work in IT :)
    If need be I can even drop by with the device to do some testing (depending on where you live that could take a while).
    All my Yeelights are up-to-date with the latest firmware. The issue seems to mostly occurs for users that also use a power switch to completely power off the Yeelight. Is this also the case with you or are you only turning of the light with the built in "turn off" functionality.

    I will try to implement favorites for the Air Purifier in the next release of the app. It looks like the documentation I have used to built the app is not correct and that it should be possible to set the mode to favorite. I'll also add a card that will allow you set the speed of the favorite mode.
  • Phuturist said:
    Mecallie said:
    <snip>
    All my Yeelights are up-to-date with the latest firmware. The issue seems to mostly occurs for users that also use a power switch to completely power off the Yeelight. Is this also the case with you or are you only turning of the light with the built in "turn off" functionality.

    I will try to implement favorites for the Air Purifier in the next release of the app. It looks like the documentation I have used to built the app is not correct and that it should be possible to set the mode to favorite. I'll also add a card that will allow you set the speed of the favorite mode.
    Ah, that might be it. I no longer use the Yeelights with an on/off switch anymore, just for outside and automated lighting. Inside I use LIFX because of the higher lumen and much nicer colours. Maybe you can make the polling thingy optional then?

    The favorite mode would be sweet! :)
  • Latest version - 2018-01-17 - 2.4.2

    • FIX: some improvements for the Yeelights which will hopefully fix devices as appearing offline in Homey
    • UPDATE: added favorite mode as option for Air Purifiers
    • UPDATE: added card to set the speed of the favorite mode for Air Purifiers
  • Phuturist said:

    Latest version - 2018-01-17 - 2.4.2

    • FIX: some improvements for the Yeelights which will hopefully fix devices as appearing offline in Homey
    • UPDATE: added favorite mode as option for Air Purifiers
    • UPDATE: added card to set the speed of the favorite mode for Air Purifiers
    I just discovered an issue with the favorite mode for Air Purifier and have pushed a fix to the app store. Will probably be approved tomorrow.
  • Latest version - 2018-01-18 -- v2.4.3

    • FIX: fixed issue with setting the favorite mode for Air Purifiers
  • Good news, I'm bringing back support for the Mi Robot Vacuum Cleaner in the next version. Together with the author of the miio library we have figured out why it wasnt working anymore for most user after a certain firmware upgrade. This has been fixed in a new version of the library. The new version introduces a lot of changes so I'm gonna be needing beta testers for all devices except for the Yeelights (no changes) and Mi Robot Vacuum Cleaner (I'll test this myself).
  • Phuturist said:
    Good news, I'm bringing back support for the Mi Robot Vacuum Cleaner in the next version. Together with the author of the miio library we have figured out why it wasnt working anymore for most user after a certain firmware upgrade. This has been fixed in a new version of the library. The new version introduces a lot of changes so I'm gonna be needing beta testers for all devices except for the Yeelights (no changes) and Mi Robot Vacuum Cleaner (I'll test this myself).
    I have published release 2.5.0 to GitHub. Here is the change log:
    • UPDATE: updated the miio library to 0.15.5 and rewritten all device drivers
    • UPDATE: reintroduced support for the Mi Robot Vacuum Cleaner

    I'd really like to see some people that can test one of these devices and report back. I cant test any of these devices myself and would like to have some feedback before I push it to the app store.
    • Xiaomi Philips Light Bulbs, Xiaomi Philips Eyecare Lamp 2
    • Xiaomi Air Purifiers 2, 2S and Pro
    • Xiamomi Humidifier
    • Xiaomi Single Power Plug WiFi version
  • got the Phillips lights in my mailbox but im on holiday.   will test it on Friday 
  • I have the xiao mi fan and would love for this to be integrated... :)
  • AlanMccormickAlanMccormick Member
    edited February 2018
    I'm trying to setup a flow to turn on a Yeelight ceiling light replicating the "Night Mode". This appears to be significantly dimmer than 1% when set via a custom command or any other brightness cards.

    has anyone worked out a way to achieve activating the night mode (or dimming this low?)

    Edit: Should have read the docs, set_power has an optional 3rd parameter: 

    0: Normal turn on operation (default value)
     1: Turn on and switch to CT mode.
     2: Turn on and switch to RGB mode.
     3: Turn on and switch to HSV mode.
     4: Turn on and switch to color flow mode.
     5: Turn on and switch to Night light mode. (Ceiling light only).

    {"id":1,"method":"set_power","params":["on","smooth",500,5]}

    Any chance you could add an "enable night mode" card for us lazy people ;)
    Do you think it would be better to add the ceiling light as a separate device? I think it would help to remove the RGB stuff from the device control and cards.
  • PhuturistPhuturist Member
    edited February 2018

    Any chance you could add an "enable night mode" card for us lazy people ;)
    Do you think it would be better to add the ceiling light as a separate device? I think it would help to remove the RGB stuff from the device control and cards.
    I have thought about creating a separate driver but it would mean duplicating a lot of code. Creating a card for night mode also has it's disadvantages as this would only work for the latest gen ceiling light. I want to avoid having to explain this, the majority of the Yeelight users have standard bulbs. So you will just have to stick with custom commands. I'm doing this myself as well 
  • Ver 2.5.0 

    (node:19281) UnhandledPromiseRejectionWarning: Unhandled promise rejection (rejection id: 1): ReferenceError: reject is not defined
    (node:19281) [DEP0018] DeprecationWarning: Unhandled promise rejections are deprecated. In the future, promise rejections that are not handled will terminate the Node.js process with a non-zero exit code.
    (node:19281) UnhandledPromiseRejectionWarning: Unhandled promise rejection (rejection id: 2): ReferenceError: reject is not defined
    /app.js:103
    args.device.miio.setPower(true)
    ^

    TypeError: Cannot read property 'setPower' of undefined
    at FlowCardAction.Homey.FlowCardAction.register.registerRunListener [as _runListener] (/app.js:103:34)
    at FlowCardAction._onRun (/opt/homey-client/system/manager/ManagerApps/bootstrap/sdk/v2/lib/FlowCard.js:1:1191)
    at emitThree (events.js:136:13)
    at FlowCardAction.emit (events.js:217:7)
    at ManagerFlow._onRun (/opt/homey-client/system/manager/ManagerApps/bootstrap/sdk/v2/manager/flow.js:1:2274)
    at _eventListeners.filter.forEach.t (/opt/homey-client/system/manager/ManagerApps/bootstrap/sdk/v2/lib/HomeyClient.js:1:1219)
    at Array.forEach (<anonymous>)
    at HomeyClient._onMessage (/opt/homey-client/system/manager/ManagerApps/bootstrap/sdk/v2/lib/HomeyClient.js:1:1196)
    at emitTwo (events.js:126:13)
    at process.emit (events.js:214:7)

    Exit code: 1
    Exit signal: null
  • PhuturistPhuturist Member
    edited February 2018
    calambur said:
    Ver 2.5.0 

    (node:19281) UnhandledPromiseRejectionWarning: Unhandled promise rejection (rejection id: 1): ReferenceError: reject is not defined
    (node:19281) [DEP0018] DeprecationWarning: Unhandled promise rejections are deprecated. In the future, promise rejections that are not handled will terminate the Node.js process with a non-zero exit code.
    (node:19281) UnhandledPromiseRejectionWarning: Unhandled promise rejection (rejection id: 2): ReferenceError: reject is not defined
    /app.js:103
    args.device.miio.setPower(true)
    ^

    TypeError: Cannot read property 'setPower' of undefined
    at FlowCardAction.Homey.FlowCardAction.register.registerRunListener [as _runListener] (/app.js:103:34)
    at FlowCardAction._onRun (/opt/homey-client/system/manager/ManagerApps/bootstrap/sdk/v2/lib/FlowCard.js:1:1191)
    at emitThree (events.js:136:13)
    at FlowCardAction.emit (events.js:217:7)
    at ManagerFlow._onRun (/opt/homey-client/system/manager/ManagerApps/bootstrap/sdk/v2/manager/flow.js:1:2274)
    at _eventListeners.filter.forEach.t (/opt/homey-client/system/manager/ManagerApps/bootstrap/sdk/v2/lib/HomeyClient.js:1:1219)
    at Array.forEach (<anonymous>)
    at HomeyClient._onMessage (/opt/homey-client/system/manager/ManagerApps/bootstrap/sdk/v2/lib/HomeyClient.js:1:1196)
    at emitTwo (events.js:126:13)
    at process.emit (events.js:214:7)

    Exit code: 1
    Exit signal: null
    Thanx. When did you download the 2.5.0 version from GitHub? I updated it yesterday morning which might solve this issue. If you downloaded it after that there is still something that needs to be fixed.

    [edit]
    I have pushed another edit to GitHub, could you test it. It's in the master branch and this release: https://github.com/jghaanstra/com.xiaomi-miio/releases/tag/2.5.0-v4

    It would be great if you could use 'athom project --run' to see if there is debug logging.
  • I have updated the beta version of the app in the app store in the hope to get more feedback. Please consider trying it out and let me know any issues.

    Latest version - 2018-02-05 -- v2.5.1 (beta)

    • 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)
  • 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?
  • 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.
  • 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?
  • 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.
  • 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)
  • 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.
This discussion has been closed.