@chris. I just saw that the CLOCK command was merged to the 1.9 branch. I have a CT-100 thermostat and would like to update the time. How is this accomplished? What does the item look like and do I need a rule to do the updating? There is a comment in the 2.0 branch that the time is automatically updated when it drifts. This does not appear to be happening in 1.9 branch. I don’t mind doing the updating in a rule, but what I’ve been trying so far has yet to work.
Here is what I currently have for an item: DateTime Heat_FF_Clock "FF Clock" <clock> (ALL, Heating) {zwave="34:command=CLOCK"}
And this is what is in my rule: Heat_FF_Clock.postUpdate(new DateTimeType());
This hasn’t been fully tested yet since my test device on my dev network that implements the CLOCK command died so I’ve got a new one coming. However the OH1 implementation isn’t automated in the same way as OH2. What I implemented was to send a switch command and the binding will set the current time.
I will try and test this over the next day or so if I get the new device.
@chris, I just tried testing with the switch command like you said, but I had no luck so I tried debugging it. I was fumbling around a bit since I don’t really know the code. The first issue I had was that the command class ZWaveClockCommandClass.class was not defined in ZWaveCommandClass so I made the change on my local repo. The next problem I had was that clock command was not listed as a supported command for my device so I added the following to the node xml file (again, not really knowing what I’m doing here):
Since it is sending a BASIC command, I’m guessing I did something wrong or there is something wrong with the code. Anyways, I know that you said your dev device died so I’m just trying to give you some testing feedback. I understand you have plenty of other things you are working on now.
Thanks - I’ll take a look. It looks like you’ve added the basic command class to the XML, so that can only result in bad stuff happening.
Why did you have to add the lines to the XML though? Was the command class not discovered during discovery? If not, maybe it’s not actually supported by your device?
Oh man, should have seen that basicCommandClass xml tag. I didn’t want to have to re-include the device so I was just editing the XML directly. I ended up re-including and the CLOCK command was correctly added. I found that the ZWaveClockConverter was not added to the ZWaveConverterHandler. Once I added this, things started working! I still got a warning “No converter found for item” at the end (possibly from poll), but everything is good!
2016-06-21 08:26:00.001 [DEBUG] [z.i.p.c.ZWaveClockCommandClass:95 ]- NODE 65: Creating new message for command CLOCK_SET 2016-06-21 08:26:00.001 [DEBUG] [o.b.z.i.protocol.SerialMessage:113 ]- NODE 65: Creating empty message of class = SendData (0x13), type = Request (0x00) 2016-06-21 08:26:00.002 [DEBUG] [z.i.p.c.ZWaveClockCommandClass:76 ]- NODE 65: Creating new message for command CLOCK_GET 2016-06-21 08:26:00.002 [DEBUG] [o.b.z.i.protocol.SerialMessage:113 ]- NODE 65: Creating empty message of class = SendData (0x13), type = Request (0x00) 2016-06-21 08:26:03.224 [DEBUG] [WaveController$ZWaveSendThread:1301]- NODE 65: Sending REQUEST Message = 01 0B 00 13 41 04 81 04 48 1A 25 C9 99 2016-06-21 08:26:03.232 [DEBUG] [b.z.i.p.s.SendDataMessageClass:38 ]- NODE 65: Sent Data successfully placed on stack. 2016-06-21 08:26:04.481 [DEBUG] [b.z.i.p.s.SendDataMessageClass:73 ]- NODE 65: SendData Request. CallBack ID = 201, Status = Transmission complete and ACK received(0) 2016-06-21 08:26:04.481 [DEBUG] [WaveController$ZWaveSendThread:1364]- NODE 65: Response processed after 1257ms/2726ms. 2016-06-21 08:26:04.481 [DEBUG] [WaveController$ZWaveSendThread:1301]- NODE 65: Sending REQUEST Message = 01 09 00 13 41 02 81 05 25 CA CD 2016-06-21 08:26:04.489 [DEBUG] [b.z.i.p.s.SendDataMessageClass:38 ]- NODE 65: Sent Data successfully placed on stack. 2016-06-21 08:26:04.505 [DEBUG] [b.z.i.p.s.SendDataMessageClass:73 ]- NODE 65: SendData Request. CallBack ID = 202, Status = Transmission complete and ACK received(0) 2016-06-21 08:26:04.814 [DEBUG] [ApplicationCommandMessageClass:40 ]- NODE 65: Application Command Request (ALIVE:DONE) 2016-06-21 08:26:04.814 [DEBUG] [ApplicationCommandMessageClass:58 ]- NODE 65: Incoming command class CLOCK 2016-06-21 08:26:04.814 [DEBUG] [z.i.p.c.ZWaveClockCommandClass:122 ]- NODE 65: Received CLOCK command V1 2016-06-21 08:26:04.814 [DEBUG] [z.i.p.c.ZWaveClockCommandClass:131 ]- NODE 65: Received clock report: Tuesday 08:26 2016-06-21 08:26:04.814 [DEBUG] [.z.internal.ZWaveActiveBinding:466 ]- NODE 65: Got a value event from Z-Wave network, endpoint = 0, command class = CLOCK, value = Tue Jun 21 08:26:04 EDT 2016 2016-06-21 08:26:04.814 [WARN ] [.o.b.z.i.c.ZWaveClockConverter:74 ]- NODE 65: No converter found for item = Heat_FF_Clock, endpoint = 0, ignoring event. 2016-06-21 08:26:04.814 [DEBUG] [WaveController$ZWaveSendThread:1364]- NODE 65: Response processed after 333ms/2726ms.
This is awesome! Thanks so much for putting this in!
You don’t need to reinclude the device - just delete the XML and restart the binding. It will cause the binding to do the discovery phase again, but it’s not the same as inclusion.
There were two small changes. Including diff in case you missed the change from my first comment:
`— a/bundles/binding/org.openhab.binding.zwave/src/main/java/org/openhab/binding/zwave/internal/converter/ZWaveConverterHandler.java
+++ b/bundles/binding/org.openhab.binding.zwave/src/main/java/org/openhab/binding/zwave/internal/converter/ZWaveConverterHandler.java
@@ -73,6 +73,7 @@ public class ZWaveConverterHandler {
converters.put(CommandClass.THERMOSTAT_FAN_STATE,
new ZWaveThermostatFanStateConverter(controller, eventPublisher));
converters.put(CommandClass.BATTERY, new ZWaveBatteryConverter(controller, eventPublisher));
converters.put(CommandClass.CLOCK, new ZWaveClockConverter(controller, eventPublisher));
converters.put(CommandClass.SWITCH_BINARY, new ZWaveBinarySwitchConverter(controller, eventPublisher));
converters.put(CommandClass.SWITCH_ALL, new ZWaveSwitchAllConverter(controller, eventPublisher));
converters.put(CommandClass.SWITCH_MULTILEVEL, new ZWaveMultiLevelSwitchConverter(controller, eventPublisher));
diff --git a/bundles/binding/org.openhab.binding.zwave/src/main/java/org/openhab/binding/zwave/internal/protocol/commandclass/ZWaveCommandClass.java b/bundles/binding/org.openhab.binding.zwave/src/main/java/org/openhab/binding/zwave/internal/protocol/commandclass/ZWaveCommandClass.java
index b8876d7…31abb5f 100644
— a/bundles/binding/org.openhab.binding.zwave/src/main/java/org/openhab/binding/zwave/internal/protocol/commandclass/ZWaveCommandClass.java
+++ b/bundles/binding/org.openhab.binding.zwave/src/main/java/org/openhab/binding/zwave/internal/protocol/commandclass/ZWaveCommandClass.java
@@ -443,7 +443,7 @@ public abstract class ZWaveCommandClass {
REMOTE_ASSOCIATION_ACTIVATE(0x7C, “REMOTE_ASSOCIATION_ACTIVATE”, null),
REMOTE_ASSOCIATION(0x7D, “REMOTE_ASSOCIATION”, null),
BATTERY(0x80, “BATTERY”, ZWaveBatteryCommandClass.class),
Chris any way to merge this with the latest Z-Wave security code? I would love to try it, but I have 6 working Yale locks in my network along with all my CT100s that need CLOCK.
I’ll try and do this if I can grab Daves security branch. Unfortunately I’m again stuck with French air traffic control strikes so I’ve limited access or time at the moment. Hopefully I’ll be back tomorrow if everything sorts itself out and I’ll see if I can merge them then.
It doesn’t really matter since this item simply triggers the setting of time on the device. However, if you make the item a switch you can manually force the time to get set when you toggle the switch. Or you could just have a rule that send the on command once a day to keep the clock from drifting.
thanks James and the prior posters, finally got it working.
for the record my thermostat is a Remotec ZTS-110.
I had to update to the 1.9 snapshot and delete the etc/zwave/nodexx.xml file.
I had also put my sendCommand in a “system started” rule. It seems that happens before Z-wave is initialized.
Since I made it a button, turning it on succeeded in setting the thermostat time.
Now I’m going to put the command in a CRON job.