jghaanstra / com.xiaomi-miio

Homey app to control Mi Home devices that implement the miIO protocol and Xiaomi gateway child devices
GNU General Public License v3.0
455 stars 85 forks source link

DIM level not reported #111

Closed shaarkys closed 4 years ago

shaarkys commented 4 years ago

Hi,

is it works as desired, if I'm changing DIM via Xiaomi remote control but the DIM level is not updated back to Homey, meaning event event "DIM level changed"is not working - respective is working only when changing DIM in the Homey app itself? I have two lights in the bathroom (Xiaomi and Phillips Xiaomi downlight) and would like to get in sync DiM levels.

Thank you

jghaanstra commented 4 years ago

I cant see anything strange in the code. Do you know how to run the app from the command line? I could create debug version that might tell me more on what is going on.

shaarkys commented 4 years ago

Sure, let me know :-) Thank you

jghaanstra commented 4 years ago

Could you run this from command line with athom app run and let me know the output.

https://github.com/jghaanstra/com.xiaomi-miio/tree/debug

shaarkys commented 4 years ago

Thank you. Unfortunately I don't see anything / no output, after run, just got "2019-11-08 16:00:22 [log] [XiaomiMiioApp] Initializing Xiaomi Mi Home app ..." and even when turning on the lights, nothing happens / no output, no matter where/how I'm changing brightness. HOWEVER, I have new finding - seems the DIM status is updated ONLY if NO NIGHT mode is triggered. Would that help ?

jghaanstra commented 4 years ago

Now I'm lost, you told me the lights where Xiaomi Philips downlights. The night mode capability is only implemented for Yeelights. What type of lights are we talking about?

If you are talking about Yeelights I can understand there is no output on the console and I would have to start looking into this from scratch and supply you with another version to test. I added debug logging for the Philips downlights. If you are talking about the Philips downlight the only thing I can think of is that you have set the polling frequency to a high number.

Please be specific on what lights you are talking about (for instance with a model number or a product link).

shaarkys commented 4 years ago

Hi, appologies for that I was not clear. Via Remote control I'm DIMing "homey:app:com.xiaomi-miio — yeelights" (Xiaomi Yeelight Smart Ceiling Light Lamp) and based on reported value I'm DIMing "homey:app:com.xiaomi-miio — philips-bulb" (Philips Downlight) - this works only when the light is not in night mode, as I just realized. However the debug version wasn't providing even any output when I changed the DIM of Philips Downlight. the polling interval is already set to 5.

jghaanstra commented 4 years ago

Could you try the debug branch again and first change the DIM when not in night_mode and then change to night_mode and change the dim again. The console should spit out the raw updates from the light and I hope to see some difference between changing DIM in night_mode or not.

https://github.com/jghaanstra/com.xiaomi-miio/tree/debug

shaarkys commented 4 years ago

I don't know if I'm doing anything wrong but not matter which of the Yeelight light I change brightness, the console remain empty.

D:\TEMP++HOMEY++\debug2\com.xiaomi-miio-debug>athom app run ✓ Pre-processing app... ✓ Validating app... ✓ Homey App validated successfully against level debug ✓ Packing Homey App... — App size: 4.25 MB ✓ Installing Homey App on Sharkys's Homey (http://10.0.0.7:80)... ✓ Homey App com.xiaomi-miio successfully installed ✓ Running com.xiaomi-miio, press CTRL+C to quit — Profile your app's performance at https://go.athom.com/app-profiling?homey=5???????0b43e1b&app=com.xiaomi-miio ─────────────── Logging stdout & stderr ─────────────── 2019-11-09 16:04:07 [log] [XiaomiMiioApp] Initializing Xiaomi Mi Home app ...

shaarkys commented 4 years ago

Btw,got this when my flow activated night mode on all lights...

2019-11-09 16:13:14 [log] [ManagerDrivers] [yeelights] [1] Unable to process message because of error: SyntaxError: Unexpected token { in JSON at position 86 2019-11-09 16:13:14 [log] [ManagerDrivers] [yeelights] [0] Unable to process message because of error: SyntaxError: Unexpected token { in JSON at position 86 2019-11-09 16:13:14 [log] [ManagerDrivers] [yeelights] [4] Unable to process message because of error: SyntaxError: Unexpected token { in JSON at position 90

shaarkys commented 4 years ago

Btw, when looking on the debug branch, for sure I don't have Philips Eyecare, where it seems you enabled debug.

jghaanstra commented 4 years ago

I'm pretty sure I nailed it. Please check it.

https://github.com/jghaanstra/com.xiaomi-miio/releases/tag/2.13.2

shaarkys commented 4 years ago

Yep, working, thank you so much ! I found another issue, will be reporting another "bug" report (could be works as designed) but better to check.