Announcement

Collapse
No announcement yet.

Poll atomic clock for HS Touch tablet time?

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

  • Poll atomic clock for HS Touch tablet time?

    Has anyone found a way to do this? It would be nice if we could specify an atomic clock in HS3, and then create a device off of that which could be polled every minute or so to keep the HSTouch clients in sync.

    Thanks!
    Adam

  • #2
    Here I still utilize Tardis for Windows. Different a bit on Linux. Typically there is a reference to NTP somewhere and you can change this and the time sync.

    Times are sync'd here to an NTP server built in to the firewall. It is just a very long serial cable from the attic to the basement. It includes a PPS wire. Easy to do and very accurate.



    I can see some 10-14 GPS satellites in the attic with an antenna double the size of my thumb.
    - Pete

    Auto mator
    Homeseer 3 Pro - 3.0.0.534 (Linux) - Ubuntu 18.04/W7e 64 bit Intel Haswell CPU - Mono 6.00
    Homeseer Zee2 (Lite) - 3.0.0.534 (Linux) - Ubuntu 18.04/W7e - CherryTrail x5-Z8350 BeeLink 4Gb BT3 Pro - Mono 6.00

    X10, UPB, Zigbee, ZWave and Wifi MQTT automation.

    Comment


    • #3
      Push Time To Devices

      If you're using windows, the OS syncs time to MS servers which are probably, somewhere down the line, based on atomic clocks. I use the tablet as a nightstand alarm clock and had trouble at first keeping the time updated on the tablet. I created a virtual device to push the time to the tablet and a recurring script trigger to run a script once a minute to change the device string to the current time. Then, I used a label in HSTouch with status tracking pointed to the time device string. It has worked well and it's easy to tell if the server goes into one of it's OutOfMemory exceptions, as the time doesn't any longer change.

      - Make a virtual device called "Time"

      - Create a new event with a recurring trigger every 59 seconds

      - Set the event to run a script (arbitrarily named with .cs as the extension)

      - Click the airplane and paste the following into the script between the curly braces.

      Code:
      int devID = hs.GetDeviceRefByName("Time");
      string pushTime = DateTime.Now.ToString("HH:mm");
      hs.SetDeviceString(devID,pushTime,true);
      Setting it to run a script command and pasting this line will probably work too but I'm not sure is HS will allow this:

      Code:
      hs.SetDeviceString(hs.GetDeviceRefByName("Time"),DateTime.Now.ToString("HH:mm"),true);
      I hope it does what you're looking for. As far as the atomic time, I don't know how to help, but this will keep your tablets in sync.

      Comment


      • #4
        Originally posted by JosephQHughes View Post
        If you're using windows, the OS syncs time to MS servers which are probably, somewhere down the line, based on atomic clocks. I use the tablet as a nightstand alarm clock and had trouble at first keeping the time updated on the tablet. I created a virtual device to push the time to the tablet and a recurring script trigger to run a script once a minute to change the device string to the current time. Then, I used a label in HSTouch with status tracking pointed to the time device string. It has worked well and it's easy to tell if the server goes into one of it's OutOfMemory exceptions, as the time doesn't any longer change.



        - Make a virtual device called "Time"



        - Create a new event with a recurring trigger every 59 seconds



        - Set the event to run a script (arbitrarily named with .cs as the extension)



        - Click the airplane and paste the following into the script between the curly braces.



        Code:
        int devID = hs.GetDeviceRefByName("Time");
        
        string pushTime = DateTime.Now.ToString("HH:mm");
        
        hs.SetDeviceString(devID,pushTime,true);


        Setting it to run a script command and pasting this line will probably work too but I'm not sure is HS will allow this:



        Code:
        hs.SetDeviceString(hs.GetDeviceRefByName("Time"),DateTime.Now.ToString("HH:mm"),true);


        I hope it does what you're looking for. As far as the atomic time, I don't know how to help, but this will keep your tablets in sync.




        I work at MS, and I wouldn't depend on time.windows.com. I typically use the pool.ntp.org or nist.gov servers.

        Sent from mTalk

        Comment

        Working...
        X