It looks like it only works for a few minutes after starting HA and initializing the Stick. Within those minutes I see data being gathered from the stick without issue for all my Circles and Stealths like this:
2020-03-28 16:12:59 DEBUG (MainThread) [plugwise] Open USB serial connection to Plugwise Zigbee stick
2020-03-28 16:12:59 DEBUG (MainThread) [plugwise] start serial port
2020-03-28 16:12:59 DEBUG (MainThread) [plugwise] Serial port initialized
2020-03-28 16:12:59 DEBUG (MainThread) [plugwise] Send init request to Plugwise Zigbee stick
2020-03-28 16:12:59 DEBUG (write_packets_process) [plugwise] Sending StickInitRequest to plugwise stick (b'\x05\x05\x03\x03000AB43C\r\n')
2020-03-28 16:12:59 DEBUG (Thread-2) [plugwise] Feed data: b'\n'
2020-03-28 16:12:59 DEBUG (Thread-2) [plugwise] Feed data: b'\x05\x05\x03\x030000099900'
2020-03-28 16:12:59 DEBUG (Thread-2) [plugwise] Parse data: b'\n\x05\x05\x03\x030000099900'
2020-03-28 16:12:59 DEBUG (Thread-2) [plugwise] Lookup message header (b'\x05\x05\x03\x03') in (b'\n\x05\x05\x03\x030000099900')
2020-03-28 16:12:59 DEBUG (Thread-2) [plugwise] Valid message header found at index 1
2020-03-28 16:12:59 DEBUG (Thread-2) [plugwise] Lookup message footer (b'\r\n') in (b'\x05\x05\x03\x030000099900')
2020-03-28 16:12:59 DEBUG (Thread-2) [plugwise] No valid message footer found yet
2020-03-28 16:12:59 DEBUG (Thread-2) [plugwise] Feed data: b'C'
2020-03-28 16:12:59 DEBUG (Thread-2) [plugwise] Parse data: b'\x05\x05\x03\x030000099900C'
2020-03-28 16:12:59 DEBUG (Thread-2) [plugwise] Lookup message header (b'\x05\x05\x03\x03') in (b'\x05\x05\x03\x030000099900C')
2020-03-28 16:12:59 DEBUG (Thread-2) [plugwise] Valid message header found at index 0
2020-03-28 16:12:59 DEBUG (Thread-2) [plugwise] Lookup message footer (b'\r\n') in (b'\x05\x05\x03\x030000099900C')
2020-03-28 16:12:59 DEBUG (Thread-2) [plugwise] No valid message footer found yet
2020-03-28 16:12:59 DEBUG (Thread-2) [plugwise] Feed data: b'19FEE\r\n\x05\x05\x03\x0300110999000D6F000258842E0101220D6F0002588DB0DD22FF01C9\r\n\x83'
2020-03-28 16:12:59 DEBUG (Thread-2) [plugwise] Parse data: b'\x05\x05\x03\x030000099900C19FEE\r\n\x05\x05\x03\x0300110999000D6F000258842E0101220D6F0002588DB0DD22FF01C9\r\n\x83'
2020-03-28 16:12:59 DEBUG (Thread-2) [plugwise] Lookup message header (b'\x05\x05\x03\x03') in (b'\x05\x05\x03\x030000099900C19FEE\r\n\x05\x05\x03\x0300110999000D6F000258842E0101220D6F0002588DB0DD22FF01C9\r\n\x83')
2020-03-28 16:12:59 DEBUG (Thread-2) [plugwise] Valid message header found at index 0
2020-03-28 16:12:59 DEBUG (Thread-2) [plugwise] Lookup message footer (b'\r\n') in (b'\x05\x05\x03\x030000099900C19FEE\r\n\x05\x05\x03\x0300110999000D6F000258842E0101220D6F0002588DB0DD22FF01C9\r\n\x83')
2020-03-28 16:12:59 DEBUG (Thread-2) [plugwise] Valid message footer found at index 20
But after some happy data gathering, it all grinds to a halt here:
2020-03-28 16:15:22 DEBUG (send_messages_deamon) [plugwise] send CirclePowerUsageRequest to 000D6F000076CAB4 using seq_id b'0B28'
2020-03-28 16:15:22 DEBUG (write_packets_process) [plugwise] Sending CirclePowerUsageRequest to plugwise stick (b'\x05\x05\x03\x030012000D6F000076CAB4EE24\r\n')
2020-03-28 16:15:22 DEBUG (Thread-2) [plugwise] Feed data: b'\x05'
2020-03-28 16:15:22 DEBUG (Thread-2) [plugwise] Feed data: b'\x05\x03\x0300000B2800C13953\r\n\x83'
2020-03-28 16:15:22 DEBUG (Thread-2) [plugwise] Parse data: b'\x05\x05\x03\x0300000B2800C13953\r\n\x83'
2020-03-28 16:15:22 DEBUG (Thread-2) [plugwise] Lookup message header (b'\x05\x05\x03\x03') in (b'\x05\x05\x03\x0300000B2800C13953\r\n\x83')
2020-03-28 16:15:22 DEBUG (Thread-2) [plugwise] Valid message header found at index 0
2020-03-28 16:15:22 DEBUG (Thread-2) [plugwise] Lookup message footer (b'\r\n') in (b'\x05\x05\x03\x0300000B2800C13953\r\n\x83')
2020-03-28 16:15:22 DEBUG (Thread-2) [plugwise] Valid message footer found at index 20
2020-03-28 16:15:22 DEBUG (Thread-2) [plugwise] Success acknowledge on message request with sequence id b'0B28'
2020-03-28 16:15:22 DEBUG (Thread-2) [plugwise] Reset parser : b'000B2800C13953\r\n\x83'
2020-03-28 16:15:22 DEBUG (Thread-2) [plugwise] Parse data: b'000B2800C13953\r\n\x83'
2020-03-28 16:15:22 DEBUG (Thread-2) [plugwise] Lookup message header (b'\x05\x05\x03\x03') in (b'000B2800C13953\r\n\x83')
2020-03-28 16:15:22 DEBUG (Thread-2) [plugwise] No valid message header found yet
2020-03-28 16:15:22 DEBUG (Thread-2) [plugwise] Feed data: b'\x05'
2020-03-28 16:15:22 DEBUG (Thread-2) [plugwise] Parse data: b'000B2800C13953\r\n\x83\x05'
2020-03-28 16:15:22 DEBUG (Thread-2) [plugwise] Lookup message header (b'\x05\x05\x03\x03') in (b'000B2800C13953\r\n\x83\x05')
2020-03-28 16:15:22 DEBUG (Thread-2) [plugwise] No valid message header found yet
2020-03-28 16:15:22 DEBUG (Thread-2) [plugwise] Feed data: b'\x05\x03\x0300130B28000D6F000076CAB40000FFFF00000000FFFFFFBA000B166C\r\n'
2020-03-28 16:15:22 DEBUG (Thread-2) [plugwise] Parse data: b'000B2800C13953\r\n\x83\x05\x05\x03\x0300130B28000D6F000076CAB40000FFFF00000000FFFFFFBA000B166C\r\n'
2020-03-28 16:15:22 DEBUG (Thread-2) [plugwise] Lookup message header (b'\x05\x05\x03\x03') in (b'000B2800C13953\r\n\x83\x05\x05\x03\x0300130B28000D6F000076CAB40000FFFF00000000FFFFFFBA000B166C\r\n')
2020-03-28 16:15:22 DEBUG (Thread-2) [plugwise] Valid message header found at index 17
2020-03-28 16:15:22 DEBUG (Thread-2) [plugwise] Lookup message footer (b'\r\n') in (b'\x05\x05\x03\x0300130B28000D6F000076CAB40000FFFF00000000FFFFFFBA000B166C\r\n')
2020-03-28 16:15:22 DEBUG (Thread-2) [plugwise] Valid message footer found at index 60
2020-03-28 16:15:22 DEBUG (Thread-2) [plugwise] New CirclePowerUsageResponse message with seq id b'0B28' for 000D6F000076CAB4
2020-03-28 16:15:22 DEBUG (Thread-2) [plugwise] Last update 2020-03-28 16:15:22.199340 of node 000D6F000076CAB4, last message 2020-03-28 16:15:22.363516
2020-03-28 16:15:22 DEBUG (send_messages_deamon) [plugwise] send NodePingRequest to 000D6F00004EEB0A using seq_id b'0B29'
2020-03-28 16:15:22 DEBUG (write_packets_process) [plugwise] Sending NodePingRequest to plugwise stick (b'\x05\x05\x03\x03000D000D6F00004EEB0A252A\r\n')
2020-03-28 16:15:23 WARNING (send_messages_deamon) [plugwise] Resend NodePingRequest for 000D6F00004EEB0A (b'0B29') because stick did not acknowledged send request
2020-03-28 16:15:23 DEBUG (send_messages_deamon) [plugwise] send CirclePowerUsageRequest to 000D6F00004EEB0A using seq_id b'0B29'
2020-03-28 16:15:23 DEBUG (write_packets_process) [plugwise] Sending CirclePowerUsageRequest to plugwise stick (b'\x05\x05\x03\x030012000D6F00004EEB0AED50\r\n')
2020-03-28 16:15:24 WARNING (send_messages_deamon) [plugwise] Resend CirclePowerUsageRequest for 000D6F00004EEB0A (b'0B29') because stick did not acknowledged send request
2020-03-28 16:15:24 DEBUG (send_messages_deamon) [plugwise] send NodePingRequest to 000D6F000416BA68 using seq_id b'0B29'
2020-03-28 16:15:24 DEBUG (write_packets_process) [plugwise] Sending NodePingRequest to plugwise stick (b'\x05\x05\x03\x03000D000D6F000416BA6819DC\r\n')
2020-03-28 16:15:26 WARNING (send_messages_deamon) [plugwise] Resend NodePingRequest for 000D6F000416BA68 (b'0B29') because stick did not acknowledged send request
2020-03-28 16:15:26 DEBUG (send_messages_deamon) [plugwise] send CirclePowerUsageRequest to 000D6F000416BA68 using seq_id b'0B29'
2020-03-28 16:15:26 DEBUG (write_packets_process) [plugwise] Sending CirclePowerUsageRequest to plugwise stick (b'\x05\x05\x03\x030012000D6F000416BA68D1A6\r\n')
2020-03-28 16:15:27 WARNING (send_messages_deamon) [plugwise] Resend CirclePowerUsageRequest for 000D6F000416BA68 (b'0B29') because stick did not acknowledged send request
2020-03-28 16:15:27 DEBUG (send_messages_deamon) [plugwise] send NodePingRequest to 000D6F000046A0B1 using seq_id b'0B29'
2020-03-28 16:15:27 DEBUG (write_packets_process) [plugwise] Sending NodePingRequest to plugwise stick (b'\x05\x05\x03\x03000D000D6F000046A0B1BA4B\r\n')
2020-03-28 16:15:28 WARNING (send_messages_deamon) [plugwise] Resend NodePingRequest for 000D6F000046A0B1 (b'0B29') because stick did not acknowledged send request
2020-03-28 16:15:28 DEBUG (send_messages_deamon) [plugwise] send CirclePowerUsageRequest to 000D6F000046A0B1 using seq_id b'0B29'
2020-03-28 16:15:28 DEBUG (write_packets_process) [plugwise] Sending CirclePowerUsageRequest to plugwise stick (b'\x05\x05\x03\x030012000D6F000046A0B17231\r\n')
2020-03-28 16:15:29 WARNING (send_messages_deamon) [plugwise] Resend CirclePowerUsageRequest for 000D6F000046A0B1 (b'0B29') because stick did not acknowledged send request
and does not seem to recover until I restart HA again.
EDIT: interesting detail, this was all in a USB2 port on my Pi4. If I try a USB3 port, it never comes this far and stalls on the initialization part.
It looks like the processing of the power use message fails when invalid poweruse is reported back and after that the receiving thread dies.
I tried to quick fix this in release 0.4.
Please update the requirement versie to 0.4 at the manifest.json file inside the custom_component folder like below:
Just FYI, @CoMPaTech and me, @bouwew, are working on a HA custom_component that supports the “new” Plugs, via the Adam HA.
Any suggestion on how we should name these new Plugs so they can be distinguished from the “old” Plug: the Circles and the Stealth’s?
Or, maybe the title of this topic can be changed to “Plugwise legacy Plugs component”?
(I have a number of these old units lying around collecting dust, several Sticks as well, anyone interested?)
@brefra thank you for this plugin!
i just got started with hass, so it took some time to get it running, but after a reboot or 2 it started working, and automatically showed my plugs, very cool indeed.
i have a couple of circles i only use for monitoring power, and which i don’t want to toggle accidentally, so i’ve disabled the switch part of those devices.
when looking at the logs later, i noticed a warning message about the disabled switches.
2020-03-29 12:50:00 WARNING (MainThread) [homeassistant.helpers.entity] Entity switch.circle_ecf19 is incorrectly being triggered for updates while it is disabled. This is a bug in the plugwise_stick integration.
2020-03-29 12:50:53 WARNING (MainThread) [homeassistant.helpers.entity] Entity switch.circle_ef08e is incorrectly being triggered for updates while it is disabled. This is a bug in the plugwise_stick integration.
2020-03-29 12:51:48 WARNING (MainThread) [homeassistant.helpers.entity] Entity switch.circle_ba0ae is incorrectly being triggered for updates while it is disabled. This is a bug in the plugwise_stick integration.
2020-03-29 12:58:07 WARNING (MainThread) [homeassistant.helpers.entity] Entity switch.circle_bc4ff is incorrectly being triggered for updates while it is disabled. This is a bug in the plugwise_stick integration.
doesn’t seem to be a big problem, but thought i would mention it here
I love to see my Plugwise stick integration is usable
To anyone who is interested I just have updated the library and the required custom component files.
Besides some code fixes and cleanups, this release corrects the power consumption calculation of historic power use (last hour, today & yesterday). It also adds the power production messurement of Circle plugs.
@koter84, I’ll have a look into the warning messages.
@bouwew, we must indeed make a clear distinction between the old and new Plugwise products. I’ve called my integration plugwise_stick to “link” the name to the required (legacy) USB stick. I intend to emphasize this in the linked documentation when I do the final pull request to append this integration to HA core.
@brefra I updated to your latest release, but it seems this broke the integration. All my modules are now offline and no data is coming in anymore. Also tried removing and re-adding through integrations, no joy.
The following is all the logging after adding the stick again. After this nothing happens anymore:
2020-04-05 21:12:58 WARNING (MainThread) [homeassistant.loader] You are using a custom integration for plugwise_stick which has not been tested by Home Assistant. This component might cause stability problems, be sure to disable it if you experience issues with Home Assistant.
2020-04-05 21:13:29 DEBUG (MainThread) [plugwise] Open USB serial connection to Plugwise Zigbee stick
2020-04-05 21:13:29 DEBUG (MainThread) [plugwise] start serial port
2020-04-05 21:13:29 DEBUG (MainThread) [plugwise] Serial port initialized
2020-04-05 21:13:29 DEBUG (MainThread) [plugwise] Send init request to Plugwise Zigbee stick
2020-04-05 21:13:29 INFO (MainThread) [homeassistant.setup] Setting up plugwise_stick
2020-04-05 21:13:29 DEBUG (write_packets_process) [plugwise] Sending StickInitRequest to plugwise stick (b'\x05\x05\x03\x03000AB43C\r\n')
2020-04-05 21:13:29 INFO (MainThread) [homeassistant.setup] Setup of domain plugwise_stick took 0.0 seconds.
2020-04-05 21:13:29 DEBUG (MainThread) [plugwise] Open USB serial connection to Plugwise Zigbee stick
2020-04-05 21:13:29 DEBUG (MainThread) [plugwise] start serial port
2020-04-05 21:13:29 DEBUG (MainThread) [plugwise] Serial port initialized
2020-04-05 21:13:29 DEBUG (MainThread) [plugwise] Send init request to Plugwise Zigbee stick
2020-04-05 21:13:29 DEBUG (write_packets_process) [plugwise] Sending StickInitRequest to plugwise stick (b'\x05\x05\x03\x03000AB43C\r\n')
2020-04-05 21:13:29 DEBUG (Thread-5) [plugwise] Feed data: b'\x05'
2020-04-05 21:13:29 DEBUG (Thread-4) [plugwise] Feed data: b'\x05'
2020-04-05 21:13:29 DEBUG (Thread-5) [plugwise] Feed data: b'\x03\x030000000100C1FEED\r\n\x05\x05\x03\x0300110001000D6F000258842E0101220D6F0002588DB0DD22FF28C9\r\n\x83\x05\x05\x03\x030000000200C1103F\r\n\x05\x05\x03\x0300110002000D6F000258842E0101220D6F0002588DB0DD22FF9757\r\n\x83'
2020-04-05 21:13:29 DEBUG (Thread-5) [plugwise] Parse data: b'\x05\x03\x030000000100C1FEED\r\n\x05\x05\x03\x0300110001000D6F000258842E0101220D6F0002588DB0DD22FF28C9\r\n\x83\x05\x05\x03\x030000000200C1103F\r\n\x05\x05\x03\x0300110002000D6F000258842E0101220D6F0002588DB0DD22FF9757\r\n\x83'
2020-04-05 21:13:29 DEBUG (Thread-5) [plugwise] Lookup message header (b'\x05\x05\x03\x03') in (b'\x05\x03\x030000000100C1FEED\r\n\x05\x05\x03\x0300110001000D6F000258842E0101220D6F0002588DB0DD22FF28C9\r\n\x83\x05\x05\x03\x030000000200C1103F\r\n\x05\x05\x03\x0300110002000D6F000258842E0101220D6F0002588DB0DD22FF9757\r\n\x83')
2020-04-05 21:13:29 DEBUG (Thread-5) [plugwise] Valid message header found at index 21
2020-04-05 21:13:29 DEBUG (Thread-5) [plugwise] Lookup message footer (b'\r\n') in (b'\x05\x05\x03\x0300110001000D6F000258842E0101220D6F0002588DB0DD22FF28C9\r\n\x83\x05\x05\x03\x030000000200C1103F\r\n\x05\x05\x03\x0300110002000D6F000258842E0101220D6F0002588DB0DD22FF9757\r\n\x83')
2020-04-05 21:13:29 DEBUG (Thread-5) [plugwise] Valid message footer found at index 58
2020-04-05 21:13:29 DEBUG (Thread-5) [plugwise] New StickInitResponse message with seq id b'0001' for 000D6F000258842E
2020-04-05 21:13:29 DEBUG (Thread-5) [plugwise] Reset parser : b'\x83\x05\x05\x03\x030000000200C1103F\r\n\x05\x05\x03\x0300110002000D6F000258842E0101220D6F0002588DB0DD22FF9757\r\n\x83'
2020-04-05 21:13:29 DEBUG (Thread-5) [plugwise] Parse data: b'\x83\x05\x05\x03\x030000000200C1103F\r\n\x05\x05\x03\x0300110002000D6F000258842E0101220D6F0002588DB0DD22FF9757\r\n\x83'
2020-04-05 21:13:29 DEBUG (Thread-5) [plugwise] Lookup message header (b'\x05\x05\x03\x03') in (b'\x83\x05\x05\x03\x030000000200C1103F\r\n\x05\x05\x03\x0300110002000D6F000258842E0101220D6F0002588DB0DD22FF9757\r\n\x83')
2020-04-05 21:13:29 DEBUG (Thread-5) [plugwise] Valid message header found at index 1
2020-04-05 21:13:29 DEBUG (Thread-5) [plugwise] Lookup message footer (b'\r\n') in (b'\x05\x05\x03\x030000000200C1103F\r\n\x05\x05\x03\x0300110002000D6F000258842E0101220D6F0002588DB0DD22FF9757\r\n\x83')
2020-04-05 21:13:29 DEBUG (Thread-5) [plugwise] Valid message footer found at index 20
2020-04-05 21:13:29 DEBUG (Thread-5) [plugwise] Success acknowledge on message request with sequence id b'0002'
2020-04-05 21:13:29 DEBUG (Thread-5) [plugwise] Reset parser : b'00000200C1103F\r\n\x05\x05\x03\x0300110002000D6F000258842E0101220D6F0002588DB0DD22FF9757\r\n\x83'
2020-04-05 21:13:29 DEBUG (Thread-5) [plugwise] Parse data: b'00000200C1103F\r\n\x05\x05\x03\x0300110002000D6F000258842E0101220D6F0002588DB0DD22FF9757\r\n\x83'
2020-04-05 21:13:29 DEBUG (Thread-5) [plugwise] Lookup message header (b'\x05\x05\x03\x03') in (b'00000200C1103F\r\n\x05\x05\x03\x0300110002000D6F000258842E0101220D6F0002588DB0DD22FF9757\r\n\x83')
2020-04-05 21:13:29 DEBUG (Thread-5) [plugwise] Valid message header found at index 16
2020-04-05 21:13:29 DEBUG (Thread-5) [plugwise] Lookup message footer (b'\r\n') in (b'\x05\x05\x03\x0300110002000D6F000258842E0101220D6F0002588DB0DD22FF9757\r\n\x83')
2020-04-05 21:13:29 DEBUG (Thread-5) [plugwise] Valid message footer found at index 58
2020-04-05 21:13:29 DEBUG (Thread-5) [plugwise] New StickInitResponse message with seq id b'0002' for 000D6F000258842E
2020-04-05 21:13:29 ERROR (Thread-5) [plugwise] Error while processing StickInitResponse message : b'0002'
2020-04-05 21:13:29 DEBUG (Thread-5) [plugwise] Reset parser : b'\x83'
2020-04-05 21:13:30 DEBUG (send_messages_deamon) [plugwise] send NodeInfoRequest to 000D6F0002588DB0 using seq_id b'0003'
2020-04-05 21:13:30 DEBUG (write_packets_process) [plugwise] Sending NodeInfoRequest to plugwise stick (b'\x05\x05\x03\x030023000D6F0002588DB02DA1\r\n')
2020-04-05 21:13:30 DEBUG (Thread-5) [plugwise] Feed data: b'\x05'
2020-04-05 21:13:30 DEBUG (Thread-4) [plugwise] Feed data: b'\x05'
2020-04-05 21:13:30 DEBUG (Thread-5) [plugwise] Feed data: b'\x03\x030000000300C1BA6E\r\n# APSRequestNodeInfo: Source MAC: 000D6F000258842E# APSRequestNodeInfo: Destination MAC: \r\n000D6F0002588DB0\r\n\x05\x05\x03\x030000000300E110C8\r\n\x83'
2020-04-05 21:13:30 DEBUG (Thread-5) [plugwise] Parse data: b'\x05\x03\x030000000300C1BA6E\r\n# APSRequestNodeInfo: Source MAC: 000D6F000258842E# APSRequestNodeInfo: Destination MAC: \r\n000D6F0002588DB0\r\n\x05\x05\x03\x030000000300E110C8\r\n\x83'
2020-04-05 21:13:30 DEBUG (Thread-5) [plugwise] Lookup message header (b'\x05\x05\x03\x03') in (b'\x05\x03\x030000000300C1BA6E\r\n# APSRequestNodeInfo: Source MAC: 000D6F000258842E# APSRequestNodeInfo: Destination MAC: \r\n000D6F0002588DB0\r\n\x05\x05\x03\x030000000300E110C8\r\n\x83')
2020-04-05 21:13:30 DEBUG (Thread-5) [plugwise] Valid message header found at index 130
2020-04-05 21:13:30 DEBUG (Thread-5) [plugwise] Lookup message footer (b'\r\n') in (b'\x05\x05\x03\x030000000300E110C8\r\n\x83')
2020-04-05 21:13:30 DEBUG (Thread-5) [plugwise] Valid message footer found at index 20
2020-04-05 21:13:30 DEBUG (Thread-5) [plugwise] Timeout acknowledge on message request with sequence id b'0003'
2020-04-05 21:13:30 DEBUG (Thread-5) [plugwise] NodeInfoResponse request with seq id b'0003' processed
2020-04-05 21:13:30 DEBUG (Thread-5) [plugwise] Network time out received for (1 of 3) of NodeInfoRequest to 000D6F0002588DB0, resend request
2020-04-05 21:13:30 DEBUG (Thread-5) [plugwise] Reset parser : b'00000300E110C8\r\n\x83'
2020-04-05 21:13:30 DEBUG (Thread-5) [plugwise] Parse data: b'00000300E110C8\r\n\x83'
2020-04-05 21:13:30 DEBUG (Thread-5) [plugwise] Lookup message header (b'\x05\x05\x03\x03') in (b'00000300E110C8\r\n\x83')
2020-04-05 21:13:30 DEBUG (Thread-5) [plugwise] No valid message header found yet
2020-04-05 21:13:39 DEBUG (receive_timeout_deamon) [plugwise] Timeout expired for message with sequence ID b'0000'
2020-04-05 21:13:39 DEBUG (receive_timeout_deamon) [plugwise] Resend request StickInitRequest
2020-04-05 21:13:39 DEBUG (write_packets_process) [plugwise] Sending StickInitRequest to plugwise stick (b'\x05\x05\x03\x03000AB43C\r\n')
2020-04-05 21:13:39 DEBUG (Thread-4) [plugwise] Feed data: b'\x05'
2020-04-05 21:13:39 DEBUG (Thread-5) [plugwise] Feed data: b'\x05'
2020-04-05 21:13:39 DEBUG (Thread-4) [plugwise] Feed data: b'\x03\x030000000400C1DDBA\r\n\x05\x05\x03\x0300110004000D6F000258842E0101220D6F0002588DB0DD22FFF84A\r\n\x83'
2020-04-05 21:13:39 DEBUG (Thread-5) [plugwise] Parse data: b'00000300E110C8\r\n\x83\x05'
2020-04-05 21:13:39 DEBUG (Thread-4) [plugwise] Parse data: b'\x05\x05\x05\x03\x030000000400C1DDBA\r\n\x05\x05\x03\x0300110004000D6F000258842E0101220D6F0002588DB0DD22FFF84A\r\n\x83'
2020-04-05 21:13:39 DEBUG (Thread-5) [plugwise] Lookup message header (b'\x05\x05\x03\x03') in (b'00000300E110C8\r\n\x83\x05')
2020-04-05 21:13:39 DEBUG (Thread-4) [plugwise] Lookup message header (b'\x05\x05\x03\x03') in (b'\x05\x05\x05\x03\x030000000400C1DDBA\r\n\x05\x05\x03\x0300110004000D6F000258842E0101220D6F0002588DB0DD22FFF84A\r\n\x83')
2020-04-05 21:13:39 DEBUG (Thread-5) [plugwise] No valid message header found yet
2020-04-05 21:13:39 DEBUG (Thread-4) [plugwise] Valid message header found at index 1
2020-04-05 21:13:39 DEBUG (Thread-4) [plugwise] Lookup message footer (b'\r\n') in (b'\x05\x05\x03\x030000000400C1DDBA\r\n\x05\x05\x03\x0300110004000D6F000258842E0101220D6F0002588DB0DD22FFF84A\r\n\x83')
2020-04-05 21:13:39 DEBUG (Thread-4) [plugwise] Valid message footer found at index 20
2020-04-05 21:13:39 DEBUG (Thread-4) [plugwise] Success acknowledge on message request with sequence id b'0004'
2020-04-05 21:13:39 DEBUG (Thread-4) [plugwise] Reset parser : b'00000400C1DDBA\r\n\x05\x05\x03\x0300110004000D6F000258842E0101220D6F0002588DB0DD22FFF84A\r\n\x83'
2020-04-05 21:13:39 DEBUG (Thread-4) [plugwise] Parse data: b'00000400C1DDBA\r\n\x05\x05\x03\x0300110004000D6F000258842E0101220D6F0002588DB0DD22FFF84A\r\n\x83'
2020-04-05 21:13:39 DEBUG (Thread-4) [plugwise] Lookup message header (b'\x05\x05\x03\x03') in (b'00000400C1DDBA\r\n\x05\x05\x03\x0300110004000D6F000258842E0101220D6F0002588DB0DD22FFF84A\r\n\x83')
2020-04-05 21:13:39 DEBUG (Thread-4) [plugwise] Valid message header found at index 16
2020-04-05 21:13:39 DEBUG (Thread-4) [plugwise] Lookup message footer (b'\r\n') in (b'\x05\x05\x03\x0300110004000D6F000258842E0101220D6F0002588DB0DD22FFF84A\r\n\x83')
2020-04-05 21:13:39 DEBUG (Thread-4) [plugwise] Valid message footer found at index 58
2020-04-05 21:13:39 DEBUG (Thread-4) [plugwise] New StickInitResponse message with seq id b'0004' for 000D6F000258842E
2020-04-05 21:13:39 DEBUG (Thread-4) [plugwise] Reset parser : b'\x83'
2020-04-05 21:13:39 DEBUG (send_messages_deamon) [plugwise] send NodeInfoRequest to 000D6F0002588DB0 using seq_id b'0005'
2020-04-05 21:13:39 DEBUG (write_packets_process) [plugwise] Sending NodeInfoRequest to plugwise stick (b'\x05\x05\x03\x030023000D6F0002588DB02DA1\r\n')
2020-04-05 21:13:40 DEBUG (Thread-5) [plugwise] Feed data: b'\x05'
2020-04-05 21:13:40 DEBUG (Thread-5) [plugwise] Parse data: b'00000300E110C8\r\n\x83\x05\x05'
2020-04-05 21:13:40 DEBUG (Thread-5) [plugwise] Lookup message header (b'\x05\x05\x03\x03') in (b'00000300E110C8\r\n\x83\x05\x05')
2020-04-05 21:13:40 DEBUG (Thread-5) [plugwise] No valid message header found yet
2020-04-05 21:13:40 DEBUG (Thread-5) [plugwise] Feed data: b'\x05\x03\x030000000500C177EB\r\n# APSRequestNodeInfo: Source MAC: 000D6F000258842E# APSRequestNodeInfo: Destination MAC: \r\n000D6F0002588DB0\r\n\x05\x05\x03\x030000000500E1DD4D\r\n\x83'
2020-04-05 21:13:40 DEBUG (Thread-5) [plugwise] Parse data: b'00000300E110C8\r\n\x83\x05\x05\x05\x03\x030000000500C177EB\r\n# APSRequestNodeInfo: Source MAC: 000D6F000258842E# APSRequestNodeInfo: Destination MAC: \r\n000D6F0002588DB0\r\n\x05\x05\x03\x030000000500E1DD4D\r\n\x83'
2020-04-05 21:13:40 DEBUG (Thread-5) [plugwise] Lookup message header (b'\x05\x05\x03\x03') in (b'00000300E110C8\r\n\x83\x05\x05\x05\x03\x030000000500C177EB\r\n# APSRequestNodeInfo: Source MAC: 000D6F000258842E# APSRequestNodeInfo: Destination MAC: \r\n000D6F0002588DB0\r\n\x05\x05\x03\x030000000500E1DD4D\r\n\x83')
2020-04-05 21:13:40 DEBUG (Thread-5) [plugwise] Valid message header found at index 18
2020-04-05 21:13:40 DEBUG (Thread-5) [plugwise] Lookup message footer (b'\r\n') in (b'\x05\x05\x03\x030000000500C177EB\r\n# APSRequestNodeInfo: Source MAC: 000D6F000258842E# APSRequestNodeInfo: Destination MAC: \r\n000D6F0002588DB0\r\n\x05\x05\x03\x030000000500E1DD4D\r\n\x83')
2020-04-05 21:13:40 DEBUG (Thread-5) [plugwise] Valid message footer found at index 20
2020-04-05 21:13:40 DEBUG (Thread-5) [plugwise] Success acknowledge on message request with sequence id b'0005'
2020-04-05 21:13:40 DEBUG (Thread-5) [plugwise] Reset parser : b'00000500C177EB\r\n# APSRequestNodeInfo: Source MAC: 000D6F000258842E# APSRequestNodeInfo: Destination MAC: \r\n000D6F0002588DB0\r\n\x05\x05\x03\x030000000500E1DD4D\r\n\x83'
2020-04-05 21:13:40 DEBUG (Thread-5) [plugwise] Parse data: b'00000500C177EB\r\n# APSRequestNodeInfo: Source MAC: 000D6F000258842E# APSRequestNodeInfo: Destination MAC: \r\n000D6F0002588DB0\r\n\x05\x05\x03\x030000000500E1DD4D\r\n\x83'
2020-04-05 21:13:40 DEBUG (Thread-5) [plugwise] Lookup message header (b'\x05\x05\x03\x03') in (b'00000500C177EB\r\n# APSRequestNodeInfo: Source MAC: 000D6F000258842E# APSRequestNodeInfo: Destination MAC: \r\n000D6F0002588DB0\r\n\x05\x05\x03\x030000000500E1DD4D\r\n\x83')
2020-04-05 21:13:40 DEBUG (Thread-5) [plugwise] Valid message header found at index 125
2020-04-05 21:13:40 DEBUG (Thread-5) [plugwise] Lookup message footer (b'\r\n') in (b'\x05\x05\x03\x030000000500E1DD4D\r\n\x83')
2020-04-05 21:13:40 DEBUG (Thread-5) [plugwise] Valid message footer found at index 20
2020-04-05 21:13:40 DEBUG (Thread-5) [plugwise] Timeout acknowledge on message request with sequence id b'0005'
2020-04-05 21:13:40 DEBUG (Thread-5) [plugwise] Reset parser : b'00000500E1DD4D\r\n\x83'
2020-04-05 21:13:40 DEBUG (Thread-5) [plugwise] Parse data: b'00000500E1DD4D\r\n\x83'
2020-04-05 21:13:40 DEBUG (Thread-5) [plugwise] Lookup message header (b'\x05\x05\x03\x03') in (b'00000500E1DD4D\r\n\x83')
2020-04-05 21:13:40 DEBUG (Thread-5) [plugwise] No valid message header found yet
2020-04-05 21:13:41 WARNING (send_messages_deamon) [plugwise] Resend NodeInfoRequest for 000D6F0002588DB0 because stick did not acknowledge request (b'0005')
2020-04-05 21:13:41 DEBUG (send_messages_deamon) [plugwise] send NodeInfoRequest to 000D6F0002588DB0 using seq_id b'0005'
2020-04-05 21:13:41 DEBUG (send_messages_deamon) [plugwise] Retry 1 for message NodeInfoRequest to 000D6F0002588DB0
2020-04-05 21:13:41 DEBUG (write_packets_process) [plugwise] Sending NodeInfoRequest to plugwise stick (b'\x05\x05\x03\x030023000D6F0002588DB02DA1\r\n')
2020-04-05 21:13:41 DEBUG (Thread-4) [plugwise] Feed data: b'\x05'
2020-04-05 21:13:41 DEBUG (Thread-4) [plugwise] Feed data: b'\x05\x03\x030000000600C19939\r\n# APSRequestNodeInf'
2020-04-05 21:13:41 DEBUG (Thread-4) [plugwise] Parse data: b'\x05\x05\x03\x030000000600C19939\r\n# APSRequestNodeInf'
2020-04-05 21:13:41 DEBUG (Thread-4) [plugwise] Lookup message header (b'\x05\x05\x03\x03') in (b'\x05\x05\x03\x030000000600C19939\r\n# APSRequestNodeInf')
2020-04-05 21:13:41 DEBUG (Thread-4) [plugwise] Valid message header found at index 0
2020-04-05 21:13:41 DEBUG (Thread-4) [plugwise] Lookup message footer (b'\r\n') in (b'\x05\x05\x03\x030000000600C19939\r\n# APSRequestNodeInf')
2020-04-05 21:13:41 DEBUG (Thread-4) [plugwise] Valid message footer found at index 20
2020-04-05 21:13:41 DEBUG (Thread-4) [plugwise] Success acknowledge on message request with sequence id b'0006'
2020-04-05 21:13:41 DEBUG (Thread-4) [plugwise] Reset parser : b'00000600C19939\r\n# APSRequestNodeInf'
2020-04-05 21:13:41 DEBUG (Thread-4) [plugwise] Parse data: b'00000600C19939\r\n# APSRequestNodeInf'
2020-04-05 21:13:41 DEBUG (Thread-4) [plugwise] Lookup message header (b'\x05\x05\x03\x03') in (b'00000600C19939\r\n# APSRequestNodeInf')
2020-04-05 21:13:41 DEBUG (Thread-4) [plugwise] No valid message header found yet
2020-04-05 21:13:41 DEBUG (Thread-4) [plugwise] Feed data: b'o'
2020-04-05 21:13:41 DEBUG (Thread-4) [plugwise] Parse data: b'00000600C19939\r\n# APSRequestNodeInfo'
2020-04-05 21:13:41 DEBUG (Thread-4) [plugwise] Lookup message header (b'\x05\x05\x03\x03') in (b'00000600C19939\r\n# APSRequestNodeInfo')
2020-04-05 21:13:41 DEBUG (Thread-4) [plugwise] No valid message header found yet
2020-04-05 21:13:41 DEBUG (Thread-4) [plugwise] Feed data: b': Source MAC: 000D6F000258842E# APSRequestNodeInfo: Destination MAC: \r\n000D6F0002588DB0\r\n\x05\x05\x03\x030000000600E1339F\r\n\x83'
2020-04-05 21:13:41 DEBUG (Thread-4) [plugwise] Parse data: b'00000600C19939\r\n# APSRequestNodeInfo: Source MAC: 000D6F000258842E# APSRequestNodeInfo: Destination MAC: \r\n000D6F0002588DB0\r\n\x05\x05\x03\x030000000600E1339F\r\n\x83'
2020-04-05 21:13:41 DEBUG (Thread-4) [plugwise] Lookup message header (b'\x05\x05\x03\x03') in (b'00000600C19939\r\n# APSRequestNodeInfo: Source MAC: 000D6F000258842E# APSRequestNodeInfo: Destination MAC: \r\n000D6F0002588DB0\r\n\x05\x05\x03\x030000000600E1339F\r\n\x83')
2020-04-05 21:13:41 DEBUG (Thread-4) [plugwise] Valid message header found at index 125
2020-04-05 21:13:41 DEBUG (Thread-4) [plugwise] Lookup message footer (b'\r\n') in (b'\x05\x05\x03\x030000000600E1339F\r\n\x83')
2020-04-05 21:13:41 DEBUG (Thread-4) [plugwise] Valid message footer found at index 20
2020-04-05 21:13:41 DEBUG (Thread-4) [plugwise] Timeout acknowledge on message request with sequence id b'0006'
2020-04-05 21:13:41 DEBUG (Thread-4) [plugwise] Reset parser : b'00000600E1339F\r\n\x83'
2020-04-05 21:13:41 DEBUG (Thread-4) [plugwise] Parse data: b'00000600E1339F\r\n\x83'
2020-04-05 21:13:41 DEBUG (Thread-4) [plugwise] Lookup message header (b'\x05\x05\x03\x03') in (b'00000600E1339F\r\n\x83')
2020-04-05 21:13:41 DEBUG (Thread-4) [plugwise] No valid message header found yet
2020-04-05 21:13:42 WARNING (send_messages_deamon) [plugwise] Resend NodeInfoRequest for 000D6F0002588DB0 because stick did not acknowledge request (b'0005')
2020-04-05 21:13:42 DEBUG (send_messages_deamon) [plugwise] send NodeInfoRequest to 000D6F0002588DB0 using seq_id b'0007'
2020-04-05 21:13:42 DEBUG (send_messages_deamon) [plugwise] Retry 2 for message NodeInfoRequest to 000D6F0002588DB0
2020-04-05 21:13:42 DEBUG (write_packets_process) [plugwise] Sending NodeInfoRequest to plugwise stick (b'\x05\x05\x03\x030023000D6F0002588DB02DA1\r\n')
2020-04-05 21:13:42 DEBUG (Thread-4) [plugwise] Feed data: b'\x05'
2020-04-05 21:13:42 DEBUG (Thread-4) [plugwise] Parse data: b'00000600E1339F\r\n\x83\x05'
2020-04-05 21:13:42 DEBUG (Thread-4) [plugwise] Lookup message header (b'\x05\x05\x03\x03') in (b'00000600E1339F\r\n\x83\x05')
2020-04-05 21:13:42 DEBUG (Thread-4) [plugwise] No valid message header found yet
2020-04-05 21:13:42 DEBUG (Thread-4) [plugwise] Feed data: b'\x05\x03\x030000000700C13368\r\n# APSRequestNodeInfo: Source MAC: 000D6F000258842E# APSRequestNodeInfo: Destination MAC: \r\n000D6F0002588DB0\r\n\x05\x05\x03\x030000000700E199CE\r\n\x83'
2020-04-05 21:13:42 DEBUG (Thread-4) [plugwise] Parse data: b'00000600E1339F\r\n\x83\x05\x05\x03\x030000000700C13368\r\n# APSRequestNodeInfo: Source MAC: 000D6F000258842E# APSRequestNodeInfo: Destination MAC: \r\n000D6F0002588DB0\r\n\x05\x05\x03\x030000000700E199CE\r\n\x83'
2020-04-05 21:13:42 DEBUG (Thread-4) [plugwise] Lookup message header (b'\x05\x05\x03\x03') in (b'00000600E1339F\r\n\x83\x05\x05\x03\x030000000700C13368\r\n# APSRequestNodeInfo: Source MAC: 000D6F000258842E# APSRequestNodeInfo: Destination MAC: \r\n000D6F0002588DB0\r\n\x05\x05\x03\x030000000700E199CE\r\n\x83')
2020-04-05 21:13:42 DEBUG (Thread-4) [plugwise] Valid message header found at index 17
2020-04-05 21:13:42 DEBUG (Thread-4) [plugwise] Lookup message footer (b'\r\n') in (b'\x05\x05\x03\x030000000700C13368\r\n# APSRequestNodeInfo: Source MAC: 000D6F000258842E# APSRequestNodeInfo: Destination MAC: \r\n000D6F0002588DB0\r\n\x05\x05\x03\x030000000700E199CE\r\n\x83')
2020-04-05 21:13:42 DEBUG (Thread-4) [plugwise] Valid message footer found at index 20
2020-04-05 21:13:42 DEBUG (Thread-4) [plugwise] Success acknowledge on message request with sequence id b'0007'
2020-04-05 21:13:42 DEBUG (Thread-4) [plugwise] Reset parser : b'00000700C13368\r\n# APSRequestNodeInfo: Source MAC: 000D6F000258842E# APSRequestNodeInfo: Destination MAC: \r\n000D6F0002588DB0\r\n\x05\x05\x03\x030000000700E199CE\r\n\x83'
2020-04-05 21:13:42 DEBUG (Thread-4) [plugwise] Parse data: b'00000700C13368\r\n# APSRequestNodeInfo: Source MAC: 000D6F000258842E# APSRequestNodeInfo: Destination MAC: \r\n000D6F0002588DB0\r\n\x05\x05\x03\x030000000700E199CE\r\n\x83'
2020-04-05 21:13:42 DEBUG (Thread-4) [plugwise] Lookup message header (b'\x05\x05\x03\x03') in (b'00000700C13368\r\n# APSRequestNodeInfo: Source MAC: 000D6F000258842E# APSRequestNodeInfo: Destination MAC: \r\n000D6F0002588DB0\r\n\x05\x05\x03\x030000000700E199CE\r\n\x83')
2020-04-05 21:13:42 DEBUG (Thread-4) [plugwise] Valid message header found at index 125
2020-04-05 21:13:42 DEBUG (Thread-4) [plugwise] Lookup message footer (b'\r\n') in (b'\x05\x05\x03\x030000000700E199CE\r\n\x83')
2020-04-05 21:13:42 DEBUG (Thread-4) [plugwise] Valid message footer found at index 20
2020-04-05 21:13:42 DEBUG (Thread-4) [plugwise] Timeout acknowledge on message request with sequence id b'0007'
2020-04-05 21:13:42 DEBUG (Thread-4) [plugwise] NodeInfoResponse request with seq id b'0007' processed
2020-04-05 21:13:42 DEBUG (Thread-4) [plugwise] Network time out received for (3 of 3) of NodeInfoRequest to 000D6F0002588DB0, resend request
2020-04-05 21:13:42 DEBUG (Thread-4) [plugwise] Reset parser : b'00000700E199CE\r\n\x83'
2020-04-05 21:13:42 DEBUG (Thread-4) [plugwise] Parse data: b'00000700E199CE\r\n\x83'
2020-04-05 21:13:42 DEBUG (Thread-4) [plugwise] Lookup message header (b'\x05\x05\x03\x03') in (b'00000700E199CE\r\n\x83')
2020-04-05 21:13:42 DEBUG (Thread-4) [plugwise] No valid message header found yet
The debug log shows two concurrent instances to the same plugwise stick. I.e line 2 and 9 both logs an “open USB connection” entry. As result both instances are kind of “fighting” for the response messages. Could you please make sure to remove the integration completely and try adding it again?
Unfortunately old version is also not working anymore. I guess something got ‘stuck’ somewhere, but have no idea what to do about it yet other than restoring a snapshot or backup, which is what I’ll have a go at this weekend.
Interesting detail is after I updated HA to 0.108 today and HA restarted, integration worked again briefly. Had to reboot the system for some other task, after that it was broken again.
I think I fixed it! Began with a restore of an older snapshot earlier today, but that resulted in other issues where the thread kept dying. Ultimately rolled back to my current snapshot, but had the ‘multiple thread’ issue again. Decided to set global log level to debug and then found another mention of plugwise in the logs. It was an older HACS plugwise integration from cyberjunky. Removed this completely, reinstalled plugwise_stick into custom_components and restarted HA. This time it all worked again
I don’t understand how this could have been the reason for the issue, but happy everything now works with your latest code.
PS also checked the files you mentioned for duplicate entries in my file backup from yesterday, but only one mention of plugwise in .storage/core.config_entries and no devices in .storage/core.device_registry
I’ve made some progress and changed the integration a bit.
It now automatically adds a sensor for each meassured value. Some will be default active (enabled) and some will be disabled. If required you can enable/disable sensors.
Fixed closing port issue which caused an issue when you enable a sensor.
Fixed the warning messages mentioned by @koter84 when you disable sensors/switches
Add experimental support for Stealth devices as I am not able to test because I don’t own one
When I run the example.py (python3 ./example.py) I get the following:
roel@srv-hass-01:~/.homeassistant/custom_components/plugwise_stick$ python3 ./example.py
start connecting to stick
Exception in thread receive_timeout_deamon:
Traceback (most recent call last):
File “/usr/lib/python3.7/threading.py”, line 926, in _bootstrap_inner
self.run()
File “/usr/lib/python3.7/threading.py”, line 870, in run
self._target(*self._args, **self._kwargs)
File “/home/roel/.local/lib/python3.7/site-packages/plugwise/stick.py”, line 358, in _receive_timeout_daemon
self.expected_responses[seq_id][1].mac.decode(“ascii”),
AttributeError: ‘str’ object has no attribute ‘decode’
The home assistant log gives this output:
Apr 19 22:23:48 srv-hass-01 hass[779]: 2020-04-19 22:23:48 INFO (MainThread) [homeassistant.components.switch] Setting up switch.plugwise_stick
Apr 19 22:23:48 srv-hass-01 hass[779]: 2020-04-19 22:23:48 ERROR (MainThread) [homeassistant.components.switch] Error while setting up platform plugwise_stick
Apr 19 22:23:48 srv-hass-01 hass[779]: Traceback (most recent call last):
Apr 19 22:23:48 srv-hass-01 hass[779]: File “/home/roel/.local/lib/python3.7/site-packages/homeassistant/helpers/entity_platform.py”, line 148, in _async_setup_platform
Apr 19 22:23:48 srv-hass-01 hass[779]: task = async_create_setup_task()
Apr 19 22:23:48 srv-hass-01 hass[779]: File “/home/roel/.local/lib/python3.7/site-packages/homeassistant/helpers/entity_platform.py”, line 104, in async_create_setup_task
Apr 19 22:23:48 srv-hass-01 hass[779]: platform.setup_platform,
Apr 19 22:23:48 srv-hass-01 hass[779]: AttributeError: module ‘custom_components.plugwise_stick.switch’ has no attribute ‘setup_platform’
It is working now, the plugs are being discovered and show all the readings. Now I’m going to test this for a week to know it is stable before I put it in my “production” server
I had to restart the home assistant server after adding the integration. The plugs got discovered after the restart…
I still have some stability issues where plugwise sensor readings suddenly just stop. home-assistant.log then shows no activity anymore for the plugwise integration. When I only restart HA I see short activity in the log @ debug, then it stops again after 10-20 lines of debug logging without obvious reasons. Only after a full reboot of the server returns to normal.