Stack Widgets for Kasa smart devices
- Add the following definitions to your layout:
xmlns:dataSources="clr-namespace:LostTech.Stack.Widgets.DataSources;assembly=LostTech.Stack.Widgets"
xmlns:kasa="clr-namespace:Stack.Kasa;assembly=Stack.Kasa"
- Create a sensor
<Grid.Resources>
<kasa:KasaOutlet x:Key="PowerMeter"
HostOrIP="192.168.1.2"
dataSources:DataSource.RefreshInterval="0:0:5" />
</Grid.Resources>
- Bind a
TextBlock
<TextBlock Text="{Binding Power, Source={StaticResource PowerMeter}, Mode=OneWay, StringFormat={}{0:0}W}"
Background="White" Padding="7,3" />
-
Build the project and copy the following files to the
CustomWidgets
folder (it should be next to yourLayouts
folder):Stack.Kasa.dll
,Newtonsoft.Json.dll
,slf4net.dll
, andKasa.dll
. -
Restart Stack and load the updated layout.