ZWave isEncrypted()

Posted on
Sun Jul 30, 2017 7:52 am
howartp offline
Posts: 4559
Joined: Jan 09, 2014
Location: West Yorkshire, UK

ZWave isEncrypted()

Hi Matt,

Is there a way to test indigo.devices(ID) for "I am successfully included with encryption"?

I don't have any encrypted devices so all I can see is zwEncryptionStatusStr = "Not supported"

I want, within the Lock Manager plugin, to detect devices which support encryption but which haven't been successfully included with encryption, so I can hopefully guide users who are struggling with say Schlage locks to try again.

Peter

Posted on
Sun Jul 30, 2017 12:43 pm
matt (support) offline
Site Admin
User avatar
Posts: 21417
Joined: Jan 27, 2003
Location: Texas

Re: ZWave isEncrypted()

Hi Peter,

Here are the possible states of zwEncryptionStatusStr:

"Enabled for Commands ..." if the module supports encryption and the key exchange has succeeded.

"Supported but not Enabled": module supports the security/encryption command class (0x98) but it wasn't included with encryption enabled (or the key exchange failed during the inclusion).

"Not Supported": module doesn't *currently* claim to support the security/encryption command class (0x98).

So I think if you just check for the string prefix "Enabled for Commands" you should be good (if it isn't that, encryption isn't being used). If I remember correctly the last two cases are somewhat ambiguous. Some (but not all) modules will stop reporting they support command class 0x98 if they aren't included with encryption, so it isn't possible at that point for Indigo to know if they support it or not.

Thanks for adding additional logic to help detect this case and point users in the right direction!

Image

Posted on
Sun Jul 30, 2017 1:03 pm
howartp offline
Posts: 4559
Joined: Jan 09, 2014
Location: West Yorkshire, UK

Re: ZWave isEncrypted()

Thanks Matt.

If I put my code in deviceStartComm() will this run when someone re-includes the device if encryption failed first time?

Peter

Posted on
Sun Jul 30, 2017 3:21 pm
matt (support) offline
Site Admin
User avatar
Posts: 21417
Joined: Jan 27, 2003
Location: Texas

Re: ZWave isEncrypted()

I'm afraid the deviceStartComm and deviceStomComm are only called on the plugin owner's class implementation (Z-Wave plugin in this case). If you are subscribing to all device change (via having called the indigo.devices.subscribeToChanges() method) then your deviceUpdated(self, origDev, newDev) will get called whenever there is any change on any device, but note that will get called a lot and you'll have to filter out the devices you are interested in (com.perceptiveautomation.indigoplugin.zwave type, then check to see if zwEncryptionStatusStr has changed I guess).

Image

Page 1 of 1

Who is online

Users browsing this forum: No registered users and 3 guests

cron