nikshriv / cync_lights

Home Assistant Integration for controlling Cync switches, plugs, and bulbs
160 stars 53 forks source link

Bluetooth only bulbs cannot be turned on or off #19

Closed jtplatt99 closed 1 year ago

jtplatt99 commented 1 year ago

Hi and thank you for creating this integration!

I have a collection of devices including 2 older Bluetooth only bulbs, 2 newer WiFi indoor smart plugs, and a Bluetooth wireless dimmer switch. The main issue that I'm facing is that I'm not able to turn the Bluetooth only bulbs on or off from Home Assistant. They are partially functional since I can see that the reported state is updated when I toggle the lights from the Cync app. The indoor smart plugs also work fine and I'm able to toggle them from Home Assistant, so I don't think its an account issue.

I also wanted to note that the Bluetooth wireless dimmer is not picked up by the integration, but this isn't too much of an issue since it already does everything I want it to.

Thanks again. Here is my device info. The first two devices are the Bluetooth only bulbs, followed by the dimmer switch, then lastly the two indoor smart plugs.

"device_info": {
    "musicShows": [],
    "bulbsArray": [
        {
            "occupancyDeactivationPeriod": 30,
            "ambientLightSensorSensitivity": 10,
            "motionSensorDelayTime": 300,
            "displayName": "Bedroom Lamp",
            "motionSensorEnabled": true,
            "mac": "XX:XX:XX:XX:XX:XX",
            "ambientLightEnable": "false",
            "firmwareVersion": "3.7",
            "occupancySensitivity": 1,
            "occupancyEnable": "true",
            "deviceType": 19,
            "ambientLightSensorEnabled": false,
            "motionSensorDeactivationPeriod": 30,
            "deviceID": 750661593001,
            "commissionedDate": "2022-08-13T02:34:24.526Z",
            "motionSensorSensitivity": 1,
            "wifiMac": "00:01:02:03:04:05",
            "ambientLightSensitivity": 10,
            "occupancyTimeoutPeriod": 300
        },
        {
            "occupancyDeactivationPeriod": 30,
            "ambientLightSensorSensitivity": 10,
            "motionSensorDelayTime": 300,
            "displayName": "Living Room Table Lamp",
            "motionSensorEnabled": true,
            "mac": "XX:XX:XX:XX:XX:XX",
            "ambientLightEnable": "false",
            "firmwareVersion": "3.7",
            "occupancySensitivity": 1,
            "occupancyEnable": "true",
            "deviceType": 19,
            "ambientLightSensorEnabled": false,
            "motionSensorDeactivationPeriod": 30,
            "deviceID": 750661593003,
            "commissionedDate": "2022-08-13T02:51:06.937Z",
            "motionSensorSensitivity": 1,
            "wifiMac": "00:01:02:03:04:05",
            "ambientLightSensitivity": 10,
            "occupancyTimeoutPeriod": 300
        },
        {
            "occupancyDeactivationPeriod": 30,
            "ambientLightSensorSensitivity": 10,
            "motionSensorDelayTime": 300,
            "displayName": "Bedroom Dimmer",
            "motionSensorEnabled": true,
            "mac": "XX:XX:XX:XX:XX:XX",
            "ambientLightEnable": "false",
            "firmwareVersion": "2.3.054",
            "occupancySensitivity": 1,
            "occupancyEnable": "true",
            "deviceType": 113,
            "ambientLightSensorEnabled": false,
            "motionSensorDeactivationPeriod": 30,
            "deviceID": 750661593002,
            "commissionedDate": "2022-08-13T02:37:06.082Z",
            "motionSensorSensitivity": 1,
            "wifiMac": "00:01:02:03:04:05",
            "ambientLightSensitivity": 10,
            "occupancyTimeoutPeriod": 300
        },
        {
            "occupancyDeactivationPeriod": 30,
            "ambientLightSensorSensitivity": 10,
            "motionSensorDelayTime": 300,
            "nightLightBrightness": 0,
            "lightRingBrightness": 0,
            "displayName": "Christmas Tree",
            "motionSensorEnabled": true,
            "mac": "XX:XX:XX:XX:XX:XX",
            "lightRingColor": 0,
            "ambientLightEnable": "false",
            "firmwareVersion": "1.0.294",
            "occupancySensitivity": 1,
            "occupancyEnable": "true",
            "deviceType": 68,
            "wifiDisconnectedIndicator": true,
            "fadeOff": 0,
            "wifiDisconnectIndicatorEnable": "true",
            "switchID": 1956283924,
            "wifiSsid": "",
            "ambientLightSensorEnabled": false,
            "motionSensorDeactivationPeriod": 30,
            "allowOTAUpdates": "true",
            "deviceID": 750661593004,
            "commissionedDate": "2022-08-18T00:49:30.118Z",
            "fadeOn": 0,
            "motionSensorSensitivity": 1,
            "defaultBrightness": 0,
            "wifiMac": "XX:XX:XX:XX:XX:XX",
            "lightRingMode": 0,
            "ambientLightSensitivity": 10,
            "lightRingIndicator": 0,
            "nightLightColor": 0,
            "occupancyTimeoutPeriod": 300
        },
        {
            "occupancyDeactivationPeriod": 30,
            "ambientLightSensorSensitivity": 10,
            "motionSensorDelayTime": 300,
            "nightLightBrightness": 0,
            "lightRingBrightness": 0,
            "displayName": "Bookcase Lights",
            "motionSensorEnabled": true,
            "mac": "XX:XX:XX:XX:XX:XX",
            "lightRingColor": 0,
            "ambientLightEnable": "false",
            "firmwareVersion": "1.0.294",
            "occupancySensitivity": 1,
            "occupancyEnable": "true",
            "deviceType": 68,
            "wifiDisconnectedIndicator": true,
            "fadeOff": 0,
            "wifiDisconnectIndicatorEnable": "true",
            "switchID": 1798409147,
            "wifiSsid": "",
            "ambientLightSensorEnabled": false,
            "motionSensorDeactivationPeriod": 30,
            "allowOTAUpdates": "true",
            "deviceID": 750661593005,
            "commissionedDate": "2022-08-18T00:57:25.059Z",
            "fadeOn": 0,
            "motionSensorSensitivity": 1,
            "defaultBrightness": 0,
            "wifiMac": "XX:XX:XX:XX:XX:XX",
            "lightRingMode": 0,
            "ambientLightSensitivity": 10,
            "lightRingIndicator": 0,
            "nightLightColor": 0,
            "occupancyTimeoutPeriod": 300
        }
    ],
nikshriv commented 1 year ago

Have your tried controlling the bluetooth only bulbs with the phone app when the bluetooth is off on your phone? I suspect that your two wifi connected plugs are not close enough to your bluetooth bulbs to control them reliably. If you can try turning running the app, turn off bluetooth, and then try to turn on/off your bulbs, that would confirm the theory. Otherwise, I'm not sure what the problem is. I am releasing an update in the next day or two which should increase the reliability of the integration. Let me know if the test produces a similar result as the integration as it is currently.

jtplatt99 commented 1 year ago

Thanks for the suggestion. Unfortunately, that doesn't seem to be the issue since I can still connect to and control my Bluetooth bulbs through the app when I turn off Bluetooth on my phone. I suspected as much since the bulbs and WiFi connected plugs are close to one another, but it was worth a try. I'll definitely let you know if anything changes once you update the integration though. Thanks again.

FYI Here's a screenshot showing that I can connect through the WiFi connected outlet. Screenshot_20221016-185931~2

nikshriv commented 1 year ago

I don't see the rest of your configuration info in your post. It would be helpful to post that information as well (obviously blank out any sensitive information).

Based on what I see, I don't see a reason why the integration should fail to work for you. I have the same bulbs and I am able to control them with the integration without issue.

The bluetooth dimmer remote is not supported by the integration because it only works with the bluetooth mesh, sends no state information to the Cync server, and receives no commands from the Cync server.

Also, I did update the integration yesterday night. Have your tried it yet?

jtplatt99 commented 1 year ago

I've included my full configuration below, hopefully there is something useful there.

One thing I noticed after your last comment was that even though the "Living Room Table Lamp" bulb in my set up is not working from Home Assistant, it turns out that the "Bedroom Lamp" bulb is working though this integration. Both bulbs work from the Cync app with bluetooth off.

Over the weekend I updated Home Assistant as well as the integration. I'm still seeing the same issue with the "Living Room Table Lamp" not working and the "Bedroom Lamp" working. Thanks for your help and let me know if there is any other information I can give or collect from my set up.

{
    "data": [
        {
            "device": {
                "subscribe_date": "2022-08-08T01:02:51.571Z",
                "is_active": true,
                "role": 0,
                "last_login": "",
                "active_code": "69666c2145c96c8a40cf026452597bf1",
                "active_date": "2022-08-08T01:02:51.564Z",
                "groups": "",
                "mcu_version": 0,
                "firmware_version": 0,
                "source": 5,
                "mac": "--Redacted--",
                "product_id": "1607d2ad150cb2001607d2ad150cb201",
                "access_key": --Redacted--,
                "name": "--Redacted--",
                "authorize_code": "--Redacted--",
                "id": 750661593,
                "is_online": false
            },
            "device_info": {
                "musicShows": [],
                "bulbsArray": [
                    {
                        "occupancyDeactivationPeriod": 30,
                        "ambientLightSensorSensitivity": 10,
                        "motionSensorDelayTime": 300,
                        "displayName": "Bedroom Lamp",
                        "motionSensorEnabled": true,
                        "mac": "--Redacted--",
                        "ambientLightEnable": "false",
                        "firmwareVersion": "3.7",
                        "occupancySensitivity": 1,
                        "occupancyEnable": "true",
                        "deviceType": 19,
                        "ambientLightSensorEnabled": false,
                        "motionSensorDeactivationPeriod": 30,
                        "deviceID": 750661593001,
                        "commissionedDate": "2022-08-13T02:34:24.526Z",
                        "motionSensorSensitivity": 1,
                        "wifiMac": "00:01:02:03:04:05",
                        "ambientLightSensitivity": 10,
                        "occupancyTimeoutPeriod": 300
                    },
                    {
                        "occupancyDeactivationPeriod": 30,
                        "ambientLightSensorSensitivity": 10,
                        "motionSensorDelayTime": 300,
                        "displayName": "Living Room Table Lamp",
                        "motionSensorEnabled": true,
                        "mac": "--Redacted--",
                        "ambientLightEnable": "false",
                        "firmwareVersion": "3.7",
                        "occupancySensitivity": 1,
                        "occupancyEnable": "true",
                        "deviceType": 19,
                        "ambientLightSensorEnabled": false,
                        "motionSensorDeactivationPeriod": 30,
                        "deviceID": 750661593003,
                        "commissionedDate": "2022-08-13T02:51:06.937Z",
                        "motionSensorSensitivity": 1,
                        "wifiMac": "00:01:02:03:04:05",
                        "ambientLightSensitivity": 10,
                        "occupancyTimeoutPeriod": 300
                    },
                    {
                        "occupancyDeactivationPeriod": 30,
                        "ambientLightSensorSensitivity": 10,
                        "motionSensorDelayTime": 300,
                        "displayName": "Bedroom Dimmer",
                        "motionSensorEnabled": true,
                        "mac": "--Redacted--",
                        "ambientLightEnable": "false",
                        "firmwareVersion": "2.3.054",
                        "occupancySensitivity": 1,
                        "occupancyEnable": "true",
                        "deviceType": 113,
                        "ambientLightSensorEnabled": false,
                        "motionSensorDeactivationPeriod": 30,
                        "deviceID": 750661593002,
                        "commissionedDate": "2022-08-13T02:37:06.082Z",
                        "motionSensorSensitivity": 1,
                        "wifiMac": "00:01:02:03:04:05",
                        "ambientLightSensitivity": 10,
                        "occupancyTimeoutPeriod": 300
                    },
                    {
                        "occupancyDeactivationPeriod": 30,
                        "ambientLightSensorSensitivity": 10,
                        "motionSensorDelayTime": 300,
                        "nightLightBrightness": 0,
                        "lightRingBrightness": 0,
                        "displayName": "Christmas Tree",
                        "motionSensorEnabled": true,
                        "mac": "--Redacted--",
                        "lightRingColor": 0,
                        "ambientLightEnable": "false",
                        "firmwareVersion": "1.0.294",
                        "occupancySensitivity": 1,
                        "occupancyEnable": "true",
                        "deviceType": 68,
                        "wifiDisconnectedIndicator": true,
                        "fadeOff": 0,
                        "wifiDisconnectIndicatorEnable": "true",
                        "switchID": 1956283924,
                        "wifiSsid": "--Redacted--",
                        "ambientLightSensorEnabled": false,
                        "motionSensorDeactivationPeriod": 30,
                        "allowOTAUpdates": "true",
                        "deviceID": 750661593004,
                        "commissionedDate": "2022-08-18T00:49:30.118Z",
                        "fadeOn": 0,
                        "motionSensorSensitivity": 1,
                        "defaultBrightness": 0,
                        "wifiMac": "--Redacted--",
                        "lightRingMode": 0,
                        "ambientLightSensitivity": 10,
                        "lightRingIndicator": 0,
                        "nightLightColor": 0,
                        "occupancyTimeoutPeriod": 300
                    },
                    {
                        "occupancyDeactivationPeriod": 30,
                        "ambientLightSensorSensitivity": 10,
                        "motionSensorDelayTime": 300,
                        "nightLightBrightness": 0,
                        "lightRingBrightness": 0,
                        "displayName": "Bookcase Lights",
                        "motionSensorEnabled": true,
                        "mac": "--Redacted--",
                        "lightRingColor": 0,
                        "ambientLightEnable": "false",
                        "firmwareVersion": "1.0.294",
                        "occupancySensitivity": 1,
                        "occupancyEnable": "true",
                        "deviceType": 68,
                        "wifiDisconnectedIndicator": true,
                        "fadeOff": 0,
                        "wifiDisconnectIndicatorEnable": "true",
                        "switchID": 1798409147,
                        "wifiSsid": "--Redacted--",
                        "ambientLightSensorEnabled": false,
                        "motionSensorDeactivationPeriod": 30,
                        "allowOTAUpdates": "true",
                        "deviceID": 750661593005,
                        "commissionedDate": "2022-08-18T00:57:25.059Z",
                        "fadeOn": 0,
                        "motionSensorSensitivity": 1,
                        "defaultBrightness": 0,
                        "wifiMac": "--Redacted--",
                        "lightRingMode": 0,
                        "ambientLightSensitivity": 10,
                        "lightRingIndicator": 0,
                        "nightLightColor": 0,
                        "occupancyTimeoutPeriod": 300
                    }
                ],
                "lightShows": [],
                "switchIsAutoUpdate": false,
                "admin": {
                    "emailAddress": "--Redacted--",
                    "lastUseDate": "2022-08-08T06:02:51.359Z",
                    "userID": --Redacted--,
                    "username": "",
                    "createDate": "2022-08-08T06:02:51.359Z"
                },
                "groupsArray": [
                    {
                        "sensorSchedules": [],
                        "displayName": "Living Room",
                        "groupID": 32769,
                        "showOnHome": false,
                        "isSubgroup": false,
                        "subgroupIDArray": [],
                        "deviceIDArray": [
                            3,
                            5
                        ]
                    },
                    {
                        "sensorSchedules": [],
                        "displayName": "Bedroom Bookcase",
                        "groupID": 32770,
                        "showOnHome": false,
                        "isSubgroup": false,
                        "subgroupIDArray": [],
                        "deviceIDArray": [
                            4
                        ]
                    },
                    {
                        "sensorSchedules": [],
                        "displayName": "Bedroom",
                        "groupID": 32768,
                        "showOnHome": false,
                        "isSubgroup": false,
                        "subgroupIDArray": [],
                        "deviceIDArray": [
                            1,
                            2
                        ]
                    }
                ],
                "version": "NA",
                "autoOtaEnabled": true,
                "system": {
                    "app": {
                        "build": "0.26.0",
                        "bundleID": "com.savantsystems.gesdk",
                        "name": "CbyGEKit",
                        "version": "2600"
                    },
                    "ltk": "--Redacted--",
                    "timeInfo": {
                        "timeZone": "America/New_York"
                    },
                    "platform": {
                        "os": "Android",
                        "machine": "N/A",
                        "model": "OnePlus ONEPLUS A5010",
                        "localizedModel": "OnePlus ONEPLUS A5010",
                        "version": "32"
                    }
                },
                "standaloneDevicesArray": [],
                "geoLocation": {
                    "zipCode": "--Redacted--",
                    "latitude": --Redacted--,
                    "longitude": --Redacted--
                },
                "sceneArray": [],
                "schedules": [],
                "deviceIdRecord": 0
            }
        },
        {
            "device": {
                "subscribe_date": "2022-08-17T19:57:28.00Z",
                "is_active": true,
                "role": 0,
                "last_login": "2022-10-11T20:55:09.961Z",
                "firmware_mod": "1",
                "active_code": "--Redacted--",
                "active_date": "2022-08-17T19:57:21.353Z",
                "groups": "",
                "mcu_version": 28,
                "firmware_version": 10294,
                "source": 1,
                "mac": "--Redacted--",
                "mcu_mod": "1",
                "product_id": "--Redacted--",
                "access_key": 777,
                "name": "",
                "authorize_code": "--Redacted--",
                "id": 1798409147,
                "is_online": true
            },
            "device_info": {
                "error": {
                    "msg": "device property not exists",
                    "code": 4041009
                }
            }
        },
        {
            "device": {
                "subscribe_date": "2022-08-17T19:49:32.991Z",
                "is_active": true,
                "role": 0,
                "last_login": "2022-10-11T20:55:04.821Z",
                "firmware_mod": "1",
                "active_code": "--Redacted--",
                "active_date": "2022-08-17T19:49:15.875Z",
                "groups": "",
                "mcu_version": 28,
                "firmware_version": 10294,
                "source": 1,
                "mac": "--Redacted--",
                "mcu_mod": "1",
                "product_id": "--Redacted--",
                "access_key": 777,
                "name": "",
                "authorize_code": "--Redacted--",
                "id": 1956283924,
                "is_online": true
            },
            "device_info": {
                "error": {
                    "msg": "device property not exists",
                    "code": 4041009
                }
            }
        }
    ]
}
nikshriv commented 1 year ago

Everything looks fine in the configuration. I have had issues with various switches and bulbs that somehow get "out of sync" with the Cync server and for an unknown reason don't respond to commands initially. I've tried a couple of things that have gotten them working for me:

1) Try toggling the switch for both the room and for the individual switch that is not responding.

2) If that fails, try turning on the bulb by adjusting the brightness to 100 with the room switch and/or the individual switch in HA.

3) If it still fails, try disconnecting power to both the bulb and the Wi-Fi plug so that and then plug them back in. Start over with step 1.

If none of those steps work, I'm not sure what the problem is. I already have the integration checking the Cync server for a response to commands, but it seems your devices are immune to that. I may add an additional state check and have the integration repeat the command through another device if the first attempt fails to change the bulb's state after 1 to 2 seconds. I will add this if the above steps fail.

jtplatt99 commented 1 year ago

Going through that list of steps seemed to do the trick and got the table lamp working, but it gotten "out of sync" again since then. Following the steps again seems to work, so this is an acceptable solution for me. Thanks for the help!