Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Unhandled Command Class 0x2b when FGD212 sends SceneActivation after restart #1667

Closed
stromnet opened this issue Dec 9, 2018 · 13 comments
Closed
Assignees
Labels
Investigate Issues that need more investigation by Devs
Milestone

Comments

@stromnet
Copy link
Contributor

stromnet commented Dec 9, 2018

Issue Guidelines

While experimenting with Dev and the new CC support, I've hit some other issues.. I've got two Fibaro dimmers which on S2 sends a scene activation command.

With Dev cleanly built on FreeBSD 11.2, with an Aeon S2 stick, I just get the following when pressing S2:

2018-12-09 17:19:51.755 Detail, Node003,   Received: 0x01, 0x0a, 0x00, 0x04, 0x00, 0x03, 0x04, 0x2b, 0x01, 0x1a, 0xff, 0x39
2018-12-09 17:19:51.755 Detail,
2018-12-09 17:19:51.755 Warning, Node003, CommandClass COMMAND_CLASS_SCENE_ACTIVATION HandleIncommingMsg returned false

From what I can interpret, the 0x04 means 4 bytes long and 0x01 means data[0] == 0x01 inside SceneActivation::HandleMsg.. so I cannot at all understand how HandleMsg can return false...

I've also had issues with my application (agocontrol) initially failing to detect all classes on the device, resulting in the following:

2018-12-09 14:23:08.683621 [0x0000000808c52d00]  [  DEBUG] OZW Node031,   Received: 0x01, 0x0a, 0x00, 0x04, 0x00, 0x1f, 0x04, 0x2b, 0x01, 0x10, 0xff, 0x2f
2018-12-09 14:23:08.683671 [0x0000000808c52d00]  [  DEBUG] OZW
2018-12-09 14:23:08.683690 [0x0000000808c52d00]  [   INFO] OZW Node031, ApplicationCommandHandler - Unhandled Command Class 0x2b

After a manual RefreshNodeInfo on the node, it managed to obtain the classes and instead now gives the HandleIncommingMsg error instead.

Both Node031 and Node003 are Fibaro FGD211.

I can provide more logs from above runs, and perhaps debugging aid, but until then I will move back to master to get a working system again.

@stromnet
Copy link
Contributor Author

stromnet commented Dec 9, 2018

Back on master:

2018-12-09 17:44:41.211557 [0x0000000808bf9e00]  [  DEBUG] OZW Node003,   Received: 0x01, 0x0a, 0x00, 0x04, 0x00, 0x03, 0x04, 0x2b, 0x01, 0x10, 0xff, 0x33
2018-12-09 17:44:41.211611 [0x0000000808bf9e00]  [  DEBUG] OZW
2018-12-09 17:44:41.211632 [0x0000000808bf9e00]  [   INFO] OZW Node003, Received Scene Activation set from node 3: scene id=16 via configuration. Sending event notification.
2018-12-09 17:44:41.211655 [0x0000000808bf9e00]  [  DEBUG] OZW Node003, Notification: SceneEvent

Also, it might be worth nothing that the CC support seemed to work as expected, thanks! :)

@Fishwaldo
Copy link
Member

Firstly:
HandleMsg != HandleIncommingMsg

Second - As this is a Controlling CC (meaning it is meant to control other devices, by sending SET Commands instead of receiving SET commands) and not a Controlled CommandClass - It needs to be updated in OZW, as we now distinguish between the two types of messages.

This is WIP in the Dev Branch. The Infrastructure is there, but the CommandClasses have not been updated.

@Fishwaldo Fishwaldo self-assigned this Dec 12, 2018
@Fishwaldo Fishwaldo added this to the Version 1.6 milestone Dec 12, 2018
@stromnet
Copy link
Contributor Author

Aha, apparently I was quite tired and blind when I ended up posting this.. Looking closer, very apparent that HandleIncomingMsg wasn't implemented and thus returns false..

Looking forward to test when more stable, thanks!

Fishwaldo added a commit that referenced this issue Apr 1, 2019
…ns. Notifications for Scene Activation to be depreciated in 1.8
@Fishwaldo
Copy link
Member

Fixed. This CC now exposes the Scene ID (and Duration) via ValueID's. The old Notification for it will be depreciated in 1.8.

@gizmocuz
Copy link
Contributor

@Fishwaldo , yes, finaly found it... took me some debugging to figure this one out.

Please find a PR that corrects the function name so 'HandleIncomingMsg' is now indeed handled ;)

#1818

This probably solves some scene issues...

@petergebruers
Copy link
Collaborator

@gizmocuz, good catch. I was working on this, you beat me to it! The typo is in the comments so I'll make a new PR. I've tested this on domoticz + FGD212

@petergebruers
Copy link
Collaborator

When I add an FGD212 Fibaro Dimmer 2, SceneActivation works until you restart OZW

2019-05-28 08:59:09.902 Detail, Node005,   Received: 0x01, 0x0c, 0x00, 0x04, 0x00, 0x05, 0x04, 0x2b, 0x01, 0x18, 0x00, 0xd5, 0x00, 0x11
2019-05-28 08:59:09.903 Detail, 
2019-05-28 08:59:09.903 Detail, Node005, GetCommandClass 0x2b
2019-05-28 08:59:09.903 Detail, Node005, GetCommandClass searching in m_commandClassMap length 19
2019-05-28 08:59:09.903 Detail, Node005, GetCommandClass: NOT found
2019-05-28 08:59:09.903 Detail, Node005, GetCommandClass 0x2b
2019-05-28 08:59:09.903 Detail, Node005, GetCommandClass searching in m_advertisedCommandClassMap length 1
2019-05-28 08:59:09.903 Detail, Node005, GetCommandClass: found
2019-05-28 08:59:09.903 Info, Node005, Received SceneActivation set from node 5: scene id=24 now. Sending event notification.
2019-05-28 08:59:09.903 Info, Node005, Received SceneActivation report: 24 (duration: 77992)

The CC is in m_advertisedCommandClassMap because after receiving UPDATE_STATE_NODE_INFO_RECEIVED that CC gets added to that map.

If you reboot, data is read from the cache and:

2019-05-28 09:20:49.623 Detail, Node005,   Received: 0x01, 0x0c, 0x00, 0x04, 0x00, 0x05, 0x04, 0x2b, 0x01, 0x18, 0x00, 0xdb, 0x00, 0x1f
2019-05-28 09:20:49.623 Detail, 
2019-05-28 09:20:49.623 Detail, Node005, GetCommandClass 0x2b
2019-05-28 09:20:49.623 Detail, Node005, GetCommandClass searching in m_commandClassMap length 19
2019-05-28 09:20:49.623 Detail, Node005, GetCommandClass: NOT found
2019-05-28 09:20:49.623 Detail, Node005, GetCommandClass 0x2b
2019-05-28 09:20:49.623 Detail, Node005, GetCommandClass searching in m_advertisedCommandClassMap length 0
2019-05-28 09:20:49.623 Detail, Node005, GetCommandClass: NOT found
2019-05-28 09:20:49.623 Info, Node005, ApplicationCommandHandler - Unhandled Command Class 0x2b

@petergebruers
Copy link
Collaborator

Related: domoticz/domoticz#3240

@petergebruers petergebruers added the Investigate Issues that need more investigation by Devs label May 28, 2019
@petergebruers petergebruers changed the title SceneActivation fails in Dev Unhandled Command Class 0x2b when FGD212 sends SceneActivation after restart May 28, 2019
@petergebruers
Copy link
Collaborator

Related:

#543

That's in fact a request to enable OZW to send the CC

#391

That topic is old, and it is suggesting the reception of CC 0x2b should always be handled regardless of NIF, which sounds plausible to me.

"SDS13781 Z-Wave Application Command Class Specification.pdf", "3.4 Node Information Frame"

The field MAY advertise the list of Command Classes that the node can control in other nodes. If present, the list of controlling Command Classes MUST be prepended by the COMMAND_CLASS_MARK Command Class identifier. It is NOT RECOMMENDED to advertise controlled Command Classes.

I have no idea how many devices report Scene Activation like the FGD212 does.

BTW the FGD212 is the last device by Fibaro to support Scene Activation, devices after that support Central Scene. The device was designed in 2015 and is still available.

@gizmocuz
Copy link
Contributor

gizmocuz commented May 28, 2019

@petergebruers , yes, it would be best if 0x2b is always handled! I made a internal patch for this a year ago
There are more devices using the Scene Activation class and it would be great if old hardware is still usable ;)

@petergebruers
Copy link
Collaborator

Thank for reporting back. I am rather new to the development of OZW, but not new to Z-Wave. The second device I can use to test is the Aeotec Minimote. By "internal" do you mean for personal use, or used in "Domoticz"? I am asking because I don't want to break things, and I am interested in possible side effects. Also I'll have to discuss this with @Fishwaldo.

@petergebruers
Copy link
Collaborator

Always accepting CC 0x2b works for me, both on FGD212 and Minimote, but, note to self: check writing of m_advertisedCommandClassMap aka "AfterMark" to ozwcache, and retrieving it at startup.

Fishwaldo added a commit that referenced this issue May 29, 2019
@Fishwaldo
Copy link
Member

Should be Fixed. We were mixing up the Controller "Advertised" CommandClass with the Nodes Controlling CommandClass (aka AfterMark)

I still need to rework the Controllers CommandClass support, but thats for another day.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Investigate Issues that need more investigation by Devs
Projects
None yet
Development

No branches or pull requests

4 participants