Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

[BUG] New Firmware v10 bulbs aren't being added to HomeBridge #140

Open
xstefanx opened this issue Sep 8, 2023 · 15 comments
Open

[BUG] New Firmware v10 bulbs aren't being added to HomeBridge #140

xstefanx opened this issue Sep 8, 2023 · 15 comments
Assignees
Labels
bug Something isn't working new controller type A new type of controller needs additional logic

Comments

@xstefanx
Copy link

xstefanx commented Sep 8, 2023

Logs

homebridge.log

Describe the bug

I setup a couple of new light bulbs in magic home last night and they've not been added to homebridge after 3 reboots and 12+ hours now. Sometimes my devices take some time to show up, it's always been that way, but generally by now they'd have been added.

To Reproduce

Steps to reproduce the behavior:

  1. Add devices to magic home
  2. reboot homebridge
  3. see that devices were not added

Expected behavior

Based on the configs, and documentation, new devices should be added on the first reboot of the server, or within the rescan period from your configs.

"This plugin automatically detects MagicHome bulbs and controllers just like the Magichome app, and it should do so when you first run Homebridge. No more setting individual IP addresses per device."

"Rescan the network for new devices every 30 seconds."

Additional context

These bulbs are new to me, I'd had different brands in the past, but they work as expected in the same way withing MagicHome. The only difference I noted is that they're running a V10 firmware where the previous ones were running v7.

Host Hardware

  • Hardware: Unraid Server
  • OS: Unraid
  • OS Version: 6.12.3
  • Docker: SiwatINC/homebridge_gui

Homebridge and MagicHome

Screenshots

https://cdn.discordapp.com/attachments/138409093131010048/1149695818312458301/image.png
https://cdn.discordapp.com/attachments/138409093131010048/1149695962688782377/image.png
https://cdn.discordapp.com/attachments/138409093131010048/1149711383852744734/image.png
https://cdn.discordapp.com/attachments/138409093131010048/1149711709951504464/image.png

@xstefanx xstefanx added the bug Something isn't working label Sep 8, 2023
@Zacknetic
Copy link
Owner

Zacknetic commented Sep 8, 2023

Hey, thanks for reporting the bug and the very detailed report.

A couple questions:

  1. Have you had older versioned bulbs work with this setup and the plugin (not the app) in the past?
  2. Are the bulbs on the same subnet as the homebridge server? I notice you are using unraid and docker.

A few troubleshooting options:

  1. If you are willing, could you setup the plugin on non VM environment? This will help us determine if it's a subnet issue.
  2. The V-10 might have an updated UDP response which I have resolved in the alpha version, could you please install alpha.3? This version is very new, missing some features, and has bugs but it may shed some light on the issue.

Let me know how the above suggestions work out. Thank you.

edit: grammar

@Zacknetic Zacknetic added the new controller type A new type of controller needs additional logic label Sep 8, 2023
@xstefanx
Copy link
Author

xstefanx commented Sep 8, 2023

  1. Have you had older versioned bulbs work with this setup and the plugin (not the app) in the past?
    

I have 4 other bulbs currently running using the plugin. I actually was replacing 3 that were starting to flicker with these new ones, so there were actually 7 setup and working prior to last night.

  1. Are the bulbs on the same subnet as the homebridge server? I notice you are using unraid and docker.
    

Same subnet as the unraid server. The docker is setup in host mode, which lets the container use the servers IP/network, so it should be setup in the same subnet yes.

  1. If you are willing, could you setup the plugin on non VM environment? This will help us determine if it's a subnet issue.
    

I'd need to look into the how on this, but I could probably attempt this and get back to you if this other stuff doesn't work, though I think that this shouldn't be a subnet issue since other lights in the same subnet are able to connect to the plugin fine.

  1. The V-10 might have an updated UDP response which I have resolved in the alpha version, could you please install alpha.3? This version is very new, missing some features, and has bugs but it may shed some light on the issue.
    

I'd be willing to give this a shot. I know I was one of the ones who had issue last week when some alpha changes got pushed to prod, but should be able to roll them back like I did last week if needed. Though, I'm not entirely certain how to get to this version, would you be able to guide me on that? How do I switch from using homebridge-magichome-dynamic-platform to pull the alpha version?

@Zacknetic
Copy link
Owner

Zacknetic commented Sep 8, 2023

Considering your response and after closer inspection of your logs, I can see at least 1 device loading. Let's skip the non-VM troubleshooting for now. I also now realize that you submitted the previous issue as well.

Let's move forward with the alpha.3 installation:

  1. Please backup your accessories.
  2. Delete your Magichome accessories so they start fresh. This may involve uninstalling the Magichome plugin.
  3. Once that is done you could go into plugins>Magichome-Plugin>Gear Icon>
    image
  4. install alternate version>v2.0.0-alpha.3 - alpha
    image
  5. restart homebridge

Note* Please backup your devices or VM because the alpha causes old MH Homebridge accessories to become non-backwards compatible.

Let's see if this works. If it does, you'll still face the same issues that you faced when I accidentally updated alpha to release so we'll have to figure that out. If not, I may ask you to download a node program to get the raw data back from the devices which you'll need to clone from GitHub.

Edit: added step
Edit*: added another step to ensure that old versions are purged

@xstefanx
Copy link
Author

xstefanx commented Sep 8, 2023

That actually looks to have worked. With alpha last week I was crashing on startup, which doesn't appear to be happening now which is good. All 7 of my bulbs, including the 3 on v10 were discovered and are showing in accessories now.

homebridge.log

I am however seeing the issue that richie was seeing in #138 where if you use the dimmer it makes the bulbs unresponsive in home. No crashing though, just that bulb is no longer usable.

@Zacknetic
Copy link
Owner

I was not observing that the bulbs become unresponsive but instead that they were being set as "off" if the plugin didn't receive a response fast enough. Is that what you were observing?

I have updated the alpha to alpha.4 which removes the somewhat overzealous setting bulbs to offline. Keep in mind that this version is still somewhat bug prone and possibly missing features. Let me know how it works for you however.

@xstefanx
Copy link
Author

xstefanx commented Sep 8, 2023

I think alpha.4 is mostly working. I've experienced some weird things since moving to it, but as you've said that's maybe to be expected.

  1. After editing a device or two in home to change room location and name, it and other magichome devices will be come uneditable. Can't change name/room/groups restarting home bridge seems to resolve temporarily, long enough at least that it only took 3 reboots to get all 7 named and in the right location/group. On and off still work in this state as best I can tell.
  2. Current status seems to be defaulting to off. As in the viewable status in home or homebridge will show off more often than not when the devices are actually on. This is present on both v7 and v10 firmware, with the exception of one of the v10s. Very strangely, that one device seems to display the correct info at all times so far.
  3. Devices are showing as unreachable in the log on startup. Names seem to sometimes be the name I've given in homebridge, and sometimes be the default name. Not sure what's up with this. All devices seem to function within home for off and on, and from what I can tell, dimming also works.
  4. Color changing seems to have similar issues to what was happening before, but slightly different. It'll stay off when I turn the device on, and when I turn it off it flashes on momentarily and then back off. This can be corrected by turning it on in the magic home app.

Overall it's loss of functionality and buggy like you've said, but working ok-ish at least for now. I know you mentioned that this release wont go to production for some time while you work towards feature parity and solving bug issues, but I'm curious if there's any chance of the changes you made to get v10 firmware working being made to the previous version. This is assuming 2.0.0 is a full rewrite of some kind seeing as you're needing to bring feature parity up to par. I can understand if that's not feasible, but figured it was worth asking. I'm also willing to help test to the best of my ability and to near the end of my wife's patience :)

Here are the logs for item number 3 if you wanted to see them.
homebridge.log

edit: And thank you for all your help with this. More support than I often see from the vendors I work with as an IT Pro

@Zacknetic
Copy link
Owner

Thank you very much for the detailed response. The change to allow the new v10 bulbs is literally 1 line change.

The difficulty will be that I'm not entirely certain which version of the source code I used or if I even can find it. This is due to disorganization in the past where my release versions didn't necessary reflect changes in source.

I will resolve this one of two ways and attempt to do so this weekend.

  1. Find the closest source of version 1.9.9, make the change, build, and release.

  2. Edit the release 1.9.9 code directly and republish. Because I'm building from typescript I'm slightly concerned about this approach but it may be viable due to the change being so minor.

I'll update here once that change has been made. At which point you should restore from your 1.9.9 version and update to 1.9.10 (once released).

Thanks for the praise and look forward to getting this working for you soon. Oh and thank you for the continued logs.

@Zacknetic
Copy link
Owner

I have made the relevant changes and published version 1.9.10 as latest.

If you are restoring from a Homebridge backup, please install version 1.9.10 or disable Homebridge Magichome before loading the backup. Otherwise upon restart version 2.0.0-alpha.4 will convert your Homebridge Magichome accessories.

If you are loading from a docker image backup then simply update to version 1.9.10 and restart.

Please let me know the results of this.

@xstefanx
Copy link
Author

xstefanx commented Sep 9, 2023

Gave 1.9.10 a try with my backed up files and I seem to be having the same original issue. The new V10 devices don't show up. I do find it curious that it only finds a single existing device though, as there are 3 others that show within homebridge as well. Here's an example of one of them not being shown in the log.

image

homebridge.log

edit: added further info

@xstefanx
Copy link
Author

xstefanx commented Sep 9, 2023

I ran another test since I've got everything backed up as it is. I tried completely clearing out the plugin and reinstalling fresh to see if that would behave any differently. The same bulb was the only one to show back up, which honestly makes me think something else might be going on that's keeping me from getting the new bulbs in since I can't even get the other 3 that were working previously to register from scratch again. There was a new warning from the plugin this time, but I'm not sure if it's a big deal or not. I wasn't getting it before.

homebridge.log

I'm tempted to start completely from scratch and see if that changes anything for me, but I know it'll mean resetting up (naming and placing in rooms) all of my devices at least one more time, more like a couple. With 20+ devices in homebridge it'll take some time, but if you think that's where we're at let me know and I'll give that a go.

@Zacknetic
Copy link
Owner

Please do not update from scratch if you had it working before. I personally know how long that takes and I don't believe that will solve anything for now.

When you say that it only finds a single device, do you mean that the other 20 devices do not load correctly? In your logs I only see 1 device being registered. Alternatively, do you mean that the 20 old devices are loading correctly and in addition 1 v10 device is registering but not the 3 other v10 devices?

Whatever you do, please keep that backup handy. I will look into this further but I am honestly perplexed at the logs. Please let me know if the other devices are being loaded correctly in v1.9.10.

@Zacknetic
Copy link
Owner

Zacknetic commented Sep 9, 2023

I have updated to v1.9.11 with some extra logging:

If you could, in the configs please set your logging level to 5 as shown below and then restart. Then let's take a look at the output. I've added logging to show exactly what we are getting back from the bulbs.

        {
            "platform": "homebridge-magichome-dynamic-platform",
            "pruning": {
                "pruneMissingCachedAccessories": false,
                "restartsBeforeMissingAccessoriesPruned": 3,
                "pruneAllAccessoriesNextRestart": false
            },
            "whiteEffects": {
                "simultaniousDevicesColorWhite": true,
                "colorWhiteThreshold": 10,
                "colorWhiteThresholdSimultaniousDevices": 50,
                "colorOffThresholdSimultaniousDevices": 5
            },
            "deviceManagement": {
                "blacklistOrWhitelist": "blacklist",
                "blacklistedUniqueIDs": [
                    ""
                ]
            },
            "advancedOptions": {
                "periodicDiscovery": true,
                "namesWithMacAddress": false,
                "logLevel": 5
            }
        }

@xstefanx
Copy link
Author

xstefanx commented Sep 9, 2023

Here's The output from the logs. I've not looked at these too closely yet, but there were some red errors, so maybe we're getting somewhere.

homebridge.log

As for previous questions. When I boot up like this with the configs that were previously working, I get 4/7 bulbs, these are the older models and not the new ones with firmware v10. As for the 20 devices, a lot of those are from other plugins and all come in just fine.

image

If I wipe out the magichome plugin and try to let these bulbs pull in from scratch, the one names Ali's Nightstand is the only one that shows up in the accessories, the same as we were seeing in the logs. All of the bulbs in the image above, including the Ali's nightstand are the v7 bulbs.

@xstefanx
Copy link
Author

xstefanx commented Sep 9, 2023

Wait, the new bulbs just showed up, just had to wait a bit longer after the initial boot. I'd mentioned this in my first post that I often had to do this, but I've been being impatient with it tonight it seems. I'll do some testing and see how things are working out here. I'm still curious about the logs not showing all of the devices registering, but not as concerned if things work for me here.

@xstefanx
Copy link
Author

xstefanx commented Sep 9, 2023

Best I can tell, everything is as functional as it was before. Those three bulbs are in a scene together and siri will often trigger the scene but not manage to get all 3 on for some reason. This isn't new behavior though, was happening with the old bulbs too.

I'm thinking this can be closed, but do let me know if there is anything worth acting on in the last logs I sent over. Thank you again for all your work on this!

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Something isn't working new controller type A new type of controller needs additional logic
Projects
None yet
Development

No branches or pull requests

3 participants