FazBrowse GitHub Viewer | Trending |
URL:
| Home
Tools: [Download Repo ZIP]   [Original HTTPS Page]

IPCamera EC60 (US) not discovered · Issue #1241 · python-kasa/python-kasa · GitHub

Repository navigation

IPCamera EC60 (US) not discovered #1241

Closed

Description

python-kasa is not able to discover the EC60 smart camera device. Running kasa --debug --device-family SMART.IPCAMERA discover shows DEBUG:kasa.discover:[DISCOVERY] Unable to find device type for 192.168.0.XXX: Unable to find the device type field!. So I checked the device info struct and see it has one more nest of system:

{
  "system": {
    "get_sysinfo": {
      "system": {
        "stream_version": 2,
        "sw_ver": "2.3.22 Build 20230731 rel.69808",
        "hw_ver": "4.0",
        "type": "IOT.IPCAMERA"

I can create a PR, including an new fixture.

Activity

  1. sdb9696 commented on Nov 10, 2024

    Contributor

    This is confusing as we only support SMART cameras with —experimental but this appears to be an IOT.CAMERA. Are you able to paste the whole discovery response (redacted)?

  2. Puxtril commented on Nov 10, 2024

    ContributorAuthor

    Yea here's the data, manually scrubbed. I was trying to generate a fixture via python -m devtools.dump_devinfo --experimental --host 192.168.0.XXX but got an error kasa.exceptions.UnsupportedDeviceError: Unknown device type: IOT.IPCAMERA

    I'm not familiar with the experimental flag, how can I test with that?

    Scrubbed data
    {
      "system": {
        "get_sysinfo": {
          "system": {
            "stream_version": 2,
            "sw_ver": "2.3.22 Build 20230731 rel.69808",
            "hw_ver": "4.0",
            "type": "IOT.IPCAMERA",
            "model": "EC60(US)",
            "dev_name": "Kasa Spot, 24/7 Recording",
            "alias": "Kasa_Cam",
            "mic_mac": "000000000000",
            "mac": "00:00:00:00:00:00",
            "hwId": "0000000000000000000000000000000000000000",
            "oemId": "0000000000000000000000000000000000000000",
            "deviceId": "0000000000000000000000000000000000000000",
            "system_time": 1690803724,
            "c_opt": [
              0,
              1
            ],
            "new_feature": [
              2,
              3,
              4,
              5,
              7,
              9
            ],
            "f_list": [
              1,
              2
            ],
            "rssi": -50,
            "latitude": 0.000000,
            "longitude": 0.000000,
            "led_status": "on",
            "camera_switch": "on",
            "resolution": "720P",
            "updating": false,
            "status": "new",
            "bind_status": false,
            "last_activity_timestamp": 0,
            "a_type": 2,
            "is_cal": 1
          },
          "err_code": 0
        }
      }
    }
    
  3. rytilahti commented on Nov 10, 2024

    Member

    The discovery protocol is similar to other kasa devices, but support for these cameras is not currently implemented. See the stale PR #537 for some details on the protocol itself. The comms seems to be:

    • HTTPS on port 10443
    • POST requests on /data/LINKIE.json
    • Request data follows the format used by "IOT" devices as expected.
    • Payload: base64-encoded, url-encoded xor-encrypted, passed in POST data under content key: (content=quote(base64(xor_encrypted_payload)))

    If you are interested in reviving that PR (the code base has changed quite a bit when it comes to protocol handling), we can help with that :-)

  4. Puxtril commented on Nov 10, 2024

    ContributorAuthor

    I can try to revive it, though I'm new to the IOT world so I'll need time to familiarize myself with the PR contents.

  5. rytilahti commented on Nov 10, 2024

    Member

    I would recommend not trying to revive it as is (at least not yet), but rather use it as a starting point to understand the details & making smaller PRs to add individual parts separately.

    I'd recommend the following, separate steps in the following order:

    • Implementing the transport protocol, so that you can use kasa command in the cli to test commands. You can take a look into the file in that PR, but the implementation will differ as we have restructured the code base since then to make it easier to support new transports.
    • Implementing a very basic IotCamera class (inheriting from IotDevice), the code in that PR is a good starting point to work on, but I'd start with just the basics (i.e., work on the information & commands in the main "module").
    • Update devtools.dump_devinfo to perform the extra queries and create a fixture file for this device.
    • Add ptz module and implement Features like done in other modules
    • Add support for discovery, this could also be done after getting a basic IotCamera implemented, before starting to look into the ptz module.

    As you can see, there is quite a bit of work involved in this, but we can help along the way to make it happen. I have an open PR to add support for another new transport (#943) that is somewhat similar in a sense that it's also using HTTPS and POST requests, so maybe it's time that I dig into how to do that properly and then help you with yours.

    If you are on the homeassistant discord, feel free to message me (I'm using the same handle there) and I will try to explain & help you when needed.

  6. Puxtril commented on Nov 10, 2024

    ContributorAuthor

    Thanks for all the guidance with this! Breaking it up into smaller chunks is much more manageable, I was getting daunted looking at that PR... But I've already bought the device, so I definitely want to see this supported haha.

    I'll start looking at the transport protocol this week. If I have any smaller questions as I work through this, I'll reach out on Discord.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions


      Back | FazBrowse Home | New Git URL