nikshriv / cync_lights

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

Error setting up for dimmer switch #12

Closed onelz closed 1 year ago

onelz commented 1 year ago

Hi there, I really appreciate you making this integration! I recently updated the integration and getting this error:

2022-09-17 15:40:03.247 ERROR (MainThread) [homeassistant.config_entries] Error setting up entry cync_lights_{myEmailAddress} for cync_lights
File "/config/custom_components/cync_lights/__init__.py", line 15, in async_setup_entry
File "/config/custom_components/cync_lights/cync_hub.py", line 28, in __init__
File "/config/custom_components/cync_lights/cync_hub.py", line 28, in <dictcomp>

this is my cbyge_rooms.json:

{
  "data": [
    {
      "device": {
        "subscribe_date": "2020-12-09T20:32:59.710Z",
        "is_active": true,
        "role": 0,
        "last_login": "2022-09-16T10:27:48.875Z",
        "firmware_mod": "Dimmer Switch",
        "active_code": "9ce979eb5fce2082dedd3b70ea3c9191",
        "active_date": "2020-12-09T20:32:37.623Z",
        "groups": "",
        "mcu_version": 10055,
        "firmware_version": 10140,
        "source": 1,
        "mac": "8850F601AA6D",
        "mcu_mod": "1",
        "product_id": "160fa2b48e5b03e9160fa2b48e5b8a01",
        "access_key": 888,
        "name": "Dining lights",
        "authorize_code": "1e0fa2b970ce18d8",
        "id": 1045576739,
        "is_online": true
      },
      "device_info": {
        "bulbsArray": [
          {
            "displayName": "Dining lights",
            "showOnHome": false,
            "deviceType": 48,
            "switchID": 1045576739002,
            "deviceID": 1045576739002
          }
        ]
      }
    },
    {
      "device": {
        "subscribe_date": "2022-09-06T22:54:50.656Z",
        "is_active": true,
        "role": 0,
        "last_login": "2022-09-16T10:27:48.128Z",
        "firmware_mod": "Dimmer Switch",
        "active_code": "36c73fa60d49568d1525aa0ebd3406df",
        "active_date": "2020-06-20T22:01:40.695Z",
        "groups": "",
        "mcu_version": 10055,
        "firmware_version": 10140,
        "source": 1,
        "mac": "8850F60320F5",
        "mcu_mod": "1",
        "product_id": "160fa2b48e5b03e9160fa2b48e5b8a01",
        "access_key": 888,
        "name": "No Name",
        "authorize_code": "1e2afaba1923f095",
        "id": 1924032389,
        "is_online": true
      },
      "device_info": {
        "bulbsArray": [
          {
            "displayName": "Living room lights",
            "showOnHome": false,
            "deviceType": 48,
            "switchID": 1924032389001,
            "deviceID": 1924032389001
          }
        ]
      }
    },
    {
      "device": {
        "subscribe_date": "2020-06-06T12:50:47.452Z",
        "is_active": true,
        "role": 0,
        "last_login": "",
        "active_code": "0fad155d6d7c7f2cb22923cc322731c5",
        "active_date": "2020-06-06T12:50:47.436Z",
        "groups": "",
        "mcu_version": 0,
        "firmware_version": 0,
        "source": 5,
        "mac": "4C2824F45C87",
        "product_id": "1607d2ad150cb2001607d2ad150cb201",
        "access_key": 756818,
        "name": "Home",
        "authorize_code": "1e07d4bdb7aeee02",
        "id": 1557458216,
        "is_online": false
      },
      "device_info": {
        "bulbsArray": [
          {
            "occupancyDeactivationPeriod": 30,
            "lightRingBrightness": 5,
            "displayName": "Dining lights",
            "showOnHome": false,
            "loadSelection": 0,
            "lightRingColor": 0,
            "mac": "b4a030dabcf4",
            "ambientLightEnable": false,
            "occupancySensitivity": 0,
            "firmwareVersion": "1.0.140",
            "occupancyEnable": true,
            "followTheSun": false,
            "deviceType": 48,
            "fadeOff": 1,
            "wifiDisconnectIndicatorEnable": true,
            "switchID": 1045576739,
            "wifiSsid": "mywifi",
            "allowOTAUpdates": true,
            "deviceID": 1557458216002,
            "fadeOn": 1,
            "defaultBrightness": 100,
            "wifiMac": "88:50:F6:01:AA:6D",
            "lightRingMode": 0,
            "ambientLightSensitivity": 0,
            "simpleModeEnabled": false,
            "occupancyTimeoutPeriod": 300
          },
          {
            "occupancyDeactivationPeriod": 0,
            "lightRingBrightness": 5,
            "displayName": "Living Room Lights",
            "showOnHome": false,
            "loadSelection": 0,
            "lightRingColor": 0,
            "mac": "F4BCDA330253",
            "ambientLightEnable": false,
            "occupancySensitivity": 0,
            "firmwareVersion": "1.0.140",
            "occupancyEnable": false,
            "followTheSun": false,
            "deviceType": 48,
            "fadeOff": 0,
            "wifiDisconnectIndicatorEnable": true,
            "switchID": 1924032389,
            "wifiSsid": "mywifi",
            "allowOTAUpdates": true,
            "deviceID": 1557458216001,
            "fadeOn": 0,
            "commissionedDate": "2022-09-07T03:54:50Z",
            "defaultBrightness": 0,
            "wifiMac": "8850F60320F5",
            "lightRingMode": 0,
            "ambientLightSensitivity": 0,
            "simpleModeEnabled": false,
            "occupancyTimeoutPeriod": 0
          }
        ],
        "admin": {
          "emailAddress": "myemail",
          "lastUseDate": "2020-06-06 10:50:46",
          "userID": 1234,
          "username": "",
          "createDate": "2020-06-06 10:50:46"
        },
        "lastUseDate": "2020-12-12 13:58:13",
        "groupsArray": [
          {
            "sensorSchedules": ["my schedules"],
            "displayName": "Living Room",
            "groupID": 32769,
            "showOnHome": true,
            "isSubgroup": false,
            "deviceIDArray": [1]
          },
          {
            "sensorSchedules": ["my schedules"],
            "displayName": "Dining Room",
            "groupID": 32770,
            "showOnHome": true,
            "isSubgroup": false,
            "deviceIDArray": [2]
          }
        ],
        "version": "1.0",
        "system": {
          "app": {
            "build": "14192",
            "bundleID": "com.ge.cbyge1",
            "name": "Cync",
            "version": "6.8.2"
          },
          "ltk": "c0c1c2c3c4c5c6c7d8d9dadbdcdddedf",
          "platform": {
            "os": "iOS",
            "machine": "N/A",
            "model": "iPhone",
            "localizedModel": "iPhone",
            "version": "15.6.1"
          }
        },
        "sceneArray": ["my scene data removed intentionally"],
        "schedules": ["my schedules removed intentionally"],
        "deviceIdRecord": 2,
        "placeName": "Home",
        "ftsModel": {
          "sleep": "11:00 PM",
          "wakeUp": "07:00 AM",
          "am": "07:00 AM",
          "day": "11:00 AM",
          "pm": "03:00 PM"
        },
        "createDate": "2020-06-06 10:50:46"
      }
    }
  ]
}
nikshriv commented 1 year ago

Hi, in the process of adding ambient light sensor support, the new code probably broke your prior installation. Simple solution is to delete your current installation and reinstall. If that doesn't work, please let me know.

onelz commented 1 year ago

Yep that is it! thank you!