nikshriv / cync_lights

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

Error setting up entry cync_lights for cync_lights #11

Closed rhelberth closed 1 year ago

rhelberth commented 1 year ago

Hello, I have an issue when trying to add the lamps in dashboard, here is the evidence:

Logger: homeassistant.config_entries Source: custom_components/cync_lights/cync_hub.py:242 Integration: Cync Lights (documentation) First occurred: 15:44:31 (1 occurrences) Last logged: 15:44:31

2022-09-15 15:44:31.268 ERROR (MainThread) [homeassistant.config_entries] Error setting up entry cync_lights for cync_lights Traceback (most recent call last): File "/usr/src/homeassistant/homeassistant/config_entries.py", line 357, in async_setup result = await component.async_setup_entry(hass, self) File "/config/custom_components/cync_lights/init.py", line 15, in async_setup_entry hub = CyncHub(entry.data) File "/config/custom_components/cync_lights/cync_hub.py", line 26, in init self.cync_switches = {switch_id:CyncSwitch(switch_id,switch_info,self.cync_rooms.get(switch_info['room'], None)) for switch_id,switch_info in user_data['cync_config']['devices'].items() if switch_info["ONOFF"]} File "/config/custom_components/cync_lights/cync_hub.py", line 26, in self.cync_switches = {switch_id:CyncSwitch(switch_id,switch_info,self.cync_rooms.get(switch_info['room'], None)) for switch_id,switch_info in user_data['cync_config']['devices'].items() if switch_info["ONOFF"]} File "/config/custom_components/cync_lights/cync_hub.py", line 242, in init self.switch_controller = switch_info['switch_controller'] KeyError: 'switch_controller'


cync_data.py cbyge_rooms.json

{ "data": [ { "device": { "subscribe_date": "2019-04-02T22:37:49.277Z", "is_active": true, "role": 0, "last_login": "", "active_code": "2eb67c300363124d91d58ea1dec0a782", "active_date": "2019-04-02T22:37:49.269Z", "groups": "", "mcu_version": 0, "firmware_version": 0, "source": 5, "mac": "5DFEC6D54CE3", "product_id": "1607d2ad150cb2001607d2ad150cb201", "access_key": 799161, "name": "Home", "authorize_code": "1e0fa6b948551a00", "id": 575168412, "is_online": false }, "device_info": { "musicShows": [], "bulbsArray": [ { "occupancyDeactivationPeriod": 30, "ambientLightSensorSensitivity": 10, "motionSensorDelayTime": 300, "displayName": "Light one", "motionSensorEnabled": true, "mac": "A4:C1:38:2E:39:10", "ambientLightEnable": "false", "firmwareVersion": "3.7", "occupancySensitivity": 1, "occupancyEnable": "true", "deviceType": 17, "ambientLightSensorEnabled": false, "motionSensorDeactivationPeriod": 30, "deviceID": 575168412001, "motionSensorSensitivity": 1, "wifiMac": "00:01:02:03:04:05", "ambientLightSensitivity": 10, "occupancyTimeoutPeriod": 300 }, { "occupancyDeactivationPeriod": 30, "ambientLightSensorSensitivity": 10, "motionSensorDelayTime": 300, "displayName": "Light two", "motionSensorEnabled": true, "mac": "A4:C1:38:08:62:77", "ambientLightEnable": "false", "firmwareVersion": "3.7", "occupancySensitivity": 1, "occupancyEnable": "true", "deviceType": 17, "ambientLightSensorEnabled": false, "motionSensorDeactivationPeriod": 30, "deviceID": 575168412002, "motionSensorSensitivity": 1, "wifiMac": "00:01:02:03:04:05", "ambientLightSensitivity": 10, "occupancyTimeoutPeriod": 300 } ], "lightShows": [], "switchIsAutoUpdate": false, "admin": { "emailAddress": "****@gmail.com", "lastUseDate": "2019-04-03T03:38:05Z", "userID": 0, "username": "", "createDate": "2019-04-03T03:38:05Z" }, "groupsArray": [ { "sensorSchedules": [ { "brightness": 100, "cct": 0, "displayName": "Daytime", "isEnabled": true, "startTime": "2019-05-12 08:00", "id": 0, "endTime": "2019-05-12 20:59", "simpleMode": true }, { "brightness": 100, "cct": 0, "displayName": "Nighttime", "isEnabled": true, "startTime": "2019-05-12 21:00", "id": 1, "endTime": "2019-05-12 07:59", "simpleMode": true } ], "displayName": "Bedroom", "groupID": 32769, "showOnHome": true, "isSubgroup": false, "subgroupIDArray": [ 32768 ], "deviceIDArray": [] }, { "sensorSchedules": [], "displayName": "Bedside Table Lamps", "groupID": 32768, "showOnHome": false, "isSubgroup": true, "subgroupIDArray": [], "deviceIDArray": [ 1, 2 ] } ], "version": "NA", "standaloneDevicesArray": [], "sceneArray": [ { "isReal": false, "sceneType": 2, "displayName": "Good Night", "sceneID": 7, "showOnHome": true, "position": 1, "actionArray": [] }, { "isReal": false, "sceneType": 6, "displayName": "Movie", "sceneID": 8, "showOnHome": true, "position": 0, "actionArray": [] } ], "schedules": [], "deviceIdRecord": 0 } } ] }

Thank you for your attention

nikshriv commented 1 year ago

It looks like none of your devices are Wi-Fi capable. That is a requirement for this integration to work. You can buy a plug or a "Direct Connect" bulb to get Wi-Fi capability. You only need one Wi-Fi device in your system for this to work. If you prefer to only control over Bluetooth, there is another integration that supports that.

rhelberth commented 1 year ago

Got it, thanks for the support. To control only by Bluetooth, what would be the integration?

nikshriv commented 1 year ago

You can try this one:

https://github.com/yangqian/hass-gelight