New SSD in and system restored, thanks to Time Machine!
I took that log output, boiled it down to just what is needed, reordered chronologically, and regrouped all open tests and all closed tests together. Here’s what that looks like:
Log Output
Open via App Tests
22:49 Sending open command
22:49 Received command to open
22:50 Open command confirmed
22:59 C8 42 00 F023 0000 0000 (17096)
23:59 Sending open command
23:59 Received command to open
23:59 Open command confirmed
23:59 00 00 00 F023 00C0 3903
24:08 C8 42 00 F023 0000 0000 (17096)
24:20 Sending open command
24:20 Received command to open
24:52 Sending open command
24:52 Received command to open
24:53 Open command confirmed
25:00 90 41 00 F023 0000 0000 (16784)
25:02 C8 42 00 F023 0000 0000 (17096)
25:15 Sending open command
25:15 Received command to open
25:24 refreshing
25:51 Sending open command
25:52 Received command to open
25:52 Open command confirmed
25:52 00 00 00 F023 00C0 3903
26:00 F8 41 00 F023 00C0 3903 (16888)
26:02 C8 42 00 F023 0000 0000 (17096)
26:34 Sending open command
26:34 Received command to open
26:34 00 00 00 F023 00C0 3903
26:35 Open command confirmed
26:44 C8 42 00 F023 0000 0000 (17096)
Manual Open Tests
41:34 E0 40 00 F023 00C0 3903 (16608)
41:40 60 41 00 F023 00C0 3903 (16736)
41:42 C8 42 00 F023 0000 0000 (17096)
44:20 A0 40 00 F023 00C0 3903 (16544)
44:20 A0 40 00 F023 00C0 3903 (16544)
44:28 C8 42 00 F023 0000 0000 (17096)
45:43 E0 40 00 F023 00C0 3903 (16608)
45:50 0C 42 00 F023 00C0 3903 (16908)
45:51 C8 42 00 F023 0000 0000 (17096)
47:14 60 41 00 F023 00C0 3903 (16736)
47:20 E0 41 00 F023 00C0 3903 (16608) ***
47:21 C8 42 00 F023 0000 0000 (17096)
48:28 A0 40 00 F023 00C0 3903 (16544)
48:35 04 42 00 F023 00C0 3903 (16900)
48:36 C8 42 00 F023 0000 0000 (17096)
Close via App Tests
21:25 Sending close command
21:25 Received command to close
21:26 Close command confirmed
21:35 00 00 00 F023 0000 0000
23:32 Sending close command
23:32 Received command to close
23:32 C8 42 00 F023 00C0 3903 (17096)
23:33 Close command confirmed
23:40 94 42 00 F023 00C0 3903 (17044)
23:42 00 00 00 F023 0000 0000
24:27 Sending close command
24:27 Received command to close
24:27 C8 42 00 F023 00C0 3903 (17096)
24:28 Close command confirmed
24:35 92 42 00 F023 00C0 3903 (17042)
24:35 92 42 00 F023 00C0 3903 (17042)
24:37 00 00 00 F023 0000 0000
25:31 Sending close command
25:32 Received command to close
25:32 Close command confirmed
25:32 C8 42 00 F023 00C0 3903 (17096)
25:40 86 42 00 F023 00C0 3903 (17030)
25:41 00 00 00 F023 0000 0000
26:09 Sending close command
26:10 Close command confirmed
26:10 Received command to close
26:10 C8 42 00 F023 00C0 3903 (17096)
26:19 00 00 00 F023 0000 0000
Manual Close Tests
39:12 BC 42 00 F023 00C0 3903 (17084)
39:20 64 42 00 F023 00C0 3903 (16996)
39:21 00 00 00 F023 0000 0000
43:40 BC 42 00 F023 00C0 3903 (17084)
43:48 00 00 00 F023 0000 0000
44:54 BA 42 00 F023 00C0 3903 (17082)
45:00 AC 42 00 F023 00C0 3903 (17068)
45:02 00 00 00 F023 0000 0000
46:29 BC 42 00 F023 00C0 3903 (17084)
46:35 A0 42 00 F023 00C0 3903 (16544)
46:35 Open command confirmed
46:35 Open command confirmed
46:37 00 00 00 F023 0000 0000
46:43 Automatically set state to open after 8 seconds
47:52 BC 42 00 F023 00C0 3903 (17084)
48:00 00 00 00 F023 0000 0000
New observations:
- In the open/close via app test, it appears there was one instance of the automatic countdown timer not working.
- I have no idea why an “open command confirmed” (which occurs when an
on/off: 0
Zigbee message is received from the motor) happened after you started a manual close. There may be a way to add a trap in the code to prevent that. I’ll have to give some thought as to how to implement it. - A value of
0000000000F02300000000
is sent when the motor is finished closing the curtain. I think it’s safe to use that in the code to change the state fromclosing
toclosed
, but keeping the automatic countdown timer as a fallback method. - A value of
0000C84200F02300000000
is sent when the motor is finished opening, but since bytes 3 & 4 might relate to position and could be different for other users, I think a condition on the final 4 bytes being00000000
and the first 5 bytes being something besides0000000000
should work as a method to change the state fromopening
toopen
, again with the automatic countdown timer as a fallback method. - Now I’m seeing byte #4 values of
40
,41
, and42
during the manual open / close tests, and it seems possible that it could be linked to byte #3, but as big-endian value. So I converted all of those 16-bit integer values to look for any patterns (I put those values in parenthesis). In all tests except one manual open run, the 16-bit value goes down on close and goes up on open. That one exception (marked with***
) seems to blow the theory out of the water, and looking at both the native hex values and the corresponding 16-bit integers, I don’t see any patterns that would make those values of any practical use (for example, giving a percentage opened / closed update).
So, at this point it seems there’s a fairly reliable way for the device handler to “know” when the motor has finished opening/closing the curtain, which works both for app-based and manual actions. However, because of uncertainty surrounding those bytes #3 & #4, there’s no way for the device handler to “know” that someone has started opening / closing the curtain manually, so in that case you would just see the state change from open
to closed
when the manual closing is finished (or vice-versa).
So, I have updated the DTH code to handle the curtain finished opening / closed messages, which should work both when done manually or through the app. The only limitation is that if the curtain is opened / closed manually, there will be no log messages or events until it is finished. Hopefully that is good enough! If it is opened / closed via the app, the countdown is still there as a fallback to send an open
or closed
event, but I increased the time to 15 seconds (to allow time for users with longer rails). The countdown time length could be made adjustable by adding a preference setting.
I also added “traps” in the code to handle redundant open / close requests from the app. They will be ignored (with a log message to that effect) unless the current state is opposite of the request.
The updated code can still be copied from the same link as before, here.
Detailed Change List
• (Hopefully) fixed info log message output of specific bytes of interest in any read attribute messages from Cluster 000D
/ Attribute ID 0055
• Modified parseReportAttributeMessage()
to handle motor finished opening/closing messages
• Removed some unnecessary log output messages
• Added traps in open()
and close()
to ignore redundant open/close requests
• Changed automatic countdown to call motorfinished()
routine to 15 seconds
• Added trap in motorfinished()
to prevent redundant door open
or door closed
events
• Fixed log output in refresh()
to use displayInfoLog()
• Renamed motorFinished()
to motorFinishedCountdown()
• Added additional helpful comments in the code