Announcement

Collapse
No announcement yet.

$$TIME / $$Time

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

  • $$TIME / $$Time

    Dear Michael,


    I'm using the $$TIME to display the time on a LCD display through tasmota and MQTT.

    According to the manual:

    $$TIME should be current time in short format
    $$time should be in 12 hour format ( 2:00 PM )

    On both i get the following output HH:MM:SS in 24 hour format.

    Same for date:

    $$DATE should be current date in short format
    $$date should be current date in long format ( April 1, 2016 )

    On both i get current date in long format.

    Do i something wrong ?


    Gerwin

  • #2
    The date and time substitutions exist for actions and for templates. Those for actions follow the HS substitution variables definition of $$data and $$time (without colon suffix) and have long format. Those for payload and topic templates ($$DATE: and $$TIME have the short format. They are both actually case-insensitive. I suspect you are using the substitution in your payload template with colon suffix for your LCD. In this case the .NET code is now.ToShortDateString() and now.ToShortTimeString(). What is considered short is based upon regional settings. What format do you desire?

    Comment


    • #3
      Dear Michael,


      i’m using the Send MQTT option in events for my lcd display. Click image for larger version

Name:	8BA5424D-8468-4CF1-9ADA-EAD671B73CCD.jpeg
Views:	80
Size:	33.1 KB
ID:	1325470

      Comment


      • #4
        What are you getting vs. what are you expecting vs. what do you desire for the $$TIME replacement? Same question for $$DATE?

        Comment


        • #5
          i'm getting the following for time:

          $$TIME --> HH:MM:SS ( 24 hour format )
          $$time --> HH:MM:SS ( 24 hour format )

          What i would like to get is HH:MM ( 24 hour format )

          For date i get:

          $$DATE --> Day-Month-Year ( Tuesday 10 September 2019 )
          $$date --> Day-Month-Year ( Tuesday 10 September 2019 )

          What i would like to get is DD-MM-YY ( 10-09-19 )


          Gerwin


          Comment


          • #6
            I added $$TIME: and $$DATE: to the action substitution to match the template substitution variables. I did a test event with the following action and received the expected output for USA. You should get the 24 hour format for your location. This is at http://mcsSprinklers.com/mcsMQTT_4_1_6_0.zip You will want HSPI_MCSMQTT.exe from the zip to replace the same file in your HS folder.

            Event Action: Test/DateTime=Long is $$DATE $$TIME Short is $$DATE: $$TIME:

            MQTT Message when Triggered: Test/DateTime Long is Tuesday, September 10, 2019 4:52:13 PM Short is 9/10/2019 4:52 PM

            Comment


            • #7
              Dear Michael,

              Thank you for the quick change.

              I tested it.

              The $$DATE: and $$TIME give the expected result ( short date and time ) thank you so much.

              I also tested $$DATE and $$TIME, this should give a long result. But instead it does nothing.


              Gerwin

              Comment


              • #8
                In post #6 I showed the event action I used to test. Can you show the one where $$DATE and $$TIME did not work for you?

                Comment


                • #9
                  Click image for larger version

Name:	2019-09-12 16_47_49-HomeSeer Web Control - Ev....jpg
Views:	53
Size:	25.6 KB
ID:	1326021

                  This one is not working. Same if i replace $$DATE with $$TIME.

                  Comment


                  • #10
                    Issue was being at the end of line. Fixed in http://mcsSprinklers.com/mcsMQTT_4_1_6_1.zip.

                    Comment


                    • #11
                      Hi Michael,


                      I cannot download the file. 404 not found

                      Comment


                      • #12
                        Looks like an upload failure. I'm trying again.

                        Comment


                        • #13
                          Did you had any change to upload the file

                          Comment


                          • #14
                            Now I confirmed it is there. It takes about 15 minutes to upload on my internet connection so it sometimes aborts due to other traffic.

                            Comment


                            • #15
                              Hi Michael,

                              Just tried the new file.

                              Everything is fine and working. Thank you so much.


                              Gerwin

                              Comment

                              Working...
                              X