cellcortex / homebridge-yeelighter

Homebridge plugin for Yeelights - special focus on supporting features of ceiling lights
MIT License
98 stars 20 forks source link

All Yeelight lights - no real response #24

Open S474N opened 4 years ago

S474N commented 4 years ago

Hi, I have about 11 lights (650, 350 and led strips) and have problem with control from Homekit or Homebridge UI X. I migrated all lights to IoT VLAN (different subnet).

All lights are set correctly in config.json (override name, but in UI X is visible only model, not assigned name), also have on my router enable mDNS and IGMP Snooping. Pings from my LAN (also from RPi with Homebridge) to lights in IoT VLAN are OK.

If I turn on light in HomeKit, there is automatically turned on in Accessories in HomeBridge UI X, but real light is still turned off.

Tested also deleting my Home in HomeKit and creating new one. Same problem.

Where can be problem, please? Have also "log":true in config.json with every light, but there's no info in log.

Homebridge v1.0.4 Node.js v12.16.3 npm v6.14.4 homebridge-yeelighter v1.2.42

S474N commented 4 years ago

Today tested commands via telnet IP 55443 from my main LAN and everything works perfectly to IoT VLAN, where are located lights.

Can you please add Location IP as new "override" (next value in "Optional per light configuration")? I think, that problem is here.

S474N commented 4 years ago

Next day of testing - cleaning cached devices, move one light from IoT VLAN to LAN.

Homebridge log:

[5/6/2020, 16:10:11] ---
[5/6/2020, 16:10:11] Loaded plugin: homebridge-yeelighter
[5/6/2020, 16:10:11] Registering platform 'homebridge-yeelighter.Yeelighter'
[5/6/2020, 16:10:11] ---
[5/6/2020, 16:10:11] Loading 6 platforms...
[5/6/2020, 16:10:11] [Yeelighter] Initializing Yeelighter platform...
...
[5/6/2020, 16:10:12] [Yeelighter] Configure Accessory XXXXXX-XXXX-XXXX-XXXX-XXXXX
...
[5/6/2020, 16:10:12] [Yeelighter] ** Discovery Started **
...
[5/6/2020, 16:10:12] [Yeelighter] Cached ceiling1 [0x000000000XXXXXX] found at yeelight://10.0.0.X:55443
[5/6/2020, 16:10:12] [Yeelighter] [0x000000000XXXXXX] Re-using service of subtype 'main'. []
[5/6/2020, 16:10:12] [Yeelighter] [0x000000000XXXXXX] installed as Color temperature light []
[5/6/2020, 16:10:12] [Yeelighter] [0x000000000XXXXXX] Connected []

And this light works perfectly in same LAN as RPi/HomeBridge server.

Can be option in plugin, for disabling discovery/broadcast and using fixed IP?

cellcortex commented 4 years ago

The multicast is used to discover the device and it's properties. In principle you could put all the information that the response contains into the config and it would work. However I am afraid it doesn't make sense to put a fix for your network configuration into this plugin for everybody.

You can either:

Sorry

S474N commented 4 years ago

@cellcortex: hi, thank you for reply.

Fix for my IP configuration to plugin is nonsens, but I think support for define IP. Please see for example plugin Broadlink (section Device Discovery and hosts): https://lprhodes.github.io/slate/

I think the same, that will be IP in override section, for example:

"platforms": [
  {
    "platform": "Yeelighter",
    "name": "Yeelighter",
    "override": [
      {
        "id": "0x00000000deadbeef",
        "IP": 10.0.0.1
      },
      {
        "id": "0x0000000012345678",
        "background": false,
        "nightLight": true,
        "IP": 10.0.0.2
      }
    ]
  }
]

The same problem as me have everybody with IoT VLAN.

Or can you write me, how can I define the config response manualy? Thank you again.

cellcortex commented 4 years ago

This would require quite some changes to the lifecycle of lights in the plugin. The configuration of the light is sent via this registration message that apparently your vlan filters. So all of this would have to be configured manually.

Isn't there a way for you to config your gateway to forward the SSDP / multicast?

cellcortex commented 4 years ago

will accept pull requests for this.

S474N commented 4 years ago

@cellcortex: I have USG-PRO, enabled "IGMP snooping" on both (LAN and IoT VLAN), also enabled Multicast DNS (mDNS) and nothing.

Here are threads on Unifi forum about SSDP: https://community.ui.com/questions/SSDP-Multicast-Across-VLANs/3c814e7f-8c5a-4b52-9747-7216a0e80c9c https://community.ui.com/questions/SSDP-Multicast-Across-VLANs/e39e7123-8a12-4382-ad27-ea05e1b64a20 https://community.ui.com/questions/IPTV-IGMP-Proxy-managed-by-Unifi-controller/c617c208-ad2a-41bb-8cee-488f19c3c625

But there's no real solution.

Is way to add lights manually? If you tell me how, will test it.

S474N commented 4 years ago

SOLVED! :)

I was set IGMP-Proxy, configured both interfaces LAN and IoT VLAN, added firewall rules (UDP, 239.255.255.250, port 1982) and it WORKS!

But have this problems:

S474N commented 4 years ago

Delay is really big and annoying problem. Click on OFF, light goes offline, in log nothing and delay about 20s, then icon changed to off.

Here is my log:

[5/30/2020, 17:14:40] [Yeelighter] [Pracovna] debug: sendCommand(15, get_prop, ["power","color_mode","bright","hue","sat","ct","bg_power","bg_bright","bg_hue","bg_sat","bg_ct","bg_lmode","nl_br","active_mode","name"]) []
[5/30/2020, 17:14:40] [Yeelighter] [Pracovna] debug: received update 15 after 0.103s: ["off","2","1","","","4000","","","","","","","0","0",""] []
[5/30/2020, 17:14:40] [Yeelighter] [Pracovna] debug: temperature light updated {"power":false,"color_mode":2,"bright":1,"hue":0,"sat":0,"ct":4000,"bg_power":false,"bg_bright":0,"bg_hue":0,"bg_sat":0,"bg_ct":0,"bg_lmode":0,"nl_br":0,"active_mode":0,"name":""} []

Next try, click to ON. Light is ON instantly, but in UI-X and Homekit nothing. Delay about 20s, then icon changed to ON.

[5/30/2020, 17:18:40] [Yeelighter] [Pracovna] debug: sendCommand(20, get_prop, ["power","color_mode","bright","hue","sat","ct","bg_power","bg_bright","bg_hue","bg_sat","bg_ct","bg_lmode","nl_br","active_mode","name"]) []
[5/30/2020, 17:18:40] [Yeelighter] [Pracovna] debug: received update 20 after 0.305s: ["on","2","1","","","4000","","","","","","","0","0",""] []
cellcortex commented 4 years ago

Homekit is updating the value on the client side automatically which is why I didn't query the values right after they are set - especially since yeelight has some limitations of how many messages it wants to handle per minute. I can try to add code to update the home bridge accessory with value that was just set.