Zacknetic / HomebridgeMagicHome-DynamicPlatform

Homebridge Plugin for MagicHome LED controllers and light bulbs
Apache License 2.0
61 stars 11 forks source link

Single Color WiFi Controller #16

Closed kevinjohncutler closed 4 years ago

kevinjohncutler commented 4 years ago

Hi, I decided to try out these single color wifi controllers and your plugin detects and adds them automatically, but does not seem to recognize that they are single color, essentially a dimmer. So in the Home app, I see options for choosing various colors like an RGB(W(W)) bulb, and the intensity slider has no effect. In Magic Home, there is a brightness annulus to adjust the intensity (idk why not a slider...). I imagine homekit must have a dimmer functionality built-in, and I just need to configure the right protocol for these devices. Any idea where I should start?

Zacknetic commented 4 years ago

There is no logic for dimmers currently in my code. I don't know what the protocol is at the moment. What you can do to help me add that logic is allow me to connect to your device and test it VIA wireshark. Alternatively you can use wireshark and some android emulator to tell me the protocol yourself.

With my help you can do it this way:

What to do next: In order for me to view your controller, I'll need you to complete the following steps:

1. Sign into my throwaway MagicHome account in your MagicHome "Pro" app

Click here to view poorly hidden login credentials

#### Username ``` magic.home.test@gmail.com ``` #### Password ``` testmagichome ```

2. Enable remote control for your device on that account

3. Change the color of my office light to red and then post here to let me know you're ready

4. Give me time to test your device

kevinjohncutler commented 4 years ago

Sorry for the delay, had to go into work. I've followed the above steps. If you get a chance, I'd love to know briefly how I'd use wireshark, but I imagine it is along the lines of installing and signing into magic home on an emulated andoind device and grabbing the right logs from wireshark.

kevinjohncutler commented 4 years ago

I noticed that after the "office light" was turned red it was turned off, so I'll play it safe and not keep toggling your light haha. Feel free to fiddle with it whenever, the device is just controlling some plant lighting right now. Thank you for your help.

Zacknetic commented 4 years ago

@kevinjohncutler Hey, thanks for doing that. I can now see your light. Just as you predicted, I will use an android emulator and look for the packets sent to the magichome server.

It's great because it uses the same protocol regardless of using local intranet or internet.

I'll be re-installing bluestacks now as I removed it from my system as I don't really trust it. I'll let you know once I have the data I need. Once that's done you should sign out of my account. But not yet.

Should have results tonight.

Zacknetic commented 4 years ago

@kevinjohncutler Okay so I've determined the protocol. Now I need a way of detecting its version. Can you please upload your homebridge.log. It should have the information I need. You said the device registers.

Zacknetic commented 4 years ago

Actually I think I've got it. But correct me if I'm wrong. The "lightVersionModifier" is listed as '33' correct?

kevinjohncutler commented 4 years ago

Looking for that now, will get it ASAP.

Sorry it is taking a while, I could not find that in the existing log, even after restarting homebridge, so I'm trying a reboot.

kevinjohncutler commented 4 years ago

Yep, Version Modifier is 33!

Zacknetic commented 4 years ago

Nailed it. Okay I think I'm nearly ready.

Zacknetic commented 4 years ago

The code is complete, uploaded, and merged with the master branch. But npm refuses to let me publish it. I have no idea why.

Here is the error... too tired to troubleshoot it right now. I'm sorry.

npm ERR! code E404 npm ERR! 404 Not Found - PUT https://registry.npmjs.org/homebridge-magichome-dynamic-platform - Not found npm ERR! 404 npm ERR! 404 'homebridge-magichome-dynamic-platform@1.3.0' is not in the npm registry. npm ERR! 404 You should bug the author to publish it (or use the name yourself!)

If you'd like, you can download and compile the code yourself. It's uploaded... Will work on it further tomorrow.

Zacknetic commented 4 years ago

@kevinjohncutler scratch that. NPM decided I wasn't logged in anymore?

First delete your cached accessories if possible. Otherwise the dimmer will be of the wrong type. Then please update the plugin in config ui x, restart homebridge, and test it out. Let me know how it goes!

kevinjohncutler commented 4 years ago

Thanks for working so late on this! I knocked out at 1 haha.

I didn't see your most recent comments, so I updated and restarted homebridge first, realized it wasn't working, then removed all cached devices and restarted. It wasn't finding all the devices (four bulbs and one of these LED wifi controllers), and so I uninstalled your plugin, restarted, then reinstalled+restarted. It now finds all 4 bulbs (though curiously only one is registered as RBGWW, others as RBGW... I guess that is 53 vs 68 in the logs? They should be identical.), but the LED controller no longer registers after it is found.

Here is the relevant part of the log. I imagine the error at the bottom will be useful.

[8/5/2020, 17:24:08] [homebridge-magichome-dynamic-platform] Found 5 devices.

[TuyaDiscovery] UDP from 192.168.1.20:6667 0x000055aa...0x0000aa55 [8/5/2020, 17:24:08] [TuyaLan] Discovered Entry Light (eb8d6215d6f7765a3bslfr) identified as SimpleLight (3.3) [TuyaAccessory] Changing ping gap for Entry Light to 9s HAP Warning: Characteristic 000000E3-0000-1000-8000-0026BB765291 not in required or optional characteristics for service 00000043-0000-1000-8000-0026BB765291. Adding anyway. [8/5/2020, 17:24:09] [homebridge-magichome-dynamic-platform] Registering new accessory 'RGBW Non-Simultanious' Model: 'AK001-ZJ200' Unique ID: '600194B374F1' IP-Address: '192.168.1.18' Version 8 Version Modifier: 68

[8/5/2020, 17:24:09] [TuyaLan] Connected to Entry Light [TuyaAccessory] Sending first query to Entry Light (3.3) HAP Warning: Characteristic 000000E3-0000-1000-8000-0026BB765291 not in required or optional characteristics for service 00000043-0000-1000-8000-0026BB765291. Adding anyway. [8/5/2020, 17:24:09] [homebridge-magichome-dynamic-platform] Registering new accessory 'RGBWW Non-Simultanious' Model: 'AK001-ZJ200' Unique ID: '600194B3B472' IP-Address: '192.168.1.16' Version 5 Version Modifier: 53

HAP Warning: Characteristic 000000E3-0000-1000-8000-0026BB765291 not in required or optional characteristics for service 00000043-0000-1000-8000-0026BB765291. Adding anyway. [8/5/2020, 17:24:09] [homebridge-magichome-dynamic-platform] Registering new accessory 'RGBW Non-Simultanious' Model: 'AK001-ZJ200' Unique ID: '600194B3BB90' IP-Address: '192.168.1.19' Version 8 Version Modifier: 68

[TuyaAccessory] Entry Light (3.3) didn't respond with its current state. [8/5/2020, 17:24:10] [TuyaLan] Ready to handle Entry Light (SimpleLight:3.3) with signature {} HAP Warning: Characteristic 000000E3-0000-1000-8000-0026BB765291 not in required or optional characteristics for service 00000043-0000-1000-8000-0026BB765291. Adding anyway. [8/5/2020, 17:24:10] [homebridge-magichome-dynamic-platform] Registering new accessory 'RGBW Non-Simultanious' Model: 'AK001-ZJ200' Unique ID: '600194B37558' IP-Address: '192.168.1.17' Version 8 Version Modifier: 68

[8/5/2020, 17:24:10] [homebridge-magichome-dynamic-platform] TypeError: accessoryType[updatedDevice.controller] is not a constructor at HomebridgeMagichomeDynamicPlatform.discoverDevices (/usr/lib/node_modules/homebridge-magichome-dynamic-platform/src/platform.ts:245:11) at processTicksAndRejections (internal/process/task_queues.js:97:5) [8/5/2020, 17:24:10] [homebridge-magichome-dynamic-platform] Registered 4 Magichome device(s). New devices: 4 Cached devices that were seen this restart: 0 Cached devices that were not seen this restart: 0

Zacknetic commented 4 years ago

This log indicates it could be the second restart after deleting the accessories since I am missing some information.

Could you help me out by doing the following: rename your Homebridge.log to Homebridge.log.old > delete the accessories folder > restart Homebridge > upload that new log

Hopefully this will shed some more light, but it's as if it doesn't know what device type it is.

Edit* please upload your log or an edited version of your log instead of pasting directly into the text editor.

As for your RGBWW device, in the magichome app does the color wheel show warm white and cold white in the center for that device?

kevinjohncutler commented 4 years ago

Interesting - now that I've done that, it has registered as a RGBWW device. Here is the log:

Log Loading logs using native method... File: /var/lib/homebridge/homebridge.log [8/5/2020, 19:22:31] [HB Supervisor] OS: Linux 4.19.97-v7+ arm [8/5/2020, 19:22:31] [HB Supervisor] Node.js v12.16.3 /usr/bin/node [8/5/2020, 19:22:31] [HB Supervisor] Homebridge Path: /usr/lib/node_modules/homebridge/bin/homebridge [8/5/2020, 19:22:31] [HB Supervisor] UI Path: /usr/lib/node_modules/homebridge-config-ui-x/dist/bin/standalone.js [8/5/2020, 19:22:31] [HB Supervisor] Starting Homebridge with extra flags: -I [8/5/2020, 19:22:31] [HB Supervisor] Started Homebridge v1.1.1 with PID: 796 [8/5/2020, 19:22:33] Loaded config.json with 0 accessories and 4 platforms. [8/5/2020, 19:22:33] --- [8/5/2020, 19:22:35] Loaded plugin: homebridge-config-ui-x@4.24.0 [8/5/2020, 19:22:35] Registering platform 'homebridge-config-ui-x.config' [8/5/2020, 19:22:35] --- [8/5/2020, 19:22:36] Loaded plugin: homebridge-magichome-dynamic-platform@1.3.2 [8/5/2020, 19:22:36] Registering platform 'homebridge-magichome-dynamic-platform.homebridge-magichome-dynamic-platform' [8/5/2020, 19:22:36] --- [8/5/2020, 19:22:36] Loaded plugin: homebridge-tplink-smarthome@5.1.0 [8/5/2020, 19:22:36] Registering platform 'homebridge-tplink-smarthome.TplinkSmarthome' [8/5/2020, 19:22:36] --- [8/5/2020, 19:22:36] Loaded plugin: homebridge-tuya-platform@1.1.1 [8/5/2020, 19:22:36] Registering platform 'homebridge-tuya-platform.TuyaLan' [8/5/2020, 19:22:36] --- [8/5/2020, 19:22:36] Loading 4 platforms... [8/5/2020, 19:22:36] [Config] Initializing config platform... [8/5/2020, 19:22:36] [Config] Running in Service Mode [8/5/2020, 19:22:36] [TplinkSmarthome] Initializing TplinkSmarthome platform... [8/5/2020, 19:22:36] [TplinkSmarthome] homebridge-tplink-smarthome v5.1.0, node v12.16.3, homebridge v1.1.1 [8/5/2020, 19:22:36] [TuyaLan] Initializing TuyaLan platform... [8/5/2020, 19:22:36] [homebridge-magichome-dynamic-platform] Initializing homebridge-magichome-dynamic-platform platform... [8/5/2020, 19:22:36] [TplinkSmarthome] Configuring cached accessory: [lampy] 8006AE8ADBE032229011BA20A9F09EE318640B70 d9dc6e2f-4858-4478-8f5d-63d3ee849f8f [8/5/2020, 19:22:36] [TplinkSmarthome] Configuring cached accessory: [TP-LINK_Smart Switch_EC40] undefined c9975c98-5db8-4ee9-b92c-a808473f3fb7 [8/5/2020, 19:22:36] [TuyaLan] Marked Kitchen Light unreachable by faulting Service.Kitchen Light.On [8/5/2020, 19:22:36] [TuyaLan] Marked Entry Light unreachable by faulting Service.Entry Light.On [8/5/2020, 19:22:36] [TuyaLan] Starting discovery... [TuyaDiscovery] Discovery started on port 6666. [TuyaDiscovery] Discovery started on port 6667. [8/5/2020, 19:22:36] [homebridge-magichome-dynamic-platform] Scanning broadcast-address: '192.168.1.255' on interface: 'eth0' for Magichome lights... Setup Payload: X-HM://0023ISYWY4CM6 Enter this code with your HomeKit app on your iOS device to pair with Homebridge: ┌────────────┐ │ 031-45-154 │ └────────────┘ [8/5/2020, 19:22:36] Homebridge is running on port 51340. [8/5/2020, 19:22:36] [TplinkSmarthome] New Device Online: [Desk Plug] plug [8006AE8ADBE032229011BA20A9F09EE318640B70] 192.168.1.53 9999 [8/5/2020, 19:22:36] [TplinkSmarthome] Adding: [Desk Plug] plug [8006AE8ADBE032229011BA20A9F09EE318640B70] [8/5/2020, 19:22:37] [homebridge-config-ui-x] Starting Nest application... [8/5/2020, 19:22:38] [homebridge-config-ui-x] ConfigModule dependencies initialized [8/5/2020, 19:22:38] [homebridge-config-ui-x] LoggerModule dependencies initialized [8/5/2020, 19:22:38] [homebridge-config-ui-x] PassportModule dependencies initialized [8/5/2020, 19:22:38] [homebridge-config-ui-x] CustomPluginsModule dependencies initialized [8/5/2020, 19:22:38] [homebridge-config-ui-x] PlatformToolsModule dependencies initialized [8/5/2020, 19:22:39] [homebridge-config-ui-x] JwtModule dependencies initialized [8/5/2020, 19:22:39] [homebridge-config-ui-x] AppModule dependencies initialized [8/5/2020, 19:22:39] [homebridge-config-ui-x] LogModule dependencies initialized [8/5/2020, 19:22:39] [homebridge-config-ui-x] AccessoriesModule dependencies initialized [8/5/2020, 19:22:39] [homebridge-config-ui-x] TerminalModule dependencies initialized [8/5/2020, 19:22:39] [homebridge-config-ui-x] HomebridgeHueModule dependencies initialized [8/5/2020, 19:22:39] [homebridge-config-ui-x] HbServiceModule dependencies initialized [8/5/2020, 19:22:39] [homebridge-config-ui-x] ConfigEditorModule dependencies initialized [8/5/2020, 19:22:39] [homebridge-config-ui-x] HomebridgeRingModule dependencies initialized [8/5/2020, 19:22:39] [homebridge-config-ui-x] LinuxModule dependencies initialized [8/5/2020, 19:22:39] [homebridge-config-ui-x] DockerModule dependencies initialized [8/5/2020, 19:22:39] [homebridge-config-ui-x] UsersModule dependencies initialized [8/5/2020, 19:22:39] [homebridge-config-ui-x] ServerModule dependencies initialized [8/5/2020, 19:22:39] [homebridge-config-ui-x] PluginsModule dependencies initialized [8/5/2020, 19:22:39] [homebridge-config-ui-x] StatusModule dependencies initialized [8/5/2020, 19:22:39] [homebridge-config-ui-x] AuthModule dependencies initialized [8/5/2020, 19:22:39] [homebridge-config-ui-x] BackupModule dependencies initialized [8/5/2020, 19:22:39] [homebridge-config-ui-x] The "setBasePath" method has been deprecated. Now, a global prefix is populated automatically. If you want to ignore it, take a look here: https://docs.nestjs.com/recipes/swagger#global-prefix. Alternatively, you can use "addServer" method to set up multiple different paths. [8/5/2020, 19:22:39] [Config] Homebridge Config UI X v4.24.0 is listening on :: port 8080 [8/5/2020, 19:22:40] [homebridge-config-ui-x] AppController {/api}: [8/5/2020, 19:22:40] [homebridge-config-ui-x] Mapped {/api, GET} route [8/5/2020, 19:22:40] [homebridge-config-ui-x] AuthController {/api/auth}: [8/5/2020, 19:22:40] [homebridge-config-ui-x] Mapped {/api/auth/login, POST} route [8/5/2020, 19:22:40] [homebridge-config-ui-x] Mapped {/api/auth/settings, GET} route [8/5/2020, 19:22:40] [homebridge-config-ui-x] Mapped {/api/auth/wallpaper/:hash, GET} route [8/5/2020, 19:22:40] [homebridge-config-ui-x] Mapped {/api/auth/noauth, POST} route [8/5/2020, 19:22:40] [homebridge-config-ui-x] Mapped {/api/auth/check, GET} route [8/5/2020, 19:22:40] [homebridge-config-ui-x] ServerController {/api/server}: [8/5/2020, 19:22:40] [homebridge-config-ui-x] Mapped {/api/server/restart, PUT} route [8/5/2020, 19:22:40] [homebridge-config-ui-x] Mapped {/api/server/qrcode.svg, GET} route [8/5/2020, 19:22:40] [homebridge-config-ui-x] Mapped {/api/server/reset-homebridge-accessory, PUT} route [8/5/2020, 19:22:40] [homebridge-config-ui-x] Mapped {/api/server/reset-cached-accessories, PUT} route [8/5/2020, 19:22:40] [homebridge-config-ui-x] Mapped {/api/server/cached-accessories, GET} route [8/5/2020, 19:22:40] [homebridge-config-ui-x] Mapped {/api/server/cached-accessories/:uuid, DELETE} route [8/5/2020, 19:22:40] [homebridge-config-ui-x] Mapped {/api/server/pairings, GET} route [8/5/2020, 19:22:40] [homebridge-config-ui-x] Mapped {/api/server/pairings/:deviceId, DELETE} route [8/5/2020, 19:22:40] [homebridge-config-ui-x] ConfigEditorController {/api/config-editor}: [8/5/2020, 19:22:40] [homebridge-config-ui-x] Mapped {/api/config-editor, GET} route [8/5/2020, 19:22:40] [homebridge-config-ui-x] Mapped {/api/config-editor, POST} route [8/5/2020, 19:22:40] [homebridge-config-ui-x] Mapped {/api/config-editor/backups, GET} route [8/5/2020, 19:22:40] [homebridge-config-ui-x] Mapped {/api/config-editor/backups/:backupId(\d+), GET} route [8/5/2020, 19:22:40] [homebridge-config-ui-x] Mapped {/api/config-editor/backups, DELETE} route [8/5/2020, 19:22:40] [homebridge-config-ui-x] PluginsController {/api/plugins}: [8/5/2020, 19:22:40] [homebridge-config-ui-x] Mapped {/api/plugins, GET} route [8/5/2020, 19:22:40] [homebridge-config-ui-x] Mapped {/api/plugins/search/:query, GET} route [8/5/2020, 19:22:40] [homebridge-config-ui-x] Mapped {/api/plugins/config-schema/:pluginName, GET} route [8/5/2020, 19:22:40] [homebridge-config-ui-x] Mapped {/api/plugins/changelog/:pluginName, GET} route [8/5/2020, 19:22:40] [homebridge-config-ui-x] Mapped {/api/plugins/release/:pluginName, GET} route [8/5/2020, 19:22:40] [homebridge-config-ui-x] HomebridgeRingController {/api/plugins/custom-plugins/homebridge-ring}: [8/5/2020, 19:22:40] [homebridge-config-ui-x] Mapped {/api/plugins/custom-plugins/homebridge-ring/exchange-credentials, POST} route [8/5/2020, 19:22:40] [homebridge-config-ui-x] HomebridgeHueController {/api/plugins/custom-plugins/homebridge-hue}: [8/5/2020, 19:22:40] [homebridge-config-ui-x] Mapped {/api/plugins/custom-plugins/homebridge-hue/dump-file, GET} route [8/5/2020, 19:22:40] [homebridge-config-ui-x] UsersController {/api/users}: [8/5/2020, 19:22:40] [homebridge-config-ui-x] Mapped {/api/users, GET} route [8/5/2020, 19:22:40] [homebridge-config-ui-x] Mapped {/api/users, POST} route [8/5/2020, 19:22:40] [homebridge-config-ui-x] Mapped {/api/users/:userId(\d+), PATCH} route [8/5/2020, 19:22:40] [homebridge-config-ui-x] Mapped {/api/users/:userId(\d+), DELETE} route [8/5/2020, 19:22:40] [homebridge-config-ui-x] Mapped {/api/users/change-password, POST} route [8/5/2020, 19:22:40] [homebridge-config-ui-x] Mapped {/api/users/otp/setup, POST} route [8/5/2020, 19:22:40] [homebridge-config-ui-x] Mapped {/api/users/otp/activate, POST} route [8/5/2020, 19:22:40] [homebridge-config-ui-x] Mapped {/api/users/otp/deactivate, POST} route [8/5/2020, 19:22:40] [homebridge-config-ui-x] StatusController {/api/status}: [8/5/2020, 19:22:40] [homebridge-config-ui-x] Mapped {/api/status/cpu, GET} route [8/5/2020, 19:22:40] [homebridge-config-ui-x] Mapped {/api/status/ram, GET} route [8/5/2020, 19:22:40] [homebridge-config-ui-x] Mapped {/api/status/uptime, GET} route [8/5/2020, 19:22:40] [homebridge-config-ui-x] Mapped {/api/status/homebridge, GET} route [8/5/2020, 19:22:40] [homebridge-config-ui-x] Mapped {/api/status/server-information, GET} route [8/5/2020, 19:22:40] [homebridge-config-ui-x] Mapped {/api/status/nodejs, GET} route [8/5/2020, 19:22:40] [homebridge-config-ui-x] LinuxController {/api/platform-tools/linux}: [8/5/2020, 19:22:40] [homebridge-config-ui-x] Mapped {/api/platform-tools/linux/restart-host, PUT} route [8/5/2020, 19:22:40] [homebridge-config-ui-x] Mapped {/api/platform-tools/linux/shutdown-host, PUT} route [8/5/2020, 19:22:40] [homebridge-config-ui-x] DockerController {/api/platform-tools/docker}: [8/5/2020, 19:22:40] [homebridge-config-ui-x] Mapped {/api/platform-tools/docker/startup-script, GET} route [8/5/2020, 19:22:40] [homebridge-config-ui-x] Mapped {/api/platform-tools/docker/startup-script, PUT} route [8/5/2020, 19:22:40] [homebridge-config-ui-x] Mapped {/api/platform-tools/docker/restart-container, PUT} route [8/5/2020, 19:22:40] [homebridge-config-ui-x] Mapped {/api/platform-tools/docker/env, GET} route [8/5/2020, 19:22:40] [homebridge-config-ui-x] Mapped {/api/platform-tools/docker/env, PUT} route [8/5/2020, 19:22:40] [homebridge-config-ui-x] HbServiceController {/api/platform-tools/hb-service}: [8/5/2020, 19:22:40] [homebridge-config-ui-x] Mapped {/api/platform-tools/hb-service/homebridge-startup-settings, GET} route [8/5/2020, 19:22:40] [homebridge-config-ui-x] Mapped {/api/platform-tools/hb-service/homebridge-startup-settings, PUT} route [8/5/2020, 19:22:40] [homebridge-config-ui-x] Mapped {/api/platform-tools/hb-service/set-full-service-restart-flag, PUT} route [8/5/2020, 19:22:40] [homebridge-config-ui-x] BackupController {/api/backup}: [8/5/2020, 19:22:40] [homebridge-config-ui-x] Mapped {/api/backup/download, GET} route [8/5/2020, 19:22:40] [homebridge-config-ui-x] Mapped {/api/backup/restore, POST} route [8/5/2020, 19:22:40] [homebridge-config-ui-x] Mapped {/api/backup/restore/hbfx, POST} route [8/5/2020, 19:22:40] [homebridge-config-ui-x] Mapped {/api/backup/restart, PUT} route [8/5/2020, 19:22:40] [homebridge-config-ui-x] Nest application successfully started [1596651761362] INFO (697 on raspberrypi): Server listening at http://[::]:8080 [TuyaDiscovery] UDP from 192.168.1.20:6667 0x000055aa...0x0000aa55 [8/5/2020, 19:22:37] [TuyaLan] Discovered Entry Light (eb8d6215d6f7765a3bslfr) identified as SimpleLight (3.3) [TuyaAccessory] Changing ping gap for Entry Light to 9s [8/5/2020, 19:22:37] [TuyaLan] Connected to Entry Light [TuyaAccessory] Sending first query to Entry Light (3.3) [TuyaAccessory] Entry Light (3.3) didn't respond with its current state. [8/5/2020, 19:22:38] [TuyaLan] Ready to handle Entry Light (SimpleLight:3.3) with signature {} [8/5/2020, 19:22:38] [homebridge-magichome-dynamic-platform] Found 5 devices. [8/5/2020, 19:22:38] [homebridge-magichome-dynamic-platform] Registering cached accessory 'RGBW Non-Simultanious' Model: 'AK001-ZJ200' Unique ID: '600194B374F1' IP-Address: '192.168.1.18' Version 8 Version Modifier: 68 [8/5/2020, 19:22:38] [homebridge-magichome-dynamic-platform] Registering cached accessory 'RGBW Non-Simultanious' Model: 'AK001-ZJ200' Unique ID: '600194B3BB90' IP-Address: '192.168.1.19' Version 8 Version Modifier: 68 [8/5/2020, 19:22:38] [homebridge-magichome-dynamic-platform] Registering cached accessory 'RGBW Non-Simultanious' Model: 'AK001-ZJ200' Unique ID: '600194B37558' IP-Address: '192.168.1.17' Version 8 Version Modifier: 68 [8/5/2020, 19:22:38] [homebridge-magichome-dynamic-platform] Registering cached accessory 'RGBWW Non-Simultanious' Model: 'AK001-ZJ200' Unique ID: '600194B3B472' IP-Address: '192.168.1.16' Version 5 Version Modifier: 53 [8/5/2020, 19:22:38] [homebridge-magichome-dynamic-platform] Registering cached accessory 'RGBWW Simultanious' Model: 'AK001-ZJ2101' Unique ID: 'D8F15BF6C69A' IP-Address: '192.168.1.67' Version 2 Version Modifier: 33 [8/5/2020, 19:22:38] [homebridge-magichome-dynamic-platform] Registered 5 Magichome device(s). New devices: 0 Cached devices that were seen this restart: 5 Cached devices that were not seen this restart: 0 [TuyaDiscovery] UDP from 192.168.1.54:6667 0x000055aa...0x0000aa55 [8/5/2020, 19:22:40] [TuyaLan] Discovered Kitchen Light (ebc42fac6626b14b38u9dt) identified as SimpleLight (3.3) [TuyaAccessory] Changing ping gap for Kitchen Light to 9s [1596651762388] INFO (697 on raspberrypi): incoming request reqId: 1 req: { "method": "GET", "url": "/api/auth/check", "hostname": "raspberrypi.local:8080", "remoteAddress": "fe80::445:59ae:3f1e:1aec", "remotePort": 62316 } [1596651762437] INFO (697 on raspberrypi): request completed reqId: 1 res: { "statusCode": 200 } responseTime: 46.35630200000014 [1596651762545] INFO (697 on raspberrypi): incoming request reqId: 2 req: { "method": "GET", "url": "/api/server/qrcode.svg", "hostname": "raspberrypi.local:8080", "remoteAddress": "fe80::445:59ae:3f1e:1aec", "remotePort": 62317 } [1596651762641] INFO (697 on raspberrypi): request completed reqId: 2 res: { "statusCode": 200 } responseTime: 94.28666599999997 [TuyaDiscovery] UDP from 192.168.1.20:6667 0x000055aa...0x0000aa55 [8/5/2020, 19:22:42] [TuyaLan] Connected to Kitchen Light [TuyaAccessory] Sending first query to Kitchen Light (3.3) [TuyaAccessory] Kitchen Light (3.3) didn't respond with its current state. [8/5/2020, 19:22:42] [TuyaLan] Ready to handle Kitchen Light (SimpleLight:3.3) with signature {} [TuyaDiscovery] UDP from 192.168.1.54:6667 0x000055aa...0x0000aa55 [TuyaDiscovery] UDP from 192.168.1.20:6667 0x000055aa...0x0000aa55 [TuyaDiscovery] UDP from 192.168.1.54:6667 0x000055aa...0x0000aa55 [TuyaDiscovery] UDP from 192.168.1.20:6667 0x000055aa...0x0000aa55 [TuyaDiscovery] UDP from 192.168.1.54:6667 0x000055aa...0x0000aa55 [TuyaDiscovery] UDP from 192.168.1.20:6667 0x000055aa...0x0000aa55 [TuyaDiscovery] UDP from 192.168.1.54:6667 0x000055aa...0x0000aa55 [TuyaDiscovery] UDP from 192.168.1.20:6667 0x000055aa...0x0000aa55 [TuyaDiscovery] UDP from 192.168.1.54:6667 0x000055aa...0x0000aa55 [TuyaDiscovery] UDP from 192.168.1.20:6667 0x000055aa...0x0000aa55 [TuyaDiscovery] UDP from 192.168.1.54:6667 0x000055aa...0x0000aa55 [TuyaDiscovery] UDP from 192.168.1.20:6667 0x000055aa...0x0000aa55 [TuyaDiscovery] UDP from 192.168.1.54:6667 0x000055aa...0x0000aa55 [TuyaDiscovery] UDP from 192.168.1.20:6667 0x000055aa...0x0000aa55 [TuyaDiscovery] UDP from 192.168.1.54:6667 0x000055aa...0x0000aa55 [TuyaDiscovery] UDP from 192.168.1.20:6667 0x000055aa...0x0000aa55 [TuyaDiscovery] UDP from 192.168.1.54:6667 0x000055aa...0x0000aa55 [TuyaDiscovery] UDP from 192.168.1.20:6667 0x000055aa...0x0000aa55 [TuyaDiscovery] UDP from 192.168.1.54:6667 0x000055aa...0x0000aa55 [TuyaDiscovery] UDP from 192.168.1.20:6667 0x000055aa...0x0000aa55 [TuyaDiscovery] UDP from 192.168.1.54:6667 0x000055aa...0x0000aa55 [TuyaDiscovery] UDP from 192.168.1.20:6667 0x000055aa...0x0000aa55
kevinjohncutler commented 4 years ago

As to the RGBW vs RGBWW topic, the magichome app does indeed show warm white as well as cold white inside the color when for each of these (identical) bulbs. However, only the Three that hsow up as RGBW are behaving "as normal" - Which makes sense, because it turns out that these bulbs only have dedicated white LEDs for the warm white setting, and use the RGB array for the cool white. The one registered as RGBWW is unresponsive to homekit commands to change color.

The single-color LED controller that is showing up as RGBWW also only works for power and dimming when its 'color' in homekit is changed to red, I'm guessing because it is monochrome and the first channel.

Zacknetic commented 4 years ago

[8/5/2020, 19:22:38] [homebridge-magichome-dynamic-platform] Registering cached accessory 'RGBWW Simultanious' Model: 'AK001-ZJ2101' Unique ID: 'D8F15BF6C69A' IP-Address: '192.168.1.67' Version 2 Version Modifier: 33

The version modifier is 33. There is logic to set the light type but it's as if it's skipping that part of the code.

Registered 5 Magichome device(s). New devices: 0 Cached devices that were seen this restart: 5 Cached devices that were not seen this restart: 0

This indicates that this is not the first restart since deleting the accessories as there are 0 new devices. Ensure that you are deleting the actual accessories folder instead of using ui x's built in UI.

I've updated the code with better logging and a slight change in the way the "lightType" is set. Updating may help shed some light.

enable debugging in config UI X > update homebridge-magichome-dynamic-platform > delete /rename log > delete accessories folder > restart homebridge

Hopefully this will have a better result. If not, please @Zacknetic in the Magichome development discord channel and we can coordinate a good time to work on this together.

kevinjohncutler commented 4 years ago

Ok, so I removed the plugin, refreshed homebridge, deleted the accessories and renamed the log, re-installed the latest version of the plugin, and instead of restarting homebridge from the UI (it seems not to be able to create a new log file that way for some reason) I restarted the pi on which homebridge is running. Here is the resulting log when it all starts fresh. Evidently all five devices are found, but only two are registered.

homebridge.log

Zacknetic commented 4 years ago

Dimmer controller feature was completed by adding new logic and changing the base "platformAccessory" class to only include On/Off and Brightness characteristics. Closing issue as feature is complete. Thank you very much!