OH2 Z-Wave refactoring and testing... and SECURITY

security
zwave
Tags: #<Tag:0x00007fd30e6f90f8> #<Tag:0x00007fd30e6f8fb8>

(Chris Jackson) #1

The latest version of the development binding dated 16th July 2018 is here.


Toward the end of last year I spent some time doing some initial refactoring of the ZWave binding in OH2. This focussed on rewriting the way transactions work as this is an enabler for other areas of the code. At the same time I also restructured the different layers of the binding to make things cleaner, and done some changes to support a system of autocoding the command classes directly from the Z-Wave standard which should ensure we have better compatibility with the formal Z-Wave standards.

For most people, the major benefit is this change brings security and mesh healing. If you want to test these features, then this development branch might be worth looking at and I’ll find a way to make this available.

Since this was quite a large change to the binding it needs some more testing before it’s merged into master - there’s bound to be bugs ;). That said, a few people have been testing it for a while now and it’s been working well (so far!).

I’ll post a link to a JAR for testing in the next day or so - it will need to be manually installed…

FTR -:

Cheers
Chris

A more detailed over of the major (visible) changes are -:

  • Security command classes are included. You can now install locks and other devices that utilise the security command class. Note that this doesn’t mean you should use security for everything – personally I would suggest to only use it for devices like locks and not for all sensors etc since the amount of traffic on the network will increase significantly. Security causes every command transmitted to actually send 2 or 3 commands over the air. Note that the database will likely need to be updated for secure devices to add the secure classes.
  • Network heal has been added back into the binding. This was removed as the old transaction code was not reliable when dealing with the commands that are used for heal that can take some time to complete. This was (is) a problem on OH1 as well but hopefully this is working much better now.
  • Command class names have changed to bring them inline with the ‘official’ names in the Z-Wave standard. It’s worth noting that this change does require all things to be updated since the configuration is slightly different.

I’ve also changed the way we’re handling retries and dead nodes. I’ve currently removed retries from the binding – this is because the controller already performs 3 retries, and it’s my feeling that have 3 retries at binding level was probably causing more problems than it solved as it blocks the binding from dealing with other commands for 15 seconds. I also don’t set a device as dead if it times out – only if the controller thinks the device is failed. If this causes problems then I’m happy to look at this further.

Currently I’m planning to merge these changes into a development branch to allow more widespread testing of these changes. Also, there are some other changes I’m working on that will likely be merged here first as well. These changes are to support dynamic channels so that we’re less reliant on defining channels within the database. This is something that is done on other bindings, but unfortunately it’s a feature that wasn’t available in ESH when the OH2 Z-Wave binding was written. This is something I’ve started to implement, but will be phased in to command classes over time starting with common classes. This should then allow devices to be used within the binding without the database being added – although clearly without the database there will be limited ability to configure devices since all configuration information is only available from the database.


ZWave Door Lock - OH2 - Help
Brainstorm ways to simplify Z-wave device setup process
Unable to lock/unlock zwave lock Kwikset 910
How does zwave routing work
Handling zwave notifications - Need Help
ZWave Door Lock - OH2 - Help
OH2, Z-Wave and Locks Reverse Status
OpenHab2, new lock from a new manufacturer
Openhab2 Configuration of Aeon Zstick Gen5 USB Controller (ZW090)
openHAB Z-wave Secondary
Having lots of problems -- is it really this hard?
HABmin and zwave
Setup Questions
OH2 door lock working?
Anybody interested in BARRIER_OPERATOR Zwave Command Class?
Danalock V3 - Z-Wave
Danalock V3 - Z-Wave
How to upgrade Zwave-Binding to latest Snapshot?
OpenHab2 and Linear NGD00Z-4 Garage Door Controller
Feedback from a new openHAB(ian) user
Device configuration, Z-Wave binding database issue
[SOLVED] Popp Strike Lock Control Issue
ZWave Manual Thing Configuration
Unable to edit parameters on one thing Qubino Weather Station
Shading automation
Moving to new system. Trying to retain zwave objects
Neo coolcam z-wave devices
Vision Door/Windows sensor zd2102 open/close and tamper are not triggered to different events
HABmin empty, only icons
ZW089 Recessed Door Sensor Gen5 issues
Aeotec Water Sensor 6 ZW122
Fibaro Roller Shutter FGRM-222 with Venetian Blinds - Lamellas Position
Which smart locks work with Openhab2?
Error including Z-Wave device in Openhab 2.2 after hard reset on the controller via Habmin
Zwave Fibaro 212 not posting updates after upgrade
Z-wave Association Groups support for Node Endpoints
Fibaro Roller Shutter FGRM-222 with Venetian Blinds - Lamellas Position
Z-Wave Binding: Fibaro FGR-222 Rollershutter UP command not fully raising Blind
Z-Wave Binding: Fibaro FGR-222 Rollershutter UP command not fully raising Blind
Problem with z-wave network after reboot of OH
Z-wave database: add permundo devices
Schlage FE469NX Won't Connect -- ARGH!
Neo coolcam z-wave devices
Zwave - Yale YRD220 Lock
Troubles adding ZWave Yale YRL220 Lever Lock
Aeotec Multisensor 6 - motion sensor not working
Unknown device - I'm lost!
Manual zwave binding
Frustrated beginner struggling with z-wave configuration
Vision Door/Windows sensor zd2102 open/close and tamper are not triggered to different events
Can't connect IRIS Garage Door Controller to openHABianpi
New Homeseer WD200+ Switches Coming
Z-wave Exception during HTTP PUT request
Eurotronic Spirit Z-Wave Plus doesn't work
Unable to lock/unlock zwave lock Kwikset 910
OH2: Rollershutter only 1..100%, not 0..100%?
Z-wave (Schlage) Lock Support on OH1
Motion sensor hsm100 fail to initialise
OH 2.2.0 Snapshots 1025-1028 / ZWave NPE
August lock pro 3rd generation
Z-Wave binding: Use devices already securely included in Z-Way
Do I have to unplug my Z-Stick Gen 5 to include new devices?
Danalock V3 - Z-Wave
Z-Wave Secure Inclusion
NullPointerException in ZWaveController latest build
Vision Door/Windows sensor zd2102 open/close and tamper are not triggered to different events
Z-Wave – Can it be reliable? Too many variables? Try something else?
Backward compatibility zwave binding 2.3.0 build #278 with openhab 2.2.0
Radio Thermostat Zwave configuration
Openhab2 and Schlage Be469 NX
Help with SCHLAGE BE469NX
Can someone share an OH2 multi-sensor .thing and .item examples?
Including Fibaro Multisensor manually
Yale Conexis L1 Smart Lock + Z-Wave Module 2 (SD-M1100) - Add to database
Status updates for Qubino Relays/Dimmers generally do not work
POPP Smoke Detector (4001)
Zwave binding problems with ZW6302 motion detector
Aeon DSC06106 Smart Energy Switch Power Meter no reports on consumption change
Devolo MT2792 Home Control Metering Plug - No Response
Automated blinds
Status updates for Qubino Relays/Dimmers generally do not work
ZWave mesh
Z-Wave Secure Inclusion
Yale 220 door lock help
Status updates for Qubino Relays/Dimmers generally do not work
Z-WAVE - Possible bug: Removing node from association group fails
Devolo MT2792 Home Control Metering Plug - No Response
Fibaro FGS 223 Problems
Fibaro FGS223 Double Switch 2 no Feedback of State (since Z-Wave Snapshot 2.3.0)
Merten (507801) Roller Shutter does not work with openHAB 2.2
Z-Wave Aeon Garage Door Controller ZW062 not opening or closing
Creating a new Z-wave network
New zwave device Fibaro Heat Controller (thermostat radiator)
Fibaro Roller Shutter FGRM-222 with Venetian Blinds - Lamellas Position
Problems (Z-Wave) with #1134 Snapshot
Schlage FE469NX Won't Connect -- ARGH!
Delete preinstalled/listed Addons (kar-file)
New zwave device Fibaro Heat Controller (thermostat radiator)
Zwave detects things that are manually configured
ZWave Binding Database Update
Alarm item not updated with Zwave Binding 2.2.0 for Kwikset lock / paperUI / openhabian / latestversion / TRACE logs
Security_networkkey
Zwave binding and "NodeID not set"
Fibaro Door/Window sensor 2 (FGDW-002) not sending door open
Vision/Zipato ZD2102 door sensor always reports ON
Z Wave Nodes
How to migrate from z-wave development to z-wave snapshot version?
Zipato Bulb 2 make it work with openhab2
ZWave Secure Inclusion (Non OH Based)
[ERROR] [ing.zwave.handler.ZWaveSerialHandler] - Got I/O exception Input/output error in writeArray during sending. exiting thread
Group Alarms Fibaro FGSD002
Zwave .things file syntax
Unable to control the Yale YRD210 deadbolt lock with OH2
Weiser 914 Door lock reporting as dead
Danalock V3 - Z-Wave
Popp 012501 + OH2
Strange Assignment of Fibaro Double Switch 2
Device Database
Strange Assignment of Fibaro Double Switch 2
Manufacturer reference missing for zw129
Zwave Fortrezz MIMO2+
New to home automation
OH2, Z-Wave, Yale Door Lock, Security Inclusion is Failing
Z-Wave Secure Inclusion
Using secure lock in openhab2
Zwave Qubino SmartMeter ZMNHTD
Including Danalock troubles - commands not accepted
Yale Keyless lock problem with 2.2.0-SNAPSHOT
Unable to control the Yale YRD210 deadbolt lock with OH2
About binding Zwave device adaptation issues
OpenHab2 and Linear NGD00Z-4 Garage Door Controller
Fibaro smoke sensor (FGSD-002) / Not getting all values from the device
Using secure lock in openhab2
ZWave modules with multiple endpoints
Secure include a garage door?
Initialization of AEON Labs ZW130 WallMote Quad fails
Z-Wave Intermatic Split Duplex Receptable is not recognized
WTRFID Mini Keypad RFID/Z-Wave
openHABian hassle-free openHAB Setup
Runtime-Problem? ZwaveThingHandler does not see zwave_nodeid="2" from things config-file
Locks control in openhab2 using zwave
"ERROR 500 - Internal Server Error" when opening Items-Section in Paper UI
"ERROR 500 - Internal Server Error" when opening Items-Section in Paper UI
Zwave detects things that are manually configured
Detched nodes in ZWave Network viewer
OpenHab2, new lock from a new manufacturer
Detched nodes in ZWave Network viewer
Zwave - Yale smart Living Keyless Connected Smart Lock
Schlage Connect Thing Detector Busted
2nd endpoint not exposed in Zwave blinding for Qubino Flush Shutter, release 2.1
Fibaro Roller Shutter FGRM-222 with Venetian Blinds - Lamellas Position
Zwave .things file syntax
Zwave ZD2201
BTZW125 Danalock v2 "APP_VERSION"
Linear GD00Z Garage Door Opener Will Not Operate
No event from door sensor
No event from door sensor
Popp 012501 + OH2
Openhab2 and Schlage Be469 NX
Anybody interested in BARRIER_OPERATOR Zwave Command Class?
Zwave Network not updating neighbours / missing heal
Mains plugged ZWave devices not routing?
Newbi Vera user converting to openHAB hardware?
Anybody interested in BARRIER_OPERATOR Zwave Command Class?
OH2 and Z-Wave Healing
OH2 and Z-Wave Healing
Aeotec ZW098 LED Bulb FWv1.5 Color Temperature
ZWave: Timeout while sending message. Requeueing
Unknown device with Linear NGD00Z-4
Could not resolve thingType - Fibaro Single Switch 2
Z-Wave network viewer shows no links
A mesh network is not being created
OpenHab2 and Linear NGD00Z-4 Garage Door Controller
OpenHab2 and Linear NGD00Z-4 Garage Door Controller
OpenHab2 and Linear NGD00Z-4 Garage Door Controller
Channel Configuration
Configuring Openhab2 without UI
How to confirm Z-Wave security: Is it secure?
Z-Wave Issues
How to setup Yale YRD210 Z-Wave properly
First Alert ZCOMBO Working Instance?
Kwikset 914 Inclusion
Z-Wave Network Viewer not showing connections
Z-Wave security testing ZW100 and MT02648
Z-wave unknown device connected, no XML file - device ID format error in db?
Z-Wave Secure Inclusion
Danalock Smart lock - No channels
Not succeeding to recognize Danalock smart lock in the zwave network
[SOLVED] Minimote Unknown Device
[SOLVED] Minimote Unknown Device
Zwave Issues with OH2 (Switch Updates)
Zwave Lock, no alarms
Fibaro Roller Shutter 2 Setup Problems - maybe communication?
Fibaro Switch 2: Unsupported multi instance command version (SOLVED)
Heiman HS1WL Water Leakage Sensor
Z-Wave - Multiple Sticks -> Naming problem
Status updates for Qubino Relays/Dimmers generally do not work
Aeon Labs Multisensor 6 in 1 configuration
Fibaro Switch 2: Unsupported multi instance command version (SOLVED)
Security inclusion of the yale lock failed at step SECURITY_NETWORK_KEY_SET
Can't get the zwave binding to update the S2 switch from a Fibaro FGD-212
Secure Inclusion Error in v2.3
Problems commanding color of EzMultiPli
ZWAVE Zooz 4-in-one motion/temperature/humidity/luminance sensor
How quickly are new devices supported?
OH2.3 Z-wave dev binding with fgr222: no lamella channel
OH2.3 Z-wave dev binding with fgr222: no lamella channel
Problem adding oomi light bulb
Aeotec Multisensor 6 - motion sensor not working
Zooz 4-in-1 Sensor Ver 2.0 ZSE40
Status updates for Qubino Relays/Dimmers generally do not work
Razpberry problems with routing to different z-wave products
[SOLVED] After upgrading to 2.3 Zwave doorlock stopped working
How to upgrade Zwave-Binding to latest Snapshot?
openHAB 2.3 has been released!
openHAB 2.3 has been released!
ZW096 Won't Complete Initialization
Z-Wave Secure Inclusion
(Nathan Stratton) #2

Very good news! Do you happen to know how to use text files to configure things?


Unknown device with Linear NGD00Z-4
(Chris Jackson) #3

Sorry - I’m not sure what you mean?


(Nathan Stratton) #4

I have seen many people say that you don’t need to use Paper UI to configure openHAB, that it is possible to configure everything in text files. I know how to configure .items with the zwave 2.0 binding:

Group     Tstat10                                                                                                     (Thermostats)
Group     Tstat10_Chart                                                                                               (Tstat10)
Number    Basement_Tstat_HeatSetPoint         "Basement Heat Setpoint [%.1f °F]"                      <temperature>   (Tstat10)                               {zwave="4:command=thermostat_setpoint,setpoint_type=1,setpoint_scale=1,refresh_interval=600"}
Number    Basement_Tstat_CoolSetPoint         "Basement Cool Setpoint [%.1f °F]"                      <temperature>   (Tstat10)                               {zwave="4:command=thermostat_setpoint,setpoint_type=2,setpoint_scale=1,refresh_interval=600"}
Number    Basement_Tstat_Temperature          "Basement Temperature [%.1f °F]"                        <temperature>   (Tstat10_Chart, Room_Temperature)       {zwave="4:1:command=sensor_multilevel,sensor_type=1,refresh_interval=600"}
Number    Basement_Tstat_Humidity             "Basement Humidity [%.1f %%]"                           <humidity>      (Tstat10_Chart, Humidity)               {zwave="4:2:command=sensor_multilevel,sensor_type=5,refresh_interval=600"}
Number    Basement_Tstat_OpMode               "Basement Mode"                                         <settings>      (Tstat10)                               {zwave="4:command=thermostat_mode,refresh_interval=600"}
Number    Basement_Tstat_ModeState            "Basement State [MAP(ct100.map):%s]"                    <settings>      (Tstat10)                               {zwave="4:command=thermostat_operating_state,refresh_interval=60"}
Number    Basement_Tstat_Battery              "Basement Thermostat Battery [%d %%]"                   <battery>       (Tstat10, Battery)                      {zwave="4:command=BATTERY,refresh_interval=1200"}
DateTime  Basement_Tstat_Clock

Turns into:

Group     Tstat10                                                                                                     (Thermostats)
Group     Tstat10_Chart                                                                                               (Tstat10)
Number    Basement_Tstat_HeatSetPoint         "Basement Heat Setpoint [%.1f °F]"                      <temperature>   (Tstat10)                               {channel="zwave:device:67cd13f9:node4:thermostat_setpoint_heating"}
Number    Basement_Tstat_CoolSetPoint         "Basement Cool Setpoint [%.1f °F]"                      <temperature>   (Tstat10)                               {channel="zwave:device:67cd13f9:node4:thermostat_setpoint_cooling"}
Number    Basement_Tstat_Temperature          "Basement Temperature [%.1f °F]"                        <temperature>   (Tstat10_Chart, Room_Temperature)       {channel="zwave:device:67cd13f9:node4:sensor_temperature"}
Number    Basement_Tstat_Humidity             "Basement Humidity [%.1f %%]"                           <humidity>      (Tstat10_Chart, Humidity)               {channel="zwave:device:67cd13f9:node4:sensor_relhumidity2"}
Number    Basement_Tstat_OpMode               "Basement Mode"                                         <settings>      (Tstat10)                               {channel="zwave:device:67cd13f9:node4:thermostat_mode"}
Number    Basement_Tstat_ModeState            "Basement State [MAP(ct100.map):%s]"                    <settings>      (Tstat10)                               {channel="zwave:device:67cd13f9:node4:thermostat_state"}
Number    Basement_Tstat_Battery              "Basement Thermostat Battery [%d %%]"                   <battery>       (Tstat10, Battery)                      {channel="zwave:device:67cd13f9:node4:battery-level"}
DateTime  Basement_Tstat_Clock                                                                                        (Tstat10, Clock)                        {channel="zwave:device:67cd13f9:node4:time_offset"}

What I don’t know how to do and can’t find any documentation on is the .things file. I also can’t find out how to set the sale from Celsius to Fahrenheit. I have two dozen thermostats and going through Paper UI and changing everything is a major bummer. I really would like to stick to text config files if possible.


(Chris Jackson) #5

It’s not possible to do this in the current release/snapshot versions. It will be in the development version but I’ve not tested it myself at the moment.


(Chris Jackson) #6

I’ve created a test version of the binding here.

You should uninstall the existing Z-Wave binding and manually install this file into the addons folder. It seems that OH comes with the serial bundle installed now so hopefully you shouldn’t need to manage that…

Points to note -:

  • Firstly - use at own risk :wink:
  • You MUST delete your existing things and add them back. Current definitions are not compatible due to a number of breaking changes. You don’t need to re-initialise the network or re-include devices - just delete the things and add back again.
  • If you have included secure devices you need to copy the network key over to the controller (don’t loose the key like I did tonight in all my messing around with deleting things to test the new version - tomorrows job will be to re-include my door lock!).

Any problems, please report here or raise an issue. Database definitions will need to be updated for locks to work as the additional classes will need to be added. My lock is here so you can see the door_lock channel. This will likely need to be added to other locks.

Happy testing ;).


Openhab2 and Schlage Be469 NX
Openhab2 Configuration of Aeon Zstick Gen5 USB Controller (ZW090)
Fibaro Roller Shutter FGRM-222 with Venetian Blinds - Lamellas Position
Linear GD00Z Garage Door Opener Will Not Operate
Not succeeding to recognize Danalock smart lock in the zwave network
(James Barnito) #7

link doesn’t seem to go anywhere


(Matthew Fogle) #8

Agreed, link is dead for me too. :frowning:


How to test zwave security in OH2?
(Stefan) #9

Link is working (or at least working for me).


(Glenn Gilley) #10

Hi, so I’m running a fresh OpenHAB2 2.1.0-SNAPSHOT Build 771 and still can’t figure out how to activate this test Z-Wave binding. I have not installed any Z-Wave Bindings specifically and this is as a said, a brand new install. I add the test z-wave jar to the \addons folder, I can run list from the console and I see the line “9 | Installed | 80 | 2.1.0.201701302330 | ZWave Binding” Now how in the world do I make this Addon Active so it works?!?

Thanks,
Glenn


(Angelos) #11

On a completely clean installation of OH2 Snapshot (#771), you will get the following error when you try to start the new Z-Wave binding:

openhab> bundle:start org.openhab.binding.zwave
Error executing command: Error executing command on bundles:
	Error starting bundle 208: Could not resolve module: org.openhab.binding.zwave [208]
  Unresolved requirement: Import-Package: gnu.io

To fix this: feature:install openhab-transport-serial and then Z-Wave will start


How to upgrade Zwave-Binding to latest Snapshot?
Try to Modify zwave binding and install new JAR in the addons directory (that fails gnu.io can not be resolved)
Openhabian: Add single snapshot jars to release version?
Jenkins build problems
No event from door sensor
Status updates for Qubino Relays/Dimmers generally do not work
Yale Keyless lock problem with 2.2.0-SNAPSHOT
Setup Questions
Updating Binding to snapshot - all other should remain stable version
Trouble with Fibaro metered smart plug
Fibaro Door Window contact FGK-10x Habmin Parameter
[Solved] 2/10/2017 ZWave Binding Broke ALL Switch Things
Door sensor does not send status to openhab2
Zwave Blind control from Duwi not recognized
(Chris Jackson) #12

Sorry - I missed the http off the front of the link - I’ve now updated this.

Maybe it needs to be started? In the past at least, when you dropped bundles into the addons folder they would automatically start so long as all dependencies resolved. So, there’s two options - either you just need to start the bundle (with the start command in Karaf) or you might need to manage the dependencies (ie add the serial library). When I tested this yesterday, the serial library seems to be installed by default, but this might not be correct…


(Glenn Gilley) #13

Thanks a ton! Thats exactly what my problem was with all of the versions I think I’ve been trying the last few days. Once I added that feature the Zwave package shows as Active! This is all brand new to me, but I’m highly enjoying the learning experience. Thanks again for all of the quick replies!

~Glenn


(Chris Jackson) #14

One point to note - the binding is very ‘chatty’ - ie there’s a LOT of debug information. I will reduce this shortly if the initial testing shows no major issues - for now I’d recommend people are running with debug logging enabled…


(Glenn Gilley) #15

I can confirm this works with my lock now!!! 914TRL Touchpad Electronic Deadbolt is what it shows up as, but it’s really a Kwikset SmartCode 910. Awesomeness, thanks so much!


(Chris Jackson) #16

Cool - thanks for the feedback.


(Chris Jackson) #17

One point to note - I would strongly suggest to use HABmin and not PaperUI when doing a secure inclusion. HABmin will be able to provide information about the success (or not!) of a secure inclusion. It will pop up a box in the top right corner saying if secure inclusion was successful or not…

If you want to use PaperUI, then you probably need to check the logfile, or there should be an attribute that also shows if it was securely included -:

(note that the above isn’t a secure device but it shows the “Using Security” attribute)


(Paul Muldoon) #18

I’ve done everything I can remotely here from my office, installing the new test binding, removing all devices and then re-adding them. I’m just can’t wake up my lock not being at home yet to test it.

But my lock seems to still show not using security. And this my lock that I previously secure included with OZCP and can control the lock from OZCP. I did also copy my network security key over to the Controller in Habmin.

We only include the security key as XX XX XX, correct? and not as 0xAB, 0xCD, etc? Just the 2 digit numbers separated by a space?

And why on earth would my Kwikset lock show as “Black and Decker” ???


(Chris Jackson) #19

I’d need to check - I think I wrote it to allow both options, but for sure it will work with the 2 digit numbers.

Presumably because that’s who makes it. The manufacturer names come from the ZWave standard.


(James Barnito) #20

can anyone walk me through moving the file to a headless linux install from the bash? I have a pine 64 headless openhab.