Skip to content

TPLinkSmartDevice Class

Namespace: TPLinkSmartDevices.Devices

provides top-level functionalities which all smart devices use, including set up of remote access and several system information properties

Properties

Alias

Returns the user specified (or default) name of this device
public string Alias { get; private set; }

CloudServer

Returns the name of the server this device communicates to for cloud commands
public string CloudServer { get; private set; }

DeviceId

Returns the id of this device
public string DeviceId { get; private set; }

DevName

Returns the name of this device
public string DevName { get; private set; }

FirmwareId

Returns the firmware id of this device
public string FirmwareId { get; private set; }

HardwareId

Returns the hardware id of this device
public string HardwareId { get; private set; }

HardwareVersion

Returns the hardware version of this device
public string HardwareVersion { get; private set; }

Hostname

Returns the ip-address of this device
public string Hostname { get; private set; }

LocationLatLong

Returns the coordinates of the rough position the device is located at (location of network). LocationLatLong[0] is latitude, LocationLatLong[1] is longitude
public double[] LocationLatLong { get; private set; }

Caution

whether you find it questionable (I do!) or not, tp-link's devices collect data on position of your network.

MacAddress

Returns the mac address of this device
public string MacAddress { get; private set; }

Model

Returns the model and region code (EU,US,UK,JP, ...) of this device
public string Model { get; private set; }

OemId

Returns the manufacturers id of this device
public string OemId { get; private set; }

Port

Returns the port this device communicates on
public int Port { get; private set; }

RemoteAccessEnabled

Returns whether this device is configured for remote access via Kasa app
public bool RemoteAccessEnabled { get; private set; }

RSSI

Returns signal strength
public int RSSI { get; private set; } 

Type

public string Type { get; private set; }

Methods

ConfigureRemoteAccess(string, string)

Binds account with the specified credentials to tp-link's cloud server

public async Task ConfigureRemoteAccess(string username, string password)

Parameters
  • string username: username (e-mail address) of kasa account
  • string password: password of kasa account

UnbindRemoteAccess()

Unbinds currently connected account from tp-link's cloud server
public void UnbindRemoteAccess()

GetCloudInfo()

Refreshes cloud information and sets RemoteAccessEnabled and CloudServer properties accordingly
public void GetCloudInfo()

GetTime()

Returns current internal time of this device
public DateTime GetTime()

Needs Maintenance

This method needs maintenance. It is discouraged using it due to unexpected results or errors occurring

Refresh(dynamic)

Refreshes all properties of this device (includes a call to GetCloudInfo())

public async Task Refresh(dynamic sysInfo = null)

Parameters
  • dynamic sysInfo: response of smart devices on system properties, defaults to null which results in a new request being made

SetAlias(string)

Sets alias of this device

public void SetAlias(string value)

Parameters
  • string value: new alias to set