Sub tbnLight_CheckedChange(Checked As Boolean)
Dim msg(1) As Byte
Select tbnLight.Checked
Case True
msg(0) = 0x31
Case False
msg(0) = 0x30
End Select
Log("Sent Payload: " & BytesToString(msg, 0, msg.Length, "utf8"))
Try
mqtt.Publish("MyMQTT/21/1/V_LIGHT",msg)
Catch
Log(LastException)
If mqtt.Connected = False Then
mqtt.Connect
End If
End Try
End Sub