kpsuperplane / homebridge-wiz-lan

Control Wiz lights over LAN
Apache License 2.0
115 stars 37 forks source link

V3 #32

Closed kpsuperplane closed 3 years ago

kpsuperplane commented 3 years ago

Full rewrite based on https://github.com/kpsuperplane/homebridge-iotas architecture. The codebase is now much easier to understand :)

Some notable improvements:

Please test this out by installing homebridge-wiz-lan@3.0.0-alpha!

eutampieri commented 3 years ago

Yay! Don’t know if it helps, but here are some bulb definitions https://gitlab.com/eutampieri/wiz-definitions. Also, I think it could be useful to separate the code that handles the bulbs as a separate non package

paffi05 commented 3 years ago
  • Support for RGB, Color Temp, and (Do I call them regular?) non-color-nor-temperature-adjustable bulbs (e.g. the filaments)

Maybe i'm wrong but filament bulbs DO have adjustable temperature, don't they?

mitch7391 commented 3 years ago

Maybe i'm wrong but filament bulbs DO have adjustable temperature, don't they?

Yep the filament bulbs do have adjustable colour temperature.

mitch7391 commented 3 years ago

@kpsuperplane I am testing the new V3 update and it does not seem to add my lights to Homebridge/HomeKit; it removes the old ones too and leave me with no lights connected. I have used the old config:

{
    "platform": "WizSmarthome",
    "name": "WizSmarthome"
}

And I have tried the slightly different new config:


{
    "platform": "homebridge-wiz-lan",
    "name": "Wiz"
}

Looking over my Homebridge logs the platform initialises, it then tries to set up the socket connection and then sends a discovery packet; but that is the last thing I see in my standard logs. Please let me know if you want me to collect any logs in debug mode.

mitch7391 commented 3 years ago

Some weird things happened with trying to revert in terms of it thinking it no longer had a config; but a full uninstall/reinstall sorted that out., Attempted again with the config example specifying my IP Addresses and it finally found them.

       {
            "platform": "homebridge-wiz-lan",
            "name": "Wiz",
            "devices": [
                {
                    "host": "192.168.0.186"
                },
                {
                    "host": "192.168.0.123"
                }
            ]
        }

It has now found my filament style bulbs as 'tunable white bulbs'; all we need next is 'Adaptive Lighting' next ;) nice work!

Sybrrgeek commented 3 years ago

Some weird things happened with trying to revert in terms of it thinking it no longer had a config; but a full uninstall/reinstall sorted that out., Attempted again with the config example specifying my IP Addresses and it finally found them.

       {
            "platform": "homebridge-wiz-lan",
            "name": "Wiz",
            "devices": [
                {
                    "host": "192.168.0.186"
                },
                {
                    "host": "192.168.0.123"
                }
            ]
        }

It has now found my filament style bulbs as 'tunable white bulbs'; all we need next is 'Adaptive Lighting' next ;) nice work!

Does this mean in order to make it work I have to give static addresses to every bulb in my house? I’ve got 11 of them!

muzzymate commented 3 years ago

Thanks for reviving the plugin! I like these bulbs for the price, so it's great to see some traction with the Homebridge plugin.

Discovery is working great on my network. I'm using the ciao backend on a docker install of Homebridge with an Eero router, if that makes any difference. My seven Wiz bulbs made the transition over to the new plugin after changing the platform name in the config. I have 4 of the Color/Tunable White A19 bulbs and 3 of the Soft White Dimmable ST19 bulbs. The A19 bulbs allow me to change the color and temperature and ST19 only displays the ability to change brightness level. (YES! #5) Will give the bulbs a full shakedown this evening to see if there are any repeatable conditions where they act unexpectedly.

I've noticed that the following messages are logged to the console for each bulb is powered off at the switch. I have two Wiz bulbs controlled by a single switch, so I see the below message twice. After about 10 seconds, the bulb reports in Homekit as "No Response" (YES! #5 and #11).

[2/24/2021, 8:51:44 AM] [homebridge-wiz-lan] This plugin slows down Homebridge. The read handler for the characteristic 'On' didn't respond at all!. Please check that you properly call the callback! See https://git.io/JtMGR for more info.
[2/24/2021, 8:51:44 AM] [homebridge-wiz-lan] This plugin slows down Homebridge. The read handler for the characteristic 'Brightness' didn't respond at all!. Please check that you properly call the callback! See https://git.io/JtMGR for more info.

Edit:

Does this mean in order to make it work I have to give static addresses to every bulb in my house? I’ve got 11 of them!

For what it's worth, my network did not require giving a static IP address to my bulbs. They were auto-discovered by the plug-in without having to declare them by the 'devices' configuration.

kpsuperplane commented 3 years ago

Maybe i'm wrong but filament bulbs DO have adjustable temperature, don't they?

Yep the filament bulbs do have adjustable colour temperature.

I bought the cheapest one for testing which didn't lol. Shouldn't matter though, color capabilities are determined by the model code.

Does this mean in order to make it work I have to give static addresses to every bulb in my house? I’ve got 11 of them! No, it should be autodiscovered assuming your router setup allows for UDP broadcasting to your bulbs (they usually are).

@mitch7391 it sounds like your network isn't passing the UDP broadcast to your bulbs, do you have a local firewall set up or something?

kpsuperplane commented 3 years ago

@kpsuperplane I am testing the new V3 update and it does not seem to add my lights to Homebridge/HomeKit; it removes the old ones too and leave me with no lights connected. I have used the old config:

{
    "platform": "WizSmarthome",
    "name": "WizSmarthome"
}

And I have tried the slightly different new config:

{
    "platform": "homebridge-wiz-lan",
    "name": "Wiz"
}

Looking over my Homebridge logs the platform initialises, it then tries to set up the socket connection and then sends a discovery packet; but that is the last thing I see in my standard logs. Please let me know if you want me to collect any logs in debug mode.

Thanks for pointing out the platform id changed! I will revert this to "WizSmarthome" later tonight to make the transition seamless for existing users.

mitch7391 commented 3 years ago

@mitch7391 it sounds like your network isn't passing the UDP broadcast to your bulbs, do you have a local firewall set up or something?

I shouldn’t have anything extra set up like that. Not sure why it didn’t like it, but got there in the end :)

Sybrrgeek commented 3 years ago

Some weird things happened with trying to revert in terms of it thinking it no longer had a config; but a full uninstall/reinstall sorted that out., Attempted again with the config example specifying my IP Addresses and it finally found them.

       {
            "platform": "homebridge-wiz-lan",
            "name": "Wiz",
            "devices": [
                {
                    "host": "192.168.0.186"
                },
                {
                    "host": "192.168.0.123"
                }
            ]
        }

It has now found my filament style bulbs as 'tunable white bulbs'; all we need next is 'Adaptive Lighting' next ;) nice work!

Does this mean in order to make it work I have to give static addresses to every bulb in my house? I’ve got 11 of them!

When I got home I uninstalled and reinstalled, still with no joy. Then I renamed the platform and name as noted and after a reboot voila!

Thanks for all your hard work on this!

kpsuperplane commented 3 years ago

Thank you for testing this out @mitch7391 @Sybrrgeek @muzzymate! You want to update your configuration as it's changed back to "WizSmarthome".

Otherwise, I wish you all a good day, and do update to 3.0.0!

mitch7391 commented 3 years ago

Looking forward to testing this further after work tonight :) thanks!