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

KL400 Support · Issue #247 · python-kasa/python-kasa · GitHub

Repository navigation

KL400 Support #247

Closed
Closed

Description

Any chance for KL400 LED strip support? I just bought one thinking it would work seamlessly with HA just like my smart plug, whoops. Should have checked.

I'd consider myself a fairly advanced user so if there's anything I need to do from my end to help out or get things working I'm willing to take a crack at it.

Activity

  1. rytilahti commented on Nov 2, 2021

    Member

    Could you be more specific what exactly is not working as to my understanding it should be supported? Could #191 be related?

  2. dlangerm commented on Nov 2, 2021

    Author

    That does look slightly related. The thing is I can query the device with the CLI and it displays everything correctly as below:

    $ kasa --host 192.168.50.193
    
    == strip - KL400L5(US) ==
            Host: 192.168.50.193
            Device state: ON
    
            == Generic information ==
            Time:         2021-11-02 09:24:50
            Hardware:     1.0
            Software:     1.0.5 Build 210616 Rel.122727
            MAC (rssi):   60:A4:B7:xxx (-45)
            Location:     {'latitude': xxx, 'longitude': -xxx}
    
            == Device specific information ==
            Brightness: 96
            Is dimmable: True
            HSV: HSV(hue=179, saturation=100, value=96)
            Length: 16
    
    
            == Current State ==
            <EmeterStatus power=10.4 voltage=None current=None total=0.022>
    

    But when I try any of the specific CLI options (which I assume home assistant is doing) I get errors on all of them including "strip".

    $ kasa --strip --host 192.168.50.193                                           
    Traceback (most recent call last):
      File "/home/dlangerm/miniconda3/bin/kasa", line 8, in <module>
        sys.exit(cli())
      File "/home/dlangerm/miniconda3/lib/python3.9/site-packages/asyncclick/core.py", line 862, in __call__
        return anyio.run(self._main, main, args, kwargs, **({"backend":_anyio_backend} if _anyio_backend is not None else {}))
      File "/home/dlangerm/miniconda3/lib/python3.9/site-packages/anyio/_core/_eventloop.py", line 56, in run
        return asynclib.run(func, *args, **backend_options)  # type: ignore
      File "/home/dlangerm/miniconda3/lib/python3.9/site-packages/anyio/_backends/_asyncio.py", line 230, in run
        return native_run(wrapper(), debug=debug)
      File "/home/dlangerm/miniconda3/lib/python3.9/asyncio/runners.py", line 44, in run
        return loop.run_until_complete(main)
      File "/home/dlangerm/miniconda3/lib/python3.9/asyncio/base_events.py", line 642, in run_until_complete
        return future.result()
      File "/home/dlangerm/miniconda3/lib/python3.9/site-packages/anyio/_backends/_asyncio.py", line 225, in wrapper
        return await func(*args)
      File "/home/dlangerm/miniconda3/lib/python3.9/site-packages/asyncclick/core.py", line 865, in _main
        return await main(*args, **kwargs)
      File "/home/dlangerm/miniconda3/lib/python3.9/site-packages/asyncclick/core.py", line 814, in main
        rv = await self.invoke(ctx)
      File "/home/dlangerm/miniconda3/lib/python3.9/site-packages/asyncclick/core.py", line 1272, in invoke
        return await Command.invoke(self, ctx)
      File "/home/dlangerm/miniconda3/lib/python3.9/site-packages/asyncclick/core.py", line 1102, in invoke
        return await ctx.invoke(self.callback, **ctx.params)
      File "/home/dlangerm/miniconda3/lib/python3.9/site-packages/asyncclick/core.py", line 644, in invoke
        rv = await rv
      File "/home/dlangerm/miniconda3/lib/python3.9/site-packages/kasa/cli.py", line 90, in cli
        await ctx.invoke(state)
      File "/home/dlangerm/miniconda3/lib/python3.9/site-packages/asyncclick/core.py", line 644, in invoke
        rv = await rv
      File "/home/dlangerm/miniconda3/lib/python3.9/site-packages/asyncclick/core.py", line 644, in invoke
        rv = await rv
      File "/home/dlangerm/miniconda3/lib/python3.9/site-packages/kasa/cli.py", line 189, in state
        await dev.update()
      File "/home/dlangerm/miniconda3/lib/python3.9/site-packages/kasa/smartstrip.py", line 95, in update
        await super().update(update_children)
      File "/home/dlangerm/miniconda3/lib/python3.9/site-packages/kasa/smartdevice.py", line 293, in update
        if not self.has_emeter:
      File "/home/dlangerm/miniconda3/lib/python3.9/site-packages/kasa/smartdevice.py", line 87, in wrapped
        return f(*args, **kwargs)
      File "/home/dlangerm/miniconda3/lib/python3.9/site-packages/kasa/smartdevice.py", line 269, in has_emeter
        return "ENE" in self.features
      File "/home/dlangerm/miniconda3/lib/python3.9/site-packages/kasa/smartdevice.py", line 87, in wrapped
        return f(*args, **kwargs)
      File "/home/dlangerm/miniconda3/lib/python3.9/site-packages/kasa/smartdevice.py", line 263, in features
        return set(self.sys_info["feature"].split(":"))
    KeyError: 'feature'
    
  3. dlangerm commented on Nov 2, 2021

    Author

    BTW if I print out sys_info this is what I get:

    {
    'sw_ver': '1.0.5 Build 210616 Rel.122727', 'hw_ver': '1.0', 'model': 'KL400L5(US)', 'deviceId': 'xxx', 'oemId': 'xxx', 'hwId': 'xxx', 'rssi': -45, 'latitude_i': 'xxx', 'longitude_i': 'xxx', 'alias': 'strip', 'status': 'new', 'description': 'Kasa Smart Light Strip, Multicolor', 'mic_type': 'IOT.SMARTBULB', 'mic_mac': '60:A4:B7:xxx', 'dev_state': 'normal', 'is_factory': False, 'disco_ver': '1.0', 'ctrl_protocols': {'name': 'Linkie', 'version': '1.0'}, 'active_mode': 'schedule', 'is_dimmable': 1, 'is_color': 1, 'is_variable_color_temp': 0, 'LEF': 0, 'length': 16, 'light_state': {'on_off': 1, 'mode': 'normal', 'hue': 179, 'saturation': 100, 'color_temp': 0, 'brightness': 96}, 'lighting_effect_state': {'enable': 0, 'name': 'Haunted Mansion', 'custom': 0, 'id': 'xxx', 'brightness': 80}, 'preferred_state': [], 'err_code': 0
    }
  4. dlangerm commented on Nov 2, 2021

    Author

    I didn't notice "--strip" and "--lightstrip" were both options. The CLI works with --lightstrip for getting info. Closing as this is not a bug with the CLI. It still won't show up in home assistant for some reason.

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