you need to store the thing status into a switch item with a rule like the one
rule "broadlink:sp2:34-ea-34-f5-ae-aa"
when Thing "broadlink:sp2:34-ea-34-f5-ae-aa" changed
then
{
var String thingStatusInfo = getThingStatusInfo("broadlink:sp2:34-ea-34-f5-ae-aa").getStatus.toString
switch (thingStatusInfo) {
case "ONLINE" : {thingStatusInfo="ON"}
default : {thingStatusInfo="OFF"}
}
logInfo("txtBroadlink SP2 [192.168.1.105] SP2_3-thingStatusInfo", thingStatusInfo.toString)
SP2_3_LastUpdate.postUpdate(new DateTimeType())
SP2_3_Status.sendCommand(thingStatusInfo.toString)
}
end
you can persist the Switch item and use this timeline Timeline for Basic UI