Hacking support for Z-Wave Central Scene Command Class

Posted on
Mon Aug 31, 2015 4:54 am
hishamk offline
Posts: 14
Joined: Aug 15, 2015

Hacking support for Z-Wave Central Scene Command Class

So I've been playing recently with a pretty nifty 8-button Z-Wave controller that complies to the central scene command class. Indigo doesn't support it yet, but I'm keen to demonstrate it and try it out in my own house and show it off to some clients.

Indigo does add the device and does log the Z-Wave responses and requests. Indigo does request, interpret, and display the battery level status. As for button presses, button held down, button double clicks, etc, it just spits out the Z-Wave requestReply coming from the controller such as:

Single click:
RCVD requestReply1: 01 0B 00 04 00 03 05 5B 03 76 00 01 D9 (hex)

Byte 6 is the device number, 0x03 in this case.
Byte 12 is the button number, 0x01 in this case.
Byte 10 is the level, 0x76 in this case (up from 0x75) (decimal 118)
Byte 11 is the type of press, with 0x0 being a single click.

Double click:
RCVD requestReply1: 01 0B 00 04 00 03 05 5B 03 79 03 01 D5 (hex)

Byte 11 is 0x03

Button held-down:
RCVD requestReply1: 01 0B 00 04 00 03 05 5B 03 7A 02 01 D7 (hex)
.
.
RCVD requestReply1: 01 0B 00 04 00 03 05 5B 03 81 02 01 2C (hex)
RCVD requestReply1: 01 0B 00 04 00 03 05 5B 03 82 02 01 2F (hex)
.
.
RCVD requestReply1: 01 0B 00 04 00 03 05 5B 03 83 01 01 2D (hex)

Byte 11 is 0x02 when held down
When released, byte 11 changes to 0x01, marking the end of the user's intention.


What I think would work:
Turn on Z-Wave debug logging
Use SQL Logger plug-in and ensure that event log entries are stored in the database
Use an external python script that monitors the sqlite db.
Whenever the script detects changes, it checks to see if any of the above are present. Obviously I will need to account for different device numbers and button numbers. Then it matches it to some pre-defined action group and executes it via the REST API.

This is basically a quick idea I've had and will most likely go ahead and try to implement it sometime this week after work. If anyone thinks it's off or there's a better way, do let me know please.

What would be awesome is if Indigo allowed us to define our own device files, etc for unknown/unsupported Z-Wave devices.

Posted on
Mon Aug 31, 2015 10:13 am
hishamk offline
Posts: 14
Joined: Aug 15, 2015

Re: Hacking support for Z-Wave Central Scene Command Class

Welp, I had some time during lunch and did something that works quite well.

Single click and double click for action group execution and basic hold-to-dim-up works.

It doesn't use the SQL Logger. The text log file works fine.. for now.

It's all here: https://github.com/hishamk/indigo-log-h ... roller.git

Any input, feedback, changes, etc appreciated!

Thanks

Posted on
Tue Sep 01, 2015 12:55 pm
matt (support) offline
Site Admin
User avatar
Posts: 21411
Joined: Jan 27, 2003
Location: Texas

Re: Hacking support for Z-Wave Central Scene Command Class

What is the manufacture and model for the controller?

And can you re-define/sync it in Indigo and copy/paste the Event Log results? We'd like to get a device definition added to Indigo for it.

And thanks for the debugging information/decoding. That will be helpful when add the device definition to Indigo.

Image

Posted on
Tue Sep 01, 2015 11:27 pm
hishamk offline
Posts: 14
Joined: Aug 15, 2015

Re: Hacking support for Z-Wave Central Scene Command Class

It's a Remotec ZRC-90 (called ZRC-80 in CES 2015: https://www.youtube.com/watch?v=kPxrVxFjbaQ).

Event log as follows:

Z-Wave Syncing - started for device "003 - Portable Remote Controller"
Z-Wave Debug SENT getNodeNeighbors: 01 06 00 80 03 01 01 7A
Z-Wave Debug RCVD getNodeNeighbors: 01 20 01 80 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 5E
Z-Wave Debug . . getNodeNeighbors: nodeId 003, neighbors: - none -
Z-Wave Syncing - retrieved module neighbors list: - none -
Z-Wave Debug SENT requestNodeInfo: 01 06 00 60 03 04 F3 6D
Z-Wave Debug RCVD requestNodeInfo: 01 16 00 49 84 03 10 01 01 01 5E 85 72 84 86 80 73 59 5A 5B EF 5B 84 06
Z-Wave Debug . . requestNodeInfo: node 003, combined class list: 20v1 80v1 84v1 85v1 86v1 72v1 73v1 59v1 5Av1 5Bv1 5Ev1
Z-Wave Debug SENT requestManufactureInfo: 01 09 00 13 03 02 72 04 05 F4 63
Z-Wave Debug RCVD requestManufactureInfo: 01 0E 00 04 00 03 08 72 05 52 54 00 01 85 10 1B
Z-Wave Debug . . requestManufactureInfo: node 003, manufacturerId 5254, productId 00018510
Z-Wave Debug . . requestManufactureInfo: Remotec, Portable Remote Controller
Z-Wave Syncing - retrieved manufacture and model names: Remotec - 5254, Portable Remote Controller - 00018510
Z-Wave Debug SENT requestVersInfoGen: 01 09 00 13 03 02 86 11 05 F5 83
Z-Wave Debug RCVD requestVersInfoGen: 01 11 00 04 00 03 0B 86 12 02 04 05 01 00 03 01 00 06 70
Z-Wave Debug . . requestVersInfoGen: node 003, protoVers 4.05, appVers 1.00
Z-Wave Syncing - retrieved protocol version 4.05, app version 1.00
Z-Wave Debug RCVD packet: 01 05 00 13 F5 00 1C (hex)
Z-Wave Debug RCVD requestVersInfoGen: 01 11 00 04 00 03 0B 86 12 02 04 05 01 00 03 01 00 06 70
Z-Wave Debug RCVD packet: 01 05 00 13 F5 01 1D (hex)
Z-Wave Debug RCVD requestVersInfoGen: 01 11 00 04 00 03 0B 86 12 02 04 05 01 00 03 01 00 06 70
Z-Wave Debug SENT requestVersInfoCmdClass: 01 0A 00 13 03 03 86 13 84 05 F6 04
Z-Wave Debug RCVD requestVersInfoCmdClass: 01 0A 00 04 00 03 04 86 14 84 02 E2
Z-Wave Debug . . requestVersInfoCmdClass: node 003, class command 84 using version 2
Z-Wave Debug . . requestVersInfoCmdClass: node 003, combined class list: 20v1 80v1 84v2 85v1 86v1 72v1 73v1 59v1 5Av1 5Bv1 5Ev1
Z-Wave Syncing - retrieved class hierarchy: Controller : Portable Controller : Portable Remote Controller (01 : 01 : 01, base 00)
Z-Wave Syncing - retrieved command classes: 20v1 80v1 84v2 85v1 86v1 72v1 73v1 59v1 5Av1 5Bv1 5Ev1
Z-Wave Debug SENT requestWakeInterval: 01 09 00 13 03 02 84 05 05 F7 97
Z-Wave Debug RCVD requestWakeInterval: 01 0C 00 04 00 03 06 84 06 00 00 00 01 71
Z-Wave Debug . . requestWakeInterval: node 003, interval 0 minutes, wakeTarget 001
Z-Wave Syncing - retrieved wake interval of 0 minutes
Z-Wave Debug SENT setWakeInterval: 01 0D 00 13 03 06 84 04 00 0E 10 01 05 F8 86
Z-Wave Syncing - device "003 - Portable Remote Controller" wake interval changed to 60 minutes
Z-Wave Debug SENT requestAssociationGroupCount: 01 09 00 13 03 02 85 05 05 F9 98
Z-Wave Debug RCVD requestAssociationGroupCount: 01 09 00 04 00 03 03 85 06 01 70
Z-Wave Debug . . requestAssociationGroupCount: node 003, group count: 1
Z-Wave Debug SENT requestAssociations: 01 0A 00 13 03 03 85 02 01 05 FA 9F
Z-Wave Debug RCVD requestAssociations: 01 0C 00 04 00 03 06 85 03 01 01 00 01 75
Z-Wave Debug . . requestAssociations: node 003, group: 1, num associations: 1, max associations: 1, replies left: 0
Z-Wave Debug . . requestAssociations: node 003, group: 1, associations: [1]
Z-Wave Syncing - retrieved group 1 associations: [1]
Z-Wave Syncing - group 1 association to interface already exists (skipping)
Z-Wave Debug SENT requestBatteryLevel: 01 09 00 13 03 02 80 02 05 FB 98
Z-Wave Debug RCVD requestBatteryLevel: 01 09 00 04 00 03 03 80 03 46 37
Z-Wave Debug . . requestBatteryLevel: node 003, level 70
Z-Wave Syncing - retrieved battery level of 70%
Z-Wave Syncing - complete
Z-Wave Debug SENT requestBatteryLevel: 01 09 00 13 03 02 80 02 05 FC 9F
Z-Wave Debug terminatingSyncUI
Z-Wave Debug RCVD requestBatteryLevel: 01 09 00 04 00 03 03 80 03 46 37
Z-Wave Debug . . requestBatteryLevel: node 003, level 70
Z-Wave received "003 - Portable Remote Controller" status update battery level 70%
Z-Wave Debug SENT goToSleep: 01 09 00 13 03 02 84 08 04 FD 91
Z-Wave Debug RCVD packet: 01 05 00 13 FD 00 14 (hex)
Z-Wave Debug RCVD requestBatteryLevel: 01 09 00 04 00 03 03 80 03 46 37
Z-Wave Debug . . requestBatteryLevel: node 003, level 70
Z-Wave received "003 - Portable Remote Controller" status update battery level 70%

Posted on
Tue Sep 01, 2015 11:47 pm
howartp offline
Posts: 4559
Joined: Jan 09, 2014
Location: West Yorkshire, UK

Re: Hacking support for Z-Wave Central Scene Command Class

a) That looks great, and we need to get it supported in Indigo asap.

b) Where did you get hold of it from because other than CES, Google hasn't heard of it under either model no?

c) This thread is the kind of debugging I had in mind for user analysis of new devices that could be formed into a sample profile for peer testing prior to public release - saving you guys time.


Sent from my iPhone using Tapatalk

Posted on
Wed Sep 02, 2015 5:22 am
PeteVis offline
Posts: 180
Joined: Jun 19, 2015

Re: Hacking support for Z-Wave Central Scene Command Class

Take a look at this thread :
http://forums.indigodomo.com/viewtopic.php?f=107&t=14323

I'm doing what you are looking for, without the SQL logger and inside a schedule in Indigo. No external script.
It's not an elegant solution though.

From what I gather, I am far from the only one hoping something more user friendly comes our way soon to enable working with unsupported devices.

Posted on
Wed Sep 02, 2015 5:37 am
hishamk offline
Posts: 14
Joined: Aug 15, 2015

Re: Hacking support for Z-Wave Central Scene Command Class

PeteVis wrote:
Take a look at this thread :
http://forums.indigodomo.com/viewtopic.php?f=107&t=14323

I'm doing what you are looking for, without the SQL logger and inside a schedule in Indigo. No external script.
It's not an elegant solution though.

From what I gather, I am far from the only one hoping something more user friendly comes our way soon to enable working with unsupported devices.


Thanks for this. I actually didn't end up using the SQL Logger (see above). I decided to directly poll the log file from an external script (I monitor the timestamp and read the last line or two if it changed). I'm new to Indigo and didn't dive much into what's available, so wasn't aware of indigo.server.getEventLogList. That being said, I think as a hack, and the fact that I need to poll at pretty much regular intervals (rather than 10 seconds for an alarm), having it done externally is a saner approach. Still a hack though :D (Later edit: Come to think of it, I think I can just do what you did and have my script run inside Indigo as long as I can poll the timestamp at millisecond intervals. Would be great since I won't need to use the REST API calls - so yours is the more elegant solution :) - I'll have to dive deeper into the Indigo SDK ).

Yes, I hope Indigo eventually has a sandbox or something to allow users to define and test new devices. That would be awesome. A start would be maybe a simple XML folder to include device definitions. AND if they made it compatible with the OpenZWave device definitions, then that would save a lot of time.

There are lots of new and interesting Z-Wave devices that were shown at CES 2015... some pretty nifty Z-Wave -> IR devices that would be awesome if Indigo supported them.

Posted on
Thu Sep 03, 2015 12:36 pm
PeteVis offline
Posts: 180
Joined: Jun 19, 2015

Re: Hacking support for Z-Wave Central Scene Command Class

If you are going to do it inside the Indigo environment, make sure that you specify your script as an external script. For the moment I am only using internal scripts, but these are limited to 10 seconds of execution time maximum.
If I am not mistaken, external Python scripts run in a seperate thread, and are not limited by any time factor, so you could run them indefinatly to check the Indigo log and take actions.

I agree that Indigo should be more flexible towards unsupported devices, and I'm pretty confident something is comming....

Posted on
Mon Mar 28, 2016 7:17 am
strat offline
Posts: 21
Joined: Feb 16, 2015

Re: Hacking support for Z-Wave Central Scene Command Class

matt (support) wrote:
What is the manufacture and model for the controller?

And can you re-define/sync it in Indigo and copy/paste the Event Log results? We'd like to get a device definition added to Indigo for it.

And thanks for the debugging information/decoding. That will be helpful when add the device definition to Indigo.



Hi Matt!

It looks like a nice scene controller. I really want to buy one of those. Will you implement a device definition for this device? :D

Posted on
Tue Mar 29, 2016 9:53 am
matt (support) offline
Site Admin
User avatar
Posts: 21411
Joined: Jan 27, 2003
Location: Texas

Re: Hacking support for Z-Wave Central Scene Command Class

Definitely on our feature request list, and based on the logging it looks like the device definition won't require much/any custom code tweaks which is a positive.

Image

Posted on
Wed Apr 06, 2016 2:33 am
strat offline
Posts: 21
Joined: Feb 16, 2015

Re: Hacking support for Z-Wave Central Scene Command Class

Thanks, Matt.
When do you think you will implement it? Any idea?

Posted on
Wed Apr 06, 2016 3:09 am
howartp offline
Posts: 4559
Joined: Jan 09, 2014
Location: West Yorkshire, UK

Re: Hacking support for Z-Wave Central Scene Command Class

Calling Durosity...


Sent from my iPhone using Tapatalk

Posted on
Wed Apr 06, 2016 8:27 am
matt (support) offline
Site Admin
User avatar
Posts: 21411
Joined: Jan 27, 2003
Location: Texas

Re: Hacking support for Z-Wave Central Scene Command Class

strat wrote:
When do you think you will implement it? Any idea?

As a company policy we don't give time estimates for releases or when features will be implemented. We are hard at work on the next version though. :-)

Image

Posted on
Wed Apr 06, 2016 6:20 pm
durosity offline
User avatar
Posts: 4320
Joined: May 10, 2012
Location: Newcastle Upon Tyne, Ye Ol' England.

Re: Hacking support for Z-Wave Central Scene Command Class

howartp wrote:
Calling Durosity...


I've decided I should become the official company secrecy police. My job will involve making everyone aware that indigo does not generally comment on future product releases, and further requests will result in a Glasgow kiss.

Of course for this to work Matt and Jay will have to give me early access to indigo 7 so I know when to smack down the law.

Computer says no.

Posted on
Wed Apr 06, 2016 6:27 pm
DaveL17 offline
User avatar
Posts: 6741
Joined: Aug 20, 2013
Location: Chicago, IL, USA

Re: Hacking support for Z-Wave Central Scene Command Class

durosity wrote:
...and further requests will result in a Glasgow kiss.

I had to look that one up.

It's not as nice as it sounds.

I came here to drink milk and kick ass....and I've just finished my milk.

[My Plugins] - [My Forums]

Who is online

Users browsing this forum: No registered users and 1 guest

cron