Ahh, I missed that.
Is that 3.0.12?
Razberry, Z-Uno, Timeparameter.set?
Re: Razberry, Z-Uno, Timeparameter.set?
Hello again.
Since last time I've tried to make an external RTC work on my Z-Uno 2,
(Re: Is there a Library available for using a Real Time Clock shield).
That did not work so now i'm back and I have tried your suggested use of and changed
to
The program takes advantage of:
But if I don't update the time via TimeParameterClass (Toggle button at the controller) it don't update the time at all.
Though Z-Uno:s internal RTC is about one second slow every minute, gives about 5 minutes every 12 hours,
it would be great if you could correct my misstakes in this small program.
My guess is that I don't understand how to manage (WITH_CC_TIME).
So my questions is:
What have I done wrong?
and
How can I make it work?
Since last time I've tried to make an external RTC work on my Z-Uno 2,
(Re: Is there a Library available for using a Real Time Clock shield).
That did not work so now i'm back and I have tried your suggested use of
Code: Select all
ZUNO_ENABLE(WITH_CC_TIME);
Code: Select all
#define TIME_PERIOD_REPEAT
Code: Select all
((uint64_t)10 * 60 * 1000 * 1000)// 10 min
Code: Select all
zunoAttachSysHandler(ZUNO_HANDLER_NOTIFICATON_TIME_STAMP, 0, (void*) &myUpdateTimeHandler);
But if I don't update the time via TimeParameterClass (Toggle button at the controller) it don't update the time at all.
Though Z-Uno:s internal RTC is about one second slow every minute, gives about 5 minutes every 12 hours,
it would be great if you could correct my misstakes in this small program.
Code: Select all
// ************************************** ShowTime_20250421110316.ino *************************************
// This sketch uses TimeParameter command class to setup RTC value from controller.
// You have to call TimeParameter.Set according to you z-wave controller manual.
#include <ZWCCTimerParametrs.h>
#include <ZWCCTime.h>
ZUNO_ENABLE(WITH_CC_TIME_PARAMETERS); // Add needed CC
ZUNO_ENABLE(WITH_CC_TIME);
ZUNO_CUSTOM_CC(ZUNO_CC_VERSION(COMMAND_CLASS_TIME_PARAMETERS, 1)); // Setup custom CC version - add it to NIF
// Just copied from above...
ZUNO_CUSTOM_CC(ZUNO_CC_VERSION(COMMAND_CLASS_TIME, 1)); // Is this really correct? What about the "1", what is it for.
#define MY_SERIAL Serial
// Calls every time controller sends TimeParameter.Set
void myUpdateTimeHandler(){
MY_SERIAL.println("*** Time updated:");
//MY_SERIAL.println((uint32_t)zunoGetTimeStamp());
//MY_SERIAL.println(" *** ");
}
time_t ts; // Timestamp
void setup(){
MY_SERIAL.begin(9600);
MY_SERIAL.println("************************************** ShowTime_20250421110316.ino *************************************");
// Bind custom handler to system timestamp notification
zunoAttachSysHandler(ZUNO_HANDLER_NOTIFICATON_TIME_STAMP, 0, (void*) &myUpdateTimeHandler);
}
void loop(){
//ts = (zunoGetTimeStamp() + 3600);
ts = (zunoGetTimeStamp());
// Print timestamp
MY_SERIAL.printf("*** Current 'TimeStamp:' %lu -> ",(uint32_t)ts); // uint32_t
tm timeinfo;
// Transform timestamp to timeinfo
gmtime_r(&ts, &timeinfo);
// Print date & time in readable format
MY_SERIAL.printf("%04d-%02d-%02d %02d:%02d:%02d\n\n", timeinfo.tm_year+1900, timeinfo.tm_mon+1, timeinfo.tm_mday, timeinfo.tm_hour/*timeinfo.tm_hour +1*/, timeinfo.tm_min, timeinfo.tm_sec);
// Wait a little...
delay(10000);
}
So my questions is:
What have I done wrong?
and
How can I make it work?
-
- Posts: 12
- Joined: 30 Apr 2020 16:09
Re: Razberry, Z-Uno, Timeparameter.set?
Hey, I think the TimeParameter.Set is referring to setting the time on the Z-Wave controller itself. It looks like you might need to use a specific command in the Z-Wave SDK to set it up. Since you're using the Razzberry controller, you should be able to do this via the Z-Wave network API.
Re: Razberry, Z-Uno, Timeparameter.set?
Thanks for answer.
TimeParameter.Set is used in the controller for sending the controllers
time to Z-Uno (zway.devices[device_nr].instances[0].commandClasses[139].Set()) and it works perfekt, except for I have
to do it manually from the controller.
WITH_CC_TIME should (as I understand) send controller time automatically depending on period set in ZWCCTime.cpp.
I set the period to 10 minutes but even if time i sent I don't kow how to recieve it in a proper way.
TimeParameter.Set is used in the controller for sending the controllers
time to Z-Uno (zway.devices[device_nr].instances[0].commandClasses[139].Set()) and it works perfekt, except for I have
to do it manually from the controller.
WITH_CC_TIME should (as I understand) send controller time automatically depending on period set in ZWCCTime.cpp.
I set the period to 10 minutes but even if time i sent I don't kow how to recieve it in a proper way.
Re: Razberry, Z-Uno, Timeparameter.set?
Hi.
At the moment ZUNO_ENABLE can only be in one instance.
Try this:
At the moment ZUNO_ENABLE can only be in one instance.
Try this:
Code: Select all
ZUNO_ENABLE(
WITH_CC_TIME_PARAMETERS
WITH_CC_TIME
);
Re: Razberry, Z-Uno, Timeparameter.set?
Thank you for answering.
I changed as you suggested, it updates the first timestamp after start
It gives the right time within a couple of seconds but it never updates time again, should be
every 10 min, so I don't understand how I can catch "right time" and make use of it in the program.
There has to be something that I have missed to do in the code??
I changed as you suggested, it updates the first timestamp after start
Code: Select all
�************************************** ShowTime_20250421110316.ino *************************************
*** Current 'TimeStamp:' 1746445769 -> 2025-05-05 11:49:29
*** Current 'TimeStamp:' 1746453888 -> 2025-05-05 14:04:48
*** Current 'TimeStamp:' 1746453898 -> 2025-05-05 14:04:58
every 10 min, so I don't understand how I can catch "right time" and make use of it in the program.
There has to be something that I have missed to do in the code??