Jump to content
C4 Forums | Control4

Time Stamp... again???


goldencat

Recommended Posts

Here is a challenge I want to solve:

Record events during  the day or internet outage then by end of the day or when an internet comes back send an email with recorded events WITH timestamps. So I need to record the time of the event...
My research got me nowhere while in the middle of this road i found people reporting doing so with Variable manipulator and os.time() and os.date(). yet Chowmain Software tech support told me I can do it. Had anyone actually done it?????
 
Now I'm looking at  Generic TCP Command Driver. Is there some sort of  GET command to the controller to get the current Timestamp and then save it to the variable. 
I've been doing Smart home programming for 15ish years, just never got myself to go  beyond click and drag, Better late than never: now time to get typing or copy and paste.
 
Yet,  it could be as simple as having an inexpensive device on local network with the driver what would have a current time as a variable
--

Many thanks,

Link to comment
Share on other sites


5 hours ago, TFlury said:

There are lua commands for grabbing current time.

https://www.lua.org/pil/22.1.html

You could use that and save the info to an array/table 

This is a very same website I've got from Chowmain support. Can You or some one Please point me to the direction where to start. Links, Pictures, Project Samples . I'm Working on 3.2.4 version.

Thank You for taking your time.

Link to comment
Share on other sites

5 hours ago, RAV said:

From my Archives.... (not my driver)

This driver provides a timestamp text string as a variable to use in email and push notifications.

Through programming you select when to set the variable.
Then you can include the last set in an email, push etc.

DW_Timestamp.c4i 2.49 kB · 2 downloads

Ether I'm doing something wrong or it is 3.2.4 version or else??.

Variables:

  TempHoldTimestamp (string variable)

Macro: Test

  Save Timestamp

  Delay: 2sec

  Set Variable ->TempHoldTimestamp to the value of test room->Timestamp->Timestamp

As results I can see current Timestamp in Lua output of Timestamp driver. but "TempHoldTimestamp" variable doesn't get the value. it is get overwritten. before  I had run the test macro, I vent to variable agent in put random characters in TempHoldTimestamp variable, It got empty after running macro

Link to comment
Share on other sites

6 hours ago, Cinegration said:

I’m still confused as to what you are asking?  So if internet is off do what?

Before I figured out "Free  Ping Driver" not going to work for this challenge, The Idea was to save Three Variables with ping results and send email with those results with timestamp attached to each of them, once internet gets back. The code on the screenshot is not final, but should give an idea.

Screenshot 2022-03-30 143522.jpg

Link to comment
Share on other sites

3 hours ago, goldencat said:

Before I figured out "Free  Ping Driver" not going to work for this challenge, The Idea was to save Three Variables with ping results and send email with those results with timestamp attached to each of them, once internet gets back. The code on the screenshot is not final, but should give an idea.

Screenshot 2022-03-30 143522.jpg

Just a heads up, but you're better off using something that uses http command to check if the internet is online anyway

 

The free ping driver runs the ping command, and it's fairly public knowledge that drivers running commands likely will break in the future (for security reasons, and probably because I suspect they are blocking commands which stall everything else)

Link to comment
Share on other sites

40 minutes ago, Andrew luecke said:

Just a heads up, but you're better off using something that uses http command to check if the internet is online anyway

 

The free ping driver runs the ping command, and it's fairly public knowledge that drivers running commands likely will break in the future (for security reasons, and probably because I suspect they are blocking commands which stall everything else)

I agree with You. I'm looking at Generic TCP Command driver, I just can't buy them all. Yet at least. If You can suggest anything else I'm very open,  My feeling for Generic TCP Command if/then I figurate it out, it opens more doors. 

As for ping Driver, It does what it promises yet at least, it didn't work for me. If Host is nor reachable variable doesn't get updated. I already killed all the screenshotted code, and there is a critical error in it, so if reused use caution.

{}{}{}commands which stall everything else) these are new words for me 

Link to comment
Share on other sites

18 hours ago, goldencat said:

Ether I'm doing something wrong or it is 3.2.4 version or else??.

Variables:

  TempHoldTimestamp (string variable)

Macro: Test

  Save Timestamp

  Delay: 2sec

  Set Variable ->TempHoldTimestamp to the value of test room->Timestamp->Timestamp

As results I can see current Timestamp in Lua output of Timestamp driver. but "TempHoldTimestamp" variable doesn't get the value. it is get overwritten. before  I had run the test macro, I vent to variable agent in put random characters in TempHoldTimestamp variable, It got empty after running macro

Could be broke. It's old, and someone wrote it as a quicky.

Link to comment
Share on other sites

20 minutes ago, msgreenf said:

So what are you trying to do that ovrc can't?

Sent from my Pixel 6 Pro using Tapatalk
 

Get log before rebooting. Yet, this is a  different subject. I created this topic For timestamp problem, I can easily see many different scenarios  where I'm going to use it. 

Link to comment
Share on other sites

On 4/2/2022 at 10:07 AM, Andrew luecke said:

Just a heads up, but you're better off using something that uses http command to check if the internet is online anyway

 

The free ping driver runs the ping command, and it's fairly public knowledge that drivers running commands likely will break in the future (for security reasons, and probably because I suspect they are blocking commands which stall everything else)

Our ping driver also will stop working shortly.

This driver monitors internet connectivity.

https://chowmain.software/drivers/control4-internet-rebooter

Link to comment
Share on other sites

On 4/3/2022 at 5:04 PM, alanchow said:

If your goal is to record events then this driver will do what you want.

https://chowmain.software/drivers/control4-event-logging

combined with

https://chowmain.software/drivers/control4-notification-suite

and you can email it out whenever you want.

 

You once said:

"With the variable manipulator you can do this using os.time() and os.date()."

Can you please post some examples.

Link to comment
Share on other sites

6 hours ago, goldencat said:

You once said:

"With the variable manipulator you can do this using os.time() and os.date()."

Can you please post some examples.

This was a mistake.  You cannot do that.

The event logging driver should do what you want though.  Its designed to log events into a text file which you can access via web browser or SMB share.

The notificaiton suite can also attach any file on a webserver to an email and send it off.

It can be used together to send the event log.

Link to comment
Share on other sites

This thread is quite old. Please consider starting a new thread rather than reviving this one.

Join the conversation

You can post now and register later. If you have an account, sign in now to post with your account.

Guest
Reply to this topic...

×   Pasted as rich text.   Paste as plain text instead

  Only 75 emoji are allowed.

×   Your link has been automatically embedded.   Display as a link instead

×   Your previous content has been restored.   Clear editor

×   You cannot paste images directly. Upload or insert images from URL.

×
×
  • Create New...

Important Information

By using this site, you agree to our Terms of Use.