Announcement

Collapse
No announcement yet.

How do I get correct time format in emails?

Collapse
X
 
  • Filter
  • Time
  • Show
Clear All
new posts

    How do I get correct time format in emails?

    I have some events that send emails and I'm using the $time variable to embed the current time in the email. This comes out in 12-hour format despite my system being configured for 24-hour time and the HS3 web UI showing me 24-hour time.

    How do I get the time in my emails to not be 12-hour?

    #2
    A couple of options that I see are to create a virtual device that holds the time in the format that you want, and the other one is to send the email through a script as you can format the time in the script more easily.


    Sent from my iPhone using Tapatalk
    HS 4.2.8.0: 2134 Devices 1252 Events
    Z-Wave 3.0.10.0: 133 Nodes on one Z-Net

    Comment


      #3
      Thanks. Is there some easy way to set a device's status string to the current 24-hour time without learning HS scripting?

      Comment


        #4
        Originally posted by Eug View Post
        Thanks. Is there some easy way to set a device's status string to the current 24-hour time without learning HS scripting?
        You can create an event to run a single line script. The single line script to use would be:

        Code:
        &nhs.SetDeviceString(6372,DateTime.Now.ToString("HH:mm"),True)
        Run the event once a minute, referenced to the top of the hour and change 6372 to the reference id of your virtual device.

        Click image for larger version

Name:	Capture.PNG
Views:	1
Size:	35.3 KB
ID:	1187238

        Cheers
        Al
        HS 4.2.8.0: 2134 Devices 1252 Events
        Z-Wave 3.0.10.0: 133 Nodes on one Z-Net

        Comment


          #5
          Awesome. Thank you!

          Comment


            #6
            Originally posted by Eug View Post
            Awesome. Thank you!
            You're welcome. On further review, it will be better to use this function as it generates no log entries:

            Code:
            &hs.SetDeviceString 6372, FormatDateTime(Time,4),True
            &nhs uses a vb.net script and when it generates those, there's an entry in the log every time. Using &hs uses vbscript which does not generate the log entries. The syntax for the vbscript call is a bit different.

            Cheers
            Al
            HS 4.2.8.0: 2134 Devices 1252 Events
            Z-Wave 3.0.10.0: 133 Nodes on one Z-Net

            Comment


              #7
              Oh, even better. The logging was getting annoying, and my searches told me there was no way around it.

              Comment


                #8
                Originally posted by Eug View Post
                Oh, even better. The logging was getting annoying, and my searches told me there was no way around it.
                I put in a Bugzilla for it to see if HS can add a way to suppress those as well.

                Cheers
                Al
                HS 4.2.8.0: 2134 Devices 1252 Events
                Z-Wave 3.0.10.0: 133 Nodes on one Z-Net

                Comment

                Working...
                X