Page 1 of 1

No unsolicited report workaround?

Posted: 10 Jan 2015 22:17
by jensmoes
I have one of the GE/Jasco Wall switches model 12722/45609 which are purported to not send unsolicited status reports when activated locally (Press the switch in the real world kind of activation) as mentioned here: http://razberry.z-wave.me/index.php?id=29.
It does however send out a node info whenever I get off the couch and hit that button:

[2015-01-10 18:32:55.628] [D] [zway] RECEIVED: ( 01 10 00 49 84 05 0A 04 10 01 25 27 73 70 86 72 77 BA )
[2015-01-10 18:32:55.628] [D] [zway] SENT ACK
[2015-01-10 18:32:55.629] [zway] Node info received: 5
[2015-01-10 18:32:55.629] [D] [zway] SETDATA devices.5.data.basicType = 4 (0x00000004)
[2015-01-10 18:32:55.629] [D] [zway] SETDATA devices.5.data.genericType = 16 (0x00000010)
[2015-01-10 18:32:55.630] [D] [zway] SETDATA devices.5.data.specificType = 1 (0x00000001)
[2015-01-10 18:32:55.633] [D] [zway] SETDATA devices.5.data.deviceTypeString = "Binary Power Switch"
[2015-01-10 18:32:55.634] [D] [zway] SETDATA devices.5.data.nodeInfoFrame = byte[7]
[2015-01-10 18:32:55.634] [D] [zway] ( 25 27 73 70 86 72 77 )
[2015-01-10 18:32:55.634] [D] [zway] SETDATA devices.5.data.lastReceived = 0 (0x00000000)

The info is always the same regardless of which switch is pressed (Up/Down).
I have found out that manually issuing a Basic/get from the expert UI after this event actually update everything (not unexpected).

Is there anyway to trigger a basic get on the device based on the node info received above?

I have a smart things hub which has a workaround for these switches. I am not sure if this is what it utilizes, but it does work.

Re: No unsolicited report workaround?

Posted: 10 Jan 2015 22:34
by pofs
It seems to be quite a common issue: viewtopic.php?f=3422&t=20621&p=52205#p52208

If you're on 2.x, it will require some minor modifications, like startup order checks. It is all discussed in the relevant topics.

Re: No unsolicited report workaround?

Posted: 14 Jan 2015 07:41
by jensmoes
Sweet, that works thanks!
You are right on 2.x the startup order seems different. Had success putting it in the ZWay modules startBinding method.
Kind of hack addressing your device directly by array index though.

Is there a way to query the devices in the array to find the ones that are of the offending model numbers? I have not been able to find the class def for the physical devices anywhere.
It seems like the virtual devices can be queried with a get method but they do not provide access to the nodeInfoFrame of the physical device to do the actual binding.

Re: No unsolicited report workaround?

Posted: 19 Jan 2015 21:52
by PoltoS
Indeed, the HA layer is abstract from underlying Z-Wave layer. We will add soon a function to fetch underlying object

Re: No unsolicited report workaround?

Posted: 01 Feb 2015 04:45
by jensmoes
I figured out a way to this entirely from within the Z-Way HA UI but it does require an update to the CustomUserCode module. I attached the pacth here and also created a pull request in git for it.
Basically it allows you to run whatever custom code you need after a certain delay, which is required to ensure that the devices have been created.
After the timeout the code to "niffle" the offending devices is then executed.
In my case:

Code: Select all

zway.devices[5].data.nodeInfoFrame.bind(function(type) {
        if (type == 0x41 /* Updated | PhantomUpdate */)
              zway.devices[5].Basic.Get(); 
        });
zway.devices[6].data.nodeInfoFrame.bind(function(type) {
        if (type == 0x41 /* Updated | PhantomUpdate */)
             zway.devices[6].Basic.Get();
         });
I think that for most devices you can just use Basic.Get as I do but some may require an explicit command class in order to update such as SwitchBinary or whatnot.

Re: No unsolicited report workaround?

Posted: 02 Mar 2015 03:09
by jensmoes
PoltoS did not like my proposal and with good reason, it is basically a hack :)
I have created a standalone module that can niffle any switch which doesn't send unsolicited reports.
You can download it from Github: https://github.com/jensmoes/Niffler and add it to you modules.
Enjoy.

Re: No unsolicited report workaround?

Posted: 28 Apr 2015 03:43
by jensmoes
I updated the Niffler module at https://github.com/jensmoes/Niffler to also support doorlocks.
This will ensure the GUI/App is updated when someone locks or unlocks your door. Quite handy since that is probably one of the main reasons you bought a lock :)
It has been tested with Schlage BE-469 but should work with any door lock supporting the Alarm CC