HLK-SW16 Relay Module keeps reconnecting

Hi guys,

So this is my first post on the forum, sorry if I placed it in the wrong category.
We’re setting up our new house and planned to use HLK-SW16 modules to control several outlets around the house. When trying out the setup I noticed that sometimes the connection to the modules drop for a very short amount of time. But when this happens during a command to switch on/off all relays, it halts the command and stops.
So my question is, what could be the problem? And how might I be able to fix it?

Thanks in advance,
Bob

Ps. this is what the log says:

“HLK-SW16 relay1 connected
23:10 components/hlk_sw16/init.py (WARNING) - message first occured at 23:09 and shows up 6 times”
“HLK-SW16 relay1 disconnected
23:10 components/hlk_sw16/init.py (WARNING) - message first occured at 23:09 and shows up 6 times”

And what I see happen is that my switch in the main screen of my home changes to ‘not availible’ for a short time.

FYI this incompatibility should be fixed by my commit adding a keep-alive.

@jameshilliard I seem to be getting the same problem with the fix. I have created a custom component to attempt to debug the code. I have an older version of the SW16 module and it seems to have a different protocol
Total of 16 relays:

send:23 2a 31 30 01 62 2a 23 Open the relay 1 and return the eight bytes:61 61 31 30 01 62 62 62

send:23 2a 31 20 01 52 2a 23 Close the relay 1 and return the eight bytes:61 61 31 20 01 52 62 62

send:23 2a 32 30 01 63 2a 23 Open the relay 2 and return the eight bytes:61 61 32 30 01 63 62 62

send:23 2a 32 20 01 53 2a 23 Close the relay 2 and return the eight bytes:61 61 32 20 01 53 62 62

While the logfile shows this
2020-05-25 17:11:12 INFO (MainThread) [homeassistant.components.switch] Setting up switch.hlk_sw16
2020-05-25 17:11:12 DEBUG (MainThread) [custom_components.hlk_sw16] init just 0 relay1 <hlk_sw16.protocol.SW16Client object at 0x6f6e7e10>
2020-05-25 17:11:12 DEBUG (MainThread) [custom_components.hlk_sw16] init relay1-1 1 relay1 <hlk_sw16.protocol.SW16Client object at 0x6f6e7e10>
2020-05-25 17:11:12 DEBUG (MainThread) [custom_components.hlk_sw16] name just
2020-05-25 17:11:12 DEBUG (MainThread) [hlk_sw16.protocol] sending packet: b’aa1e000000000000000000000000000000000bbb’

Where is the hlk_sw16.protocol packet generated I can’t find a reference to it in the code.

My firmware is version Upgrade Firmware for the SW16 is (V1.95(May 9 2014))

Any pointers would be great.

The packet processing code is in my library, if you can port forward the control port(port 8080) and PM me the IP I can see what’s going. By the way I did overhaul the integration to use conflig flow here, although it hasn’t been merged yet.

Thanks James, now I will just have to find out where that library is installed in the Haas subsystem. If I telnet into my board via 8080 I do not get any output. It is only if I write the packet lists above - I got the details from HiLink directly when I purchased the SW16 about 4 years ago. I have another two that are new and have the RTC clock onboard. Would like to get my older board to work though.

1 Like

I have the same old version of HLK-SW16 looks like here (no battery)


The firmware is V1.95(Jun 10 2014) and there is no any update.
I see the same issue:

WARNING (MainThread) [homeassistant.components.hlk_sw16] HLK-SW16 relay1 disconnected
WARNING (MainThread) [homeassistant.components.hlk_sw16] HLK-SW16 relay1 connected
WARNING (MainThread) [homeassistant.components.hlk_sw16] HLK-SW16 relay1 disconnected
WARNING (MainThread) [homeassistant.components.hlk_sw16] HLK-SW16 relay1 connected

etc.

Here is my simple java app to control it from command line

package com.slydiman.hlk_sw16_cmd;

import java.io.BufferedInputStream;
import java.io.BufferedOutputStream;
import java.io.IOException;
import java.net.Socket;

public class hlk_sw16_cmd {
	public static void main(String[] args) {
		
		if (args.length != 2 && args.length != 4) {
			System.err.println("usage: hlk_sw16_cmd <ip> <port> [<relay_#> <value>]");
			System.err.println("relay_#: 0..15 or all");
			System.err.println("value: 1/0 or on/off");
			return;
		}
		
		String ip = args[0];
		int port = Integer.parseInt(args[1]);
		
		byte cmd[] = {'#','*',0x01,0x30,0x01, 0x01,'*','#'};
		
		int response_len;
		
		if (args.length == 2) {
			response_len = 19;
			cmd[2] = (byte)(0x4F);
		}else{
			int num = -1;
			if (!"all".equals(args[2])) {
				num = Integer.parseInt(args[2]);
			}
			
			if (num < -1 || num > 15) {
				System.err.println("hlk_sw16_cmd: invalid <relay_#>");
				return;
			}
			
			boolean val = ("1".equals(args[3]) || "on".equals(args[3]));
			
			if (num == -1) {	// all
				response_len = 19;
				cmd[2] = (byte)(val ? 0x1F : 0x1E);
			} else {
				response_len = 8;
				cmd[2] = (byte)(0x30 + num);
				cmd[3] = (byte)(val ? 0x30 : 0x20);
			}
		}
		cmd[5] = (byte)(cmd[2] + cmd[3] + cmd[4]);		
		
		System.out.println("hlk_sw16_cmd: connecting...");
		Socket socket = null;
		try {
			socket = new Socket(ip, port);
			BufferedOutputStream out = new BufferedOutputStream(socket.getOutputStream());
			System.out.println("hlk_sw16_cmd: sending...");
			out.write(cmd);
			out.flush();
			
			System.out.println("hlk_sw16_cmd: reading...");
			BufferedInputStream in = new BufferedInputStream(socket.getInputStream());
			byte [] data = new byte[response_len];
		    int len = in.read(data);
		    
			if (len == 8)
			{
				if((data[0]=='a')&&(data[1]=='a')&&(data[6]=='b')&&(data[7]=='b')) {
					System.out.println("Relay # " + (data[2] - 0x30) + ": " + (data[3] == 0x30 ? "ON" : (data[3] == 0x20 ? "OFF" : "UNKNOWN")));
				} else {
					System.err.println("Error response [8]");
				}
			}
			else if (len == 19)
			{
				int sum = 0;
				for (int i=1; i<=16; ++i) {
					sum += data[i];
				}
				if ((data[0]=='#') && (data[18]=='*') && ((sum & 0xFF) == data[17]))
				{
					for (int i=0; i<16; ++i) {
						System.out.println("Relay # " + ((i+1) & 0xF) + ": " + (data[i+1] == 0x02 ? "ON" : (data[i+1] == 0x01 ? "OFF" : "UNKNOWN(0x"+Integer.toHexString(data[i+1])+")")));
					}
				} else {
					System.err.println("Error response [19]");
				}
			} else {
				System.err.println("Error response ["+len+"]");
			}
		} catch (Exception e) {
			e.printStackTrace();
		} finally {
			if (socket != null) {
				try {
					socket.close();
				} catch (IOException e) {
					e.printStackTrace();
				}
				socket = null;
			}
		}
	}
}

Hmm, what version of home-assistant are you using(there was a fairly recent fix for some variants of these devices)? If you can port forward the relay I can probably fix whatever issue is happening here, just a bit tricky to debug without being able to test commands.

I’m using the latest HA 0.110.4
Probably a permanent connection is bad idea.
You need to connect for a short time only to send a command or request states.
Note HA failed to start at all because of this connection issue in the main thread in HLK-SW16 integration.
It makes the entire system very unstable.
I have sent the address of my HLK-SW16 to you via PM. Feel free to debug.

I have same problem. HLK-SW16 version with battery.
HA 0.114.1

Logger: homeassistant.components.hlk_sw16
Source: components/hlk_sw16/__init__.py:85
Integration: Hi-Link HLK-SW16 (documentation, issues)
First occurred: 10:32:19 AM (319 occurrences)
Last logged: 1:57:27 PM

HLK-SW16 192.168.10.22:8080 disconnected

Telnet also shows “???i#???i#???i#???i#???i#???i#???i#???i#???i#???i#???i#??”

Part of my log:

2020-08-20 13:57:12 DEBUG (MainThread) [hlk_sw16.protocol] received date: Year: 1, Month: 1, Day: 28, Hour: 105, Minute: 36, Sec: 51, Week 1
2020-08-20 13:57:15 DEBUG (MainThread) [hlk_sw16.protocol] sending keep alive packet
2020-08-20 13:57:21 ERROR (MainThread) [hlk_sw16.protocol] disconnected due to error
2020-08-20 13:57:21 WARNING (MainThread) [homeassistant.components.hlk_sw16] HLK-SW16 192.168.10.22:8080 disconnected
2020-08-20 13:57:21 DEBUG (MainThread) [hlk_sw16.protocol] Protocol disconnected...reconnecting
2020-08-20 13:57:22 DEBUG (MainThread) [hlk_sw16.protocol] received date: Year: 1, Month: 1, Day: 28, Hour: 105, Minute: 37, Sec: 1, Week 1
2020-08-20 13:57:22 WARNING (MainThread) [homeassistant.components.hlk_sw16] HLK-SW16 192.168.10.22:8080 connected
2020-08-20 13:57:22 DEBUG (MainThread) [hlk_sw16.protocol] {'0': True, '1': True, '2': True, '3': True, '4': False, '5': False, '6': False, '7': False, '8': True, '9': True, 'a': True, 'b': True, 'c': False, 'd': False, 'e': False, 'f': False}
2020-08-20 13:57:22 DEBUG (MainThread) [hlk_sw16.protocol] sending packet: b'aa10010100000000000000000000000000000bbb'
2020-08-20 13:57:22 DEBUG (MainThread) [hlk_sw16.protocol] {'0': True, '1': True, '2': True, '3': True, '4': False, '5': False, '6': False, '7': False, '8': True, '9': True, 'a': True, 'b': True, 'c': False, 'd': False, 'e': False, 'f': False}
2020-08-20 13:57:22 DEBUG (MainThread) [hlk_sw16.protocol] sending packet: b'aa10030100000000000000000000000000000bbb'
2020-08-20 13:57:22 DEBUG (MainThread) [hlk_sw16.protocol] {'0': True, '1': True, '2': True, '3': True, '4': False, '5': False, '6': False, '7': False, '8': True, '9': True, 'a': True, 'b': True, 'c': False, 'd': False, 'e': False, 'f': False}
2020-08-20 13:57:22 DEBUG (MainThread) [hlk_sw16.protocol] sending packet: b'aa10050200000000000000000000000000000bbb'
2020-08-20 13:57:22 DEBUG (MainThread) [hlk_sw16.protocol] {'0': True, '1': True, '2': True, '3': True, '4': False, '5': False, '6': False, '7': False, '8': True, '9': True, 'a': True, 'b': True, 'c': False, 'd': False, 'e': False, 'f': False}
2020-08-20 13:57:22 DEBUG (MainThread) [hlk_sw16.protocol] sending packet: b'aa10070200000000000000000000000000000bbb'
2020-08-20 13:57:22 DEBUG (MainThread) [hlk_sw16.protocol] {'0': True, '1': True, '2': True, '3': True, '4': False, '5': False, '6': False, '7': False, '8': True, '9': True, 'a': True, 'b': True, 'c': False, 'd': False, 'e': False, 'f': False}
2020-08-20 13:57:22 DEBUG (MainThread) [hlk_sw16.protocol] sending packet: b'aa10090100000000000000000000000000000bbb'
2020-08-20 13:57:22 DEBUG (MainThread) [hlk_sw16.protocol] {'0': True, '1': True, '2': True, '3': True, '4': False, '5': False, '6': False, '7': False, '8': True, '9': True, 'a': True, 'b': True, 'c': False, 'd': False, 'e': False, 'f': False}
2020-08-20 13:57:22 DEBUG (MainThread) [hlk_sw16.protocol] sending packet: b'aa100b0100000000000000000000000000000bbb'
2020-08-20 13:57:22 DEBUG (MainThread) [hlk_sw16.protocol] {'0': True, '1': True, '2': True, '3': True, '4': False, '5': False, '6': False, '7': False, '8': True, '9': True, 'a': True, 'b': True, 'c': False, 'd': False, 'e': False, 'f': False}
2020-08-20 13:57:23 DEBUG (MainThread) [hlk_sw16.protocol] received date: Year: 1, Month: 1, Day: 28, Hour: 105, Minute: 37, Sec: 2, Week 1
2020-08-20 13:57:24 DEBUG (MainThread) [hlk_sw16.protocol] received date: Year: 1, Month: 1, Day: 28, Hour: 105, Minute: 37, Sec: 3, Week 1
2020-08-20 13:57:25 DEBUG (MainThread) [hlk_sw16.protocol] received date: Year: 1, Month: 1, Day: 28, Hour: 105, Minute: 37, Sec: 4, Week 1
2020-08-20 13:57:26 DEBUG (MainThread) [hlk_sw16.protocol] received date: Year: 1, Month: 1, Day: 28, Hour: 105, Minute: 37, Sec: 5, Week 1
2020-08-20 13:57:27 DEBUG (MainThread) [hlk_sw16.protocol] received date: Year: 1, Month: 1, Day: 28, Hour: 105, Minute: 37, Sec: 6, Week 1
2020-08-20 13:57:27 INFO (MainThread) [hlk_sw16.protocol] disconnected because of close/abort.
2020-08-20 13:57:27 WARNING (MainThread) [homeassistant.components.hlk_sw16] HLK-SW16 192.168.10.22:8080 disconnected
2020-08-20 13:57:27 DEBUG (MainThread) [hlk_sw16.protocol] Protocol disconnected...reconnecting
2020-08-20 13:57:28 WARNING (MainThread) [hlk_sw16.protocol] Could not connect due to error: [Errno 111] Connect call failed ('192.168.10.22', 8080)
2020-08-20 13:57:38 WARNING (MainThread) [homeassistant.components.hlk_sw16] HLK-SW16 192.168.10.22:8080 connected
2020-08-20 13:57:38 DEBUG (MainThread) [hlk_sw16.protocol] {'0': True, '1': True, '2': True, '3': True, '4': False, '5': False, '6': False, '7': False, '8': True, '9': True, 'a': True, 'b': True, 'c': False, 'd': False, 'e': False, 'f': False}
2020-08-20 13:57:38 DEBUG (MainThread) [hlk_sw16.protocol] sending packet: b'aa10010100000000000000000000000000000bbb'
2020-08-20 13:57:38 DEBUG (MainThread) [hlk_sw16.protocol] {'0': True, '1': True, '2': True, '3': True, '4': False, '5': False, '6': False, '7': False, '8': True, '9': True, 'a': True, 'b': True, 'c': False, 'd': False, 'e': False, 'f': False}
2020-08-20 13:57:38 DEBUG (MainThread) [hlk_sw16.protocol] sending packet: b'aa10030100000000000000000000000000000bbb'
2020-08-20 13:57:38 DEBUG (MainThread) [hlk_sw16.protocol] {'0': True, '1': True, '2': True, '3': True, '4': False, '5': False, '6': False, '7': False, '8': True, '9': True, 'a': True, 'b': True, 'c': False, 'd': False, 'e': False, 'f': False}
2020-08-20 13:57:38 DEBUG (MainThread) [hlk_sw16.protocol] sending packet: b'aa10050200000000000000000000000000000bbb'
2020-08-20 13:57:38 DEBUG (MainThread) [hlk_sw16.protocol] {'0': True, '1': True, '2': True, '3': True, '4': False, '5': False, '6': False, '7': False, '8': True, '9': True, 'a': True, 'b': True, 'c': False, 'd': False, 'e': False, 'f': False}
2020-08-20 13:57:38 DEBUG (MainThread) [hlk_sw16.protocol] sending packet: b'aa10070200000000000000000000000000000bbb'
2020-08-20 13:57:38 DEBUG (MainThread) [hlk_sw16.protocol] {'0': True, '1': True, '2': True, '3': True, '4': False, '5': False, '6': False, '7': False, '8': True, '9': True, 'a': True, 'b': True, 'c': False, 'd': False, 'e': False, 'f': False}
2020-08-20 13:57:38 DEBUG (MainThread) [hlk_sw16.protocol] sending packet: b'aa10090100000000000000000000000000000bbb'
2020-08-20 13:57:38 DEBUG (MainThread) [hlk_sw16.protocol] {'0': True, '1': True, '2': True, '3': True, '4': False, '5': False, '6': False, '7': False, '8': True, '9': True, 'a': True, 'b': True, 'c': False, 'd': False, 'e': False, 'f': False}
2020-08-20 13:57:38 DEBUG (MainThread) [hlk_sw16.protocol] sending packet: b'aa100b0100000000000000000000000000000bbb'
2020-08-20 13:57:38 DEBUG (MainThread) [hlk_sw16.protocol] {'0': True, '1': True, '2': True, '3': True, '4': False, '5': False, '6': False, '7': False, '8': True, '9': True, 'a': True, 'b': True, 'c': False, 'd': False, 'e': False, 'f': False}
2020-08-20 13:57:38 DEBUG (MainThread) [hlk_sw16.protocol] received date: Year: 1, Month: 1, Day: 28, Hour: 105, Minute: 37, Sec: 18, Week 1
2020-08-20 13:57:39 DEBUG (MainThread) [hlk_sw16.protocol] received date: Year: 1, Month: 1, Day: 28, Hour: 105, Minute: 37, Sec: 19, Week 1
2020-08-20 13:57:40 DEBUG (MainThread) [hlk_sw16.protocol] received date: Year: 1, Month: 1, Day: 28, Hour: 105, Minute: 37, Sec: 20, Week 1
2020-08-20 13:57:41 DEBUG (MainThread) [hlk_sw16.protocol] received date: Year: 1, Month: 1, Day: 28, Hour: 105, Minute: 37, Sec: 21, Week 1
2020-08-20 13:57:42 DEBUG (MainThread) [hlk_sw16.protocol] received date: Year: 1, Month: 1, Day: 28, Hour: 105, Minute: 37, Sec: 22, Week 1
2020-08-20 13:57:43 DEBUG (MainThread) [hlk_sw16.protocol] received date: Year: 1, Month: 1, Day: 28, Hour: 105, Minute: 37, Sec: 23, Week 1
2020-08-20 13:57:44 DEBUG (MainThread) [hlk_sw16.protocol] received date: Year: 1, Month: 1, Day: 28, Hour: 105, Minute: 37, Sec: 24, Week 1
2020-08-20 13:57:45 DEBUG (MainThread) [hlk_sw16.protocol] received date: Year: 1, Month: 1, Day: 28, Hour: 105, Minute: 37, Sec: 25, Week 1
2020-08-20 13:57:46 DEBUG (MainThread) [hlk_sw16.protocol] received date: Year: 1, Month: 1, Day: 28, Hour: 105, Minute: 37, Sec: 26, Week 1
2020-08-20 13:57:47 DEBUG (MainThread) [hlk_sw16.protocol] received date: Year: 1, Month: 1, Day: 28, Hour: 105, Minute: 37, Sec: 27, Week 1
2020-08-20 13:57:48 DEBUG (MainThread) [hlk_sw16.protocol] received date: Year: 1, Month: 1, Day: 28, Hour: 105, Minute: 37, Sec: 28, Week 1
2020-08-20 13:57:49 DEBUG (MainThread) [hlk_sw16.protocol] received date: Year: 1, Month: 1, Day: 28, Hour: 105, Minute: 37, Sec: 29, Week 1
2020-08-20 13:57:50 DEBUG (MainThread) [hlk_sw16.protocol] received date: Year: 1, Month: 1, Day: 28, Hour: 105, Minute: 37, Sec: 30, Week 1
2020-08-20 13:57:51 DEBUG (MainThread) [hlk_sw16.protocol] received date: Year: 1, Month: 1, Day: 28, Hour: 105, Minute: 37, Sec: 31, Week 1
2020-08-20 13:57:52 DEBUG (MainThread) [hlk_sw16.protocol] received date: Year: 1, Month: 1, Day: 28, Hour: 105, Minute: 37, Sec: 32, Week 1
2020-08-20 13:57:53 DEBUG (MainThread) [hlk_sw16.protocol] received date: Year: 1, Month: 1, Day: 28, Hour: 105, Minute: 37, Sec: 33, Week 1
2020-08-20 13:57:54 DEBUG (MainThread) [hlk_sw16.protocol] received date: Year: 1, Month: 1, Day: 28, Hour: 105, Minute: 37, Sec: 34, Week 1
2020-08-20 13:57:55 DEBUG (MainThread) [hlk_sw16.protocol] received date: Year: 1, Month: 1, Day: 28, Hour: 105, Minute: 37, Sec: 35, Week 1
2020-08-20 13:57:56 DEBUG (MainThread) [hlk_sw16.protocol] received date: Year: 1, Month: 1, Day: 28, Hour: 105, Minute: 37, Sec: 36, Week 1
2020-08-20 13:57:57 DEBUG (MainThread) [hlk_sw16.protocol] received date: Year: 1, Month: 1, Day: 28, Hour: 105, Minute: 37, Sec: 37, Week 1
2020-08-20 13:57:58 DEBUG (MainThread) [hlk_sw16.protocol] received date: Year: 1, Month: 1, Day: 28, Hour: 105, Minute: 37, Sec: 38, Week 1
2020-08-20 13:57:59 DEBUG (MainThread) [hlk_sw16.protocol] received date: Year: 1, Month: 1, Day: 28, Hour: 105, Minute: 37, Sec: 39, Week 1
2020-08-20 13:58:00 DEBUG (MainThread) [hlk_sw16.protocol] received date: Year: 1, Month: 1, Day: 28, Hour: 105, Minute: 37, Sec: 40, Week 1
2020-08-20 13:58:01 DEBUG (MainThread) [hlk_sw16.protocol] received date: Year: 1, Month: 1, Day: 28, Hour: 105, Minute: 37, Sec: 41, Week 1
2020-08-20 13:58:02 DEBUG (MainThread) [hlk_sw16.protocol] received date: Year: 1, Month: 1, Day: 28, Hour: 105, Minute: 37, Sec: 42, Week 1
2020-08-20 13:58:03 DEBUG (MainThread) [hlk_sw16.protocol] received date: Year: 1, Month: 1, Day: 28, Hour: 105, Minute: 37, Sec: 43, Week 1
2020-08-20 13:58:04 DEBUG (MainThread) [hlk_sw16.protocol] received date: Year: 1, Month: 1, Day: 28, Hour: 105, Minute: 37, Sec: 44, Week 1
2020-08-20 13:58:05 DEBUG (MainThread) [hlk_sw16.protocol] received date: Year: 1, Month: 1, Day: 28, Hour: 105, Minute: 37, Sec: 45, Week 1
2020-08-20 13:58:06 DEBUG (MainThread) [hlk_sw16.protocol] received date: Year: 1, Month: 1, Day: 28, Hour: 105, Minute: 37, Sec: 46, Week 1
2020-08-20 13:58:07 DEBUG (MainThread) [hlk_sw16.protocol] received date: Year: 1, Month: 1, Day: 28, Hour: 105, Minute: 37, Sec: 47, Week 1
2020-08-20 13:58:08 DEBUG (MainThread) [hlk_sw16.protocol] received date: Year: 1, Month: 1, Day: 28, Hour: 105, Minute: 37, Sec: 48, Week 1
2020-08-20 13:58:09 DEBUG (MainThread) [hlk_sw16.protocol] received date: Year: 1, Month: 1, Day: 28, Hour: 105, Minute: 37, Sec: 49, Week 1
2020-08-20 13:58:10 DEBUG (MainThread) [hlk_sw16.protocol] received date: Year: 1, Month: 1, Day: 28, Hour: 105, Minute: 37, Sec: 49, Week 1
2020-08-20 13:58:11 DEBUG (MainThread) [hlk_sw16.protocol] received date: Year: 1, Month: 1, Day: 28, Hour: 105, Minute: 37, Sec: 50, Week 1
2020-08-20 13:58:12 DEBUG (MainThread) [hlk_sw16.protocol] received date: Year: 1, Month: 1, Day: 28, Hour: 105, Minute: 37, Sec: 51, Week 1
2020-08-20 13:58:13 WARNING (MainThread) [hlk_sw16.protocol] dropping invalid data: b'cc1f01011c6925340100000000000000000000'
2020-08-20 13:58:14 WARNING (MainThread) [hlk_sw16.protocol] dropping invalid data: b'cc1f01011c6925350100000000000000000001'
2020-08-20 13:58:15 WARNING (MainThread) [hlk_sw16.protocol] dropping invalid data: b'cc1f01011c6925360100000000000000000002'
2020-08-20 13:58:15 DEBUG (MainThread) [hlk_sw16.protocol] sending keep alive packet
2020-08-20 13:58:15 DEBUG (MainThread) [hlk_sw16.protocol] received date: Year: 1, Month: 1, Day: 28, Hour: 105, Minute: 37, Sec: 54, Week 1
2020-08-20 13:58:16 WARNING (MainThread) [hlk_sw16.protocol] dropping invalid data: b'cc1f01011c6925370100000000000000000003'
2020-08-20 13:58:17 WARNING (MainThread) [hlk_sw16.protocol] dropping invalid data: b'cc1f01011c6925380100000000000000000004'
2020-08-20 13:58:18 WARNING (MainThread) [hlk_sw16.protocol] dropping invalid data: b'cc1f01011c6925390100000000000000000005'
2020-08-20 13:58:18 DEBUG (MainThread) [hlk_sw16.protocol] sending keep alive packet
2020-08-20 13:58:18 DEBUG (MainThread) [hlk_sw16.protocol] received date: Year: 1, Month: 1, Day: 28, Hour: 105, Minute: 37, Sec: 58, Week 1
2020-08-20 13:58:19 WARNING (MainThread) [hlk_sw16.protocol] dropping invalid data: b'cc1f01011c69253a0100000000000000000006'
2020-08-20 13:58:20 WARNING (MainThread) [hlk_sw16.protocol] dropping invalid data: b'cc1f01011c69253b0100000000000000000007'
2020-08-20 13:58:21 DEBUG (MainThread) [hlk_sw16.protocol] received date: Year: 1, Month: 1, Day: 28, Hour: 105, Minute: 38, Sec: 0, Week 1
2020-08-20 13:58:22 DEBUG (MainThread) [hlk_sw16.protocol] received date: Year: 1, Month: 1, Day: 28, Hour: 105, Minute: 38, Sec: 1, Week 1
2020-08-20 13:58:23 DEBUG (MainThread) [hlk_sw16.protocol] received date: Year: 1, Month: 1, Day: 28, Hour: 105, Minute: 38, Sec: 2, Week 1
2020-08-20 13:58:23 DEBUG (MainThread) [hlk_sw16.protocol] received date: Year: 1, Month: 1, Day: 28, Hour: 105, Minute: 38, Sec: 3, Week 1
2020-08-20 13:58:24 DEBUG (MainThread) [hlk_sw16.protocol] received date: Year: 1, Month: 1, Day: 28, Hour: 105, Minute: 38, Sec: 4, Week 1
2020-08-20 13:58:25 DEBUG (MainThread) [hlk_sw16.protocol] received date: Year: 1, Month: 1, Day: 28, Hour: 105, Minute: 38, Sec: 5, Week 1
2020-08-20 13:58:26 DEBUG (MainThread) [hlk_sw16.protocol] received date: Year: 1, Month: 1, Day: 28, Hour: 105, Minute: 38, Sec: 6, Week 1
2020-08-20 13:58:27 DEBUG (MainThread) [hlk_sw16.protocol] received date: Year: 1, Month: 1, Day: 28, Hour: 105, Minute: 38, Sec: 7, Week 1
2020-08-20 13:58:28 DEBUG (MainThread) [hlk_sw16.protocol] received date: Year: 1, Month: 1, Day: 28, Hour: 105, Minute: 38, Sec: 8, Week 1
2020-08-20 13:58:29 DEBUG (MainThread) [hlk_sw16.protocol] received date: Year: 1, Month: 1, Day: 28, Hour: 105, Minute: 38, Sec: 9, Week 1
2020-08-20 13:58:30 DEBUG (MainThread) [hlk_sw16.protocol] received date: Year: 1, Month: 1, Day: 28, Hour: 105, Minute: 38, Sec: 10, Week 1
2020-08-20 13:58:31 DEBUG (MainThread) [hlk_sw16.protocol] received date: Year: 1, Month: 1, Day: 28, Hour: 105, Minute: 38, Sec: 11, Week 1
2020-08-20 13:58:32 DEBUG (MainThread) [hlk_sw16.protocol] received date: Year: 1, Month: 1, Day: 28, Hour: 105, Minute: 38, Sec: 12, Week 1
2020-08-20 13:58:33 DEBUG (MainThread) [hlk_sw16.protocol] received date: Year: 1, Month: 1, Day: 28, Hour: 105, Minute: 38, Sec: 13, Week 1
2020-08-20 13:58:34 DEBUG (MainThread) [hlk_sw16.protocol] received date: Year: 1, Month: 1, Day: 28, Hour: 105, Minute: 38, Sec: 14, Week 1
2020-08-20 13:58:35 DEBUG (MainThread) [hlk_sw16.protocol] received date: Year: 1, Month: 1, Day: 28, Hour: 105, Minute: 38, Sec: 15, Week 1
2020-08-20 13:58:36 DEBUG (MainThread) [hlk_sw16.protocol] received date: Year: 1, Month: 1, Day: 28, Hour: 105, Minute: 38, Sec: 16, Week 1
2020-08-20 13:58:37 DEBUG (MainThread) [hlk_sw16.protocol] received date: Year: 1, Month: 1, Day: 28, Hour: 105, Minute: 38, Sec: 17, Week 1
2020-08-20 13:58:38 DEBUG (MainThread) [hlk_sw16.protocol] received date: Year: 1, Month: 1, Day: 28, Hour: 105, Minute: 38, Sec: 18, Week 1
2020-08-20 13:58:39 DEBUG (MainThread) [hlk_sw16.protocol] received date: Year: 1, Month: 1, Day: 28, Hour: 105, Minute: 38, Sec: 19, Week 1
2020-08-20 13:58:40 DEBUG (MainThread) [hlk_sw16.protocol] received date: Year: 1, Month: 1, Day: 28, Hour: 105, Minute: 38, Sec: 20, Week 1
2020-08-20 13:58:41 DEBUG (MainThread) [hlk_sw16.protocol] received date: Year: 1, Month: 1, Day: 28, Hour: 105, Minute: 38, Sec: 21, Week 1
2020-08-20 13:58:42 DEBUG (MainThread) [hlk_sw16.protocol] received date: Year: 1, Month: 1, Day: 28, Hour: 105, Minute: 38, Sec: 22, Week 1
2020-08-20 13:58:43 DEBUG (MainThread) [hlk_sw16.protocol] received date: Year: 1, Month: 1, Day: 28, Hour: 105, Minute: 38, Sec: 23, Week 1
2020-08-20 13:58:44 DEBUG (MainThread) [hlk_sw16.protocol] received date: Year: 1, Month: 1, Day: 28, Hour: 105, Minute: 38, Sec: 24, Week 1
2020-08-20 13:58:45 DEBUG (MainThread) [hlk_sw16.protocol] received date: Year: 1, Month: 1, Day: 28, Hour: 105, Minute: 38, Sec: 25, Week 1
2020-08-20 13:58:46 DEBUG (MainThread) [hlk_sw16.protocol] received date: Year: 1, Month: 1, Day: 28, Hour: 105, Minute: 38, Sec: 26, Week 1
2020-08-20 13:58:47 DEBUG (MainThread) [hlk_sw16.protocol] received date: Year: 1, Month: 1, Day: 28, Hour: 105, Minute: 38, Sec: 27, Week 1
2020-08-20 13:58:48 DEBUG (MainThread) [hlk_sw16.protocol] received date: Year: 1, Month: 1, Day: 28, Hour: 105, Minute: 38, Sec: 28, Week 1
2020-08-20 13:58:49 DEBUG (MainThread) [hlk_sw16.protocol] received date: Year: 1, Month: 1, Day: 28, Hour: 105, Minute: 38, Sec: 29, Week 1
2020-08-20 13:58:50 DEBUG (MainThread) [hlk_sw16.protocol] received date: Year: 1, Month: 1, Day: 28, Hour: 105, Minute: 38, Sec: 30, Week 1
2020-08-20 13:58:51 DEBUG (MainThread) [hlk_sw16.protocol] received date: Year: 1, Month: 1, Day: 28, Hour: 105, Minute: 38, Sec: 31, Week 1
2020-08-20 13:58:52 DEBUG (MainThread) [hlk_sw16.protocol] received date: Year: 1, Month: 1, Day: 28, Hour: 105, Minute: 38, Sec: 32, Week 1
2020-08-20 13:58:53 DEBUG (MainThread) [hlk_sw16.protocol] received date: Year: 1, Month: 1, Day: 28, Hour: 105, Minute: 38, Sec: 33, Week 1
2020-08-20 13:58:54 DEBUG (MainThread) [hlk_sw16.protocol] received date: Year: 1, Month: 1, Day: 28, Hour: 105, Minute: 38, Sec: 34, Week 1
2020-08-20 13:58:55 DEBUG (MainThread) [hlk_sw16.protocol] received date: Year: 1, Month: 1, Day: 28, Hour: 105, Minute: 38, Sec: 35, Week 1
2020-08-20 13:58:56 DEBUG (MainThread) [hlk_sw16.protocol] received date: Year: 1, Month: 1, Day: 28, Hour: 105, Minute: 38, Sec: 36, Week 1
2020-08-20 13:58:57 DEBUG (MainThread) [hlk_sw16.protocol] received date: Year: 1, Month: 1, Day: 28, Hour: 105, Minute: 38, Sec: 37, Week 1
2020-08-20 13:58:58 DEBUG (MainThread) [hlk_sw16.protocol] received date: Year: 1, Month: 1, Day: 28, Hour: 105, Minute: 38, Sec: 37, Week 1
2020-08-20 13:58:59 DEBUG (MainThread) [hlk_sw16.protocol] received date: Year: 1, Month: 1, Day: 28, Hour: 105, Minute: 38, Sec: 38, Week 1
2020-08-20 13:59:00 DEBUG (MainThread) [hlk_sw16.protocol] received date: Year: 1, Month: 1, Day: 28, Hour: 105, Minute: 38, Sec: 39, Week 1
2020-08-20 13:59:01 DEBUG (MainThread) [hlk_sw16.protocol] received date: Year: 1, Month: 1, Day: 28, Hour: 105, Minute: 38, Sec: 40, Week 1
2020-08-20 13:59:02 DEBUG (MainThread) [hlk_sw16.protocol] received date: Year: 1, Month: 1, Day: 28, Hour: 105, Minute: 38, Sec: 41, Week 1
2020-08-20 13:59:03 DEBUG (MainThread) [hlk_sw16.protocol] received date: Year: 1, Month: 1, Day: 28, Hour: 105, Minute: 38, Sec: 42, Week 1
2020-08-20 13:59:04 DEBUG (MainThread) [hlk_sw16.protocol] received date: Year: 1, Month: 1, Day: 28, Hour: 105, Minute: 38, Sec: 43, Week 1
2020-08-20 13:59:05 DEBUG (MainThread) [hlk_sw16.protocol] received date: Year: 1, Month: 1, Day: 28, Hour: 105, Minute: 38, Sec: 44, Week 1
2020-08-20 13:59:06 DEBUG (MainThread) [hlk_sw16.protocol] received date: Year: 1, Month: 1, Day: 28, Hour: 105, Minute: 38, Sec: 45, Week 1
2020-08-20 13:59:07 DEBUG (MainThread) [hlk_sw16.protocol] received date: Year: 1, Month: 1, Day: 28, Hour: 105, Minute: 38, Sec: 46, Week 1
2020-08-20 13:59:08 DEBUG (MainThread) [hlk_sw16.protocol] received date: Year: 1, Month: 1, Day: 28, Hour: 105, Minute: 38, Sec: 47, Week 1
2020-08-20 13:59:09 DEBUG (MainThread) [hlk_sw16.protocol] received date: Year: 1, Month: 1, Day: 28, Hour: 105, Minute: 38, Sec: 48, Week 1
2020-08-20 13:59:10 DEBUG (MainThread) [hlk_sw16.protocol] received date: Year: 1, Month: 1, Day: 28, Hour: 105, Minute: 38, Sec: 49, Week 1
2020-08-20 13:59:10 DEBUG (MainThread) [hlk_sw16.protocol] received date: Year: 1, Month: 1, Day: 28, Hour: 105, Minute: 38, Sec: 50, Week 1
2020-08-20 13:59:11 WARNING (MainThread) [hlk_sw16.protocol] dropping invalid data: b'cc1f01011c6926330100000000000000000000'
2020-08-20 13:59:12 WARNING (MainThread) [hlk_sw16.protocol] dropping invalid data: b'cc1f01011c6926340100000000000000000001'
2020-08-20 13:59:13 WARNING (MainThread) [hlk_sw16.protocol] dropping invalid data: b'cc1f01011c6926350100000000000000000002'
2020-08-20 13:59:13 DEBUG (MainThread) [hlk_sw16.protocol] sending keep alive packet
2020-08-20 13:59:14 DEBUG (MainThread) [hlk_sw16.protocol] received date: Year: 1, Month: 1, Day: 28, Hour: 105, Minute: 38, Sec: 53, Week 1
2020-08-20 13:59:14 WARNING (MainThread) [hlk_sw16.protocol] dropping invalid data: b'cc1f01011c6926360100000000000000000003'
2020-08-20 13:59:15 WARNING (MainThread) [hlk_sw16.protocol] dropping invalid data: b'cc1f01011c6926370100000000000000000004'
2020-08-20 13:59:16 WARNING (MainThread) [hlk_sw16.protocol] dropping invalid data: b'cc1f01011c6926380100000000000000000005'
2020-08-20 13:59:17 DEBUG (MainThread) [hlk_sw16.protocol] sending keep alive packet
2020-08-20 13:59:17 DEBUG (MainThread) [hlk_sw16.protocol] received date: Year: 1, Month: 1, Day: 28, Hour: 105, Minute: 38, Sec: 56, Week 1
2020-08-20 13:59:17 WARNING (MainThread) [hlk_sw16.protocol] dropping invalid data: b'cc1f01011c6926390100000000000000000006'
2020-08-20 13:59:18 WARNING (MainThread) [hlk_sw16.protocol] dropping invalid data: b'cc1f01011c69263a0100000000000000000007'
2020-08-20 13:59:19 WARNING (MainThread) [hlk_sw16.protocol] dropping invalid data: b'cc1f01011c69263b0100000000000000000008'
2020-08-20 13:59:20 DEBUG (MainThread) [hlk_sw16.protocol] sending keep alive packet
2020-08-20 13:59:20 DEBUG (MainThread) [hlk_sw16.protocol] received date: Year: 1, Month: 1, Day: 28, Hour: 105, Minute: 38, Sec: 59, Week 1
2020-08-20 13:59:20 DEBUG (MainThread) [hlk_sw16.protocol] received date: Year: 1, Month: 1, Day: 28, Hour: 105, Minute: 39, Sec: 0, Week 1
2020-08-20 13:59:21 DEBUG (MainThread) [hlk_sw16.protocol] received date: Year: 1, Month: 1, Day: 28, Hour: 105, Minute: 39, Sec: 1, Week 1
...
2020-08-20 14:00:08 DEBUG (MainThread) [hlk_sw16.protocol] received date: Year: 1, Month: 1, Day: 28, Hour: 105, Minute: 39, Sec: 48, Week 1
2020-08-20 14:00:09 DEBUG (MainThread) [hlk_sw16.protocol] received date: Year: 1, Month: 1, Day: 28, Hour: 105, Minute: 39, Sec: 49, Week 1
2020-08-20 14:00:10 WARNING (MainThread) [hlk_sw16.protocol] dropping invalid data: b'cc1f01011c6927320100000000000000000000'
2020-08-20 14:00:11 WARNING (MainThread) [hlk_sw16.protocol] dropping invalid data: b'cc1f01011c6927330100000000000000000001'
2020-08-20 14:00:12 WARNING (MainThread) [hlk_sw16.protocol] dropping invalid data: b'cc1f01011c6927340100000000000000000002'
2020-08-20 14:00:12 DEBUG (MainThread) [hlk_sw16.protocol] sending keep alive packet
2020-08-20 14:00:12 DEBUG (MainThread) [hlk_sw16.protocol] received date: Year: 1, Month: 1, Day: 28, Hour: 105, Minute: 39, Sec: 52, Week 1
2020-08-20 14:00:13 WARNING (MainThread) [hlk_sw16.protocol] dropping invalid data: b'cc1f01011c6927350100000000000000000003'
2020-08-20 14:00:14 WARNING (MainThread) [hlk_sw16.protocol] dropping invalid data: b'cc1f01011c6927360100000000000000000004'
2020-08-20 14:00:15 WARNING (MainThread) [hlk_sw16.protocol] dropping invalid data: b'cc1f01011c6927370100000000000000000005'
2020-08-20 14:00:15 DEBUG (MainThread) [hlk_sw16.protocol] sending keep alive packet
2020-08-20 14:00:15 DEBUG (MainThread) [hlk_sw16.protocol] received date: Year: 1, Month: 1, Day: 28, Hour: 105, Minute: 39, Sec: 55, Week 1
2020-08-20 14:00:16 WARNING (MainThread) [hlk_sw16.protocol] dropping invalid data: b'cc1f01011c6927380100000000000000000006'
2020-08-20 14:00:17 WARNING (MainThread) [hlk_sw16.protocol] dropping invalid data: b'cc1f01011c6927390100000000000000000007'
2020-08-20 14:00:18 WARNING (MainThread) [hlk_sw16.protocol] dropping invalid data: b'cc1f01011c69273a0100000000000000000008'
2020-08-20 14:00:18 DEBUG (MainThread) [hlk_sw16.protocol] sending keep alive packet
2020-08-20 14:00:18 DEBUG (MainThread) [hlk_sw16.protocol] received date: Year: 1, Month: 1, Day: 28, Hour: 105, Minute: 39, Sec: 58, Week 1
2020-08-20 14:00:19 WARNING (MainThread) [hlk_sw16.protocol] dropping invalid data: b'cc1f01011c69273b0100000000000000000009'
2020-08-20 14:00:20 DEBUG (MainThread) [hlk_sw16.protocol] received date: Year: 1, Month: 1, Day: 28, Hour: 105, Minute: 40, Sec: 0, Week 1
...
2020-08-20 14:01:06 DEBUG (MainThread) [hlk_sw16.protocol] received date: Year: 1, Month: 1, Day: 28, Hour: 105, Minute: 40, Sec: 46, Week 1
2020-08-20 14:01:07 DEBUG (MainThread) [hlk_sw16.protocol] received date: Year: 1, Month: 1, Day: 28, Hour: 105, Minute: 40, Sec: 47, Week 1
2020-08-20 14:01:08 DEBUG (MainThread) [hlk_sw16.protocol] received date: Year: 1, Month: 1, Day: 28, Hour: 105, Minute: 40, Sec: 48, Week 1
2020-08-20 14:01:09 WARNING (MainThread) [hlk_sw16.protocol] dropping invalid data: b'cc1f01011c6928310100000000000000000000'
2020-08-20 14:01:10 WARNING (MainThread) [hlk_sw16.protocol] dropping invalid data: b'cc1f01011c6928320100000000000000000001'
2020-08-20 14:01:11 WARNING (MainThread) [hlk_sw16.protocol] dropping invalid data: b'cc1f01011c6928330100000000000000000002'
2020-08-20 14:01:11 DEBUG (MainThread) [hlk_sw16.protocol] sending keep alive packet
2020-08-20 14:01:11 DEBUG (MainThread) [hlk_sw16.protocol] received date: Year: 1, Month: 1, Day: 28, Hour: 105, Minute: 40, Sec: 51, Week 1
2020-08-20 14:01:12 WARNING (MainThread) [hlk_sw16.protocol] dropping invalid data: b'cc1f01011c6928340100000000000000000003'
2020-08-20 14:01:13 WARNING (MainThread) [hlk_sw16.protocol] dropping invalid data: b'cc1f01011c6928350100000000000000000004'
2020-08-20 14:01:14 WARNING (MainThread) [hlk_sw16.protocol] dropping invalid data: b'cc1f01011c6928360100000000000000000005'
2020-08-20 14:01:14 DEBUG (MainThread) [hlk_sw16.protocol] sending keep alive packet
2020-08-20 14:01:14 DEBUG (MainThread) [hlk_sw16.protocol] received date: Year: 1, Month: 1, Day: 28, Hour: 105, Minute: 40, Sec: 54, Week 1
2020-08-20 14:01:15 WARNING (MainThread) [hlk_sw16.protocol] dropping invalid data: b'cc1f01011c6928370100000000000000000006'
2020-08-20 14:01:16 WARNING (MainThread) [hlk_sw16.protocol] dropping invalid data: b'cc1f01011c6928380100000000000000000007'
2020-08-20 14:01:17 WARNING (MainThread) [hlk_sw16.protocol] dropping invalid data: b'cc1f01011c6928390100000000000000000008'
2020-08-20 14:01:17 DEBUG (MainThread) [hlk_sw16.protocol] sending keep alive packet
2020-08-20 14:01:17 DEBUG (MainThread) [hlk_sw16.protocol] received date: Year: 1, Month: 1, Day: 28, Hour: 105, Minute: 40, Sec: 57, Week 1
2020-08-20 14:01:18 WARNING (MainThread) [hlk_sw16.protocol] dropping invalid data: b'cc1f01011c69283a0100000000000000000009'
2020-08-20 14:01:19 WARNING (MainThread) [hlk_sw16.protocol] dropping invalid data: b'cc1f01011c69283b010000000000000000000a'
2020-08-20 14:01:20 DEBUG (MainThread) [hlk_sw16.protocol] received date: Year: 1, Month: 1, Day: 28, Hour: 105, Minute: 41, Sec: 0, Week 1

Not the same bug as the others, fixed here.

@jameshilliard absolutely awesome!
This fix will be included in 0.115 I guess, as it’s to late for 0.114.3?

Not sure, but you can just run from the dev branch for now since it has already been merged.

FYI
I have updated the component to support the early version of HLK-SW16 without RTC clock.