Private Sub AfterConnect
mqtt.Subscribe($"${username}/f/temp-sleep"$, 0)
UpdateState
End Sub
Sub mqtt_MessageArrived (Topic As String, Payload() As Byte)
If Topic.EndsWith("/temp-sleep") Then
Dim temp As String = BytesToString(Payload, 0, Payload.Length, "ascii")
temperature = temp
UpdateState
End If
End Sub