Skip to content

kasa.exceptions.SmartDeviceException: Communication error on system:set_relay_state #965

Closed
@OutsourcedGuru

Description

@OutsourcedGuru

kasa, version 0.6.2.1
Exception: Communication error on system:set_relay_state
Python 3.9.7
MacOS 12.6.3

Example code:

import asyncio
from kasa import SmartPlug
from pprint import pformat as pf

charger = "192.168.11.65"
plug = SmartPlug(charger)
# plug.timeout = 20
asyncio.run(plug.update())
# print("Hardware: %s" % pf(plug.hw_info))
# print("Full sysinfo: %s" % pf(plug.sys_info))
if (plug.is_on):
    asyncio.run(plug.turn_off())
else:
    print("Plug was already OFF")

If the plug is off then it simply displays the print() statement as expected. Uncommenting out the two print() statements before this works as expected. If the plug is off then the turn_off() method throws the exception as indicated. Adding a timeout of 20 seconds doesn't change this condition.

Things work fine using the kasa CLI.

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