wizlightcpp icon indicating copy to clipboard operation
wizlightcpp copied to clipboard

Command `discover` discovers only one bulb

Open grabusr opened this issue 2 years ago • 0 comments

Hi

I have two questions:

  1. Where I can find the reference for Wiz API? I have found this, but it seems to a bit different. I can contribute to repository.
  2. Secondly, I have a problem. I have two bulbs connected, but when I use discover command only one is discovered:
./wizlightcpp discover --verbose --bcast 192.168.50.255
2023-11-25 23:09:32.517 wizlightcpp(11344) DEBUG        : Verbose log enabled
2023-11-25 23:09:32.517 wizlightcpp(11344) DEBUG        : Wiz discover request {"method":"getDevInfo"} to Wiz
2023-11-25 23:09:32.517 wizlightcpp(11344) DEBUG        : sendUDPCommand socket ipAddr 192.168.50.255 cmd {"method":"getDevInfo"}
2023-11-25 23:09:32.540 wizlightcpp(11344) DEBUG        : sendUDPCommand device response: {"method":"getDevInfo","env":"pro","result":{"mac":"d8a0113bc52e","devMac":"d8a0113bc52e","moduleName":"ESP24_SHRGBW_01"}}
2023-11-25 23:09:32.540 wizlightcpp(11344) DEBUG        : sendUDPCommand broadcastIP: 192.168.50.160
2023-11-25 23:09:32.540 wizlightcpp(11344) DEBUG        : {
    "bulb_response": {
        "mac": "d8a0113bc52e",
        "devMac": "d8a0113bc52e",
        "moduleName": "ESP24_SHRGBW_01",
        "ip": "192.168.50.160"
    }
}
{
    "bulb_response": {
        "mac": "d8a0113bc52e",
        "devMac": "d8a0113bc52e",
        "moduleName": "ESP24_SHRGBW_01",
        "ip": "192.168.50.160"
    }
}

sometimes it gives me reference to second bulb:

{
    "bulb_response": {
        "mac": "d8a011f047ab",
        "devMac": "d8a011f047ab",
        "moduleName": "ESP24_SHRGBW_01",
        "ip": "192.168.50.8"
    }
}

Turning off/on works for both, but discover command never provided me response with two bulbs data.

For example in this project a python script discovers both my bulbs.

grabusr avatar Nov 25 '23 22:11 grabusr