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

Sorry - Iā€™m not sure what you mean?

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.

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.

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 ;).

4 Likes

link doesnā€™t seem to go anywhere

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

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

2 Likes

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

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

6 Likes

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ā€¦

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

1 Like

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ā€¦

1 Like

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!

1 Like

Cool - thanks for the feedback.

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)

1 Like

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ā€ ???

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.

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

I operate headless as well. I have Network Sharing enabled on my Unbuntu box to easily access and move files across as needed. And normally log into my Ubuntu OH2 headless from a Windows machine using Bitvise SSH tunnelier. I can do thing from both command line and copy things over.

http://docs.openhab.org/installation/linux.html#network-sharing

You should be able to do something like -:

cwd /usr/share/openhab2/addons
wget http://www.cd-jackson.com/downloads/openhab2/org.openhab.binding.zwave-2.1.0-SNAPSHOT.jar
2 Likes