Announcement

Collapse
No announcement yet.

timer value scripting and strange Errors

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

  • timer value scripting and strange Errors

    Hi

    I am trying to readout a timer value to a device string by use of following script

    Code:
    sub main()
    
    dim ts as TimeSpan = hs.TimerValue("Weg")
    
    hs.WriteLog("timer test", "ts")
    
    
    end sub
    after executing this error appears in the log;

    Code:
    jan-27 18:54:37	 	Warning	VB.Net script exception(0), re-starting: Object reference not set to an instance of an object.
    jan-27 18:54:36	 	Event	Running script in background: C:/Program Files (x86)/Homeseer HS3/scripts/huistatus.vb
    After this is run once, all the immediate scripting commands used in my events fail with the following errors;

    Code:
    jan-27 18:59:56	 	Error	Exception handling event action ACTION SCRIPT for event Licht/Donker Licht: Illegal characters in path.

    after a restart of HS3 everything functions OK


    using the latest HS3 version

    reagrds Bart
    Regards Bart
    ------------------------------------------
    Win7 64Bit on Intel NUCI7 with SSD
    HSPRO 3.
    Devices; 1370 Events; 691

    Jon00 Scripts, JowHue, HSTouch, Plugwise, Z-wave, Ultranetatmo, Ultracam, PHlocation, BLUSBUIRT, MeiHarmony, Buienradar, MEiUnifi Pushover 3P, Random, Nest HSPhone and Blueiris

    Visonic Powermax Alarm System (HS3) Interface: http://www.domoticaforum.eu/viewtopic.php?f=68&t=11129

  • #2
    I found TimeSpans a little odd at first but once you get used to them then you will find them great to use.

    Look at this example;

    Code:
    Sub Main(ByVal Parm As Object)
    
        Dim ts As TimeSpan = hs.TimerValue("FollowMee-AtHome")
    
        hs.writelog("tSpan", "Total Hours: " & ts.TotalHours)
        hs.writelog("tSpan", "Total Minutes: " & ts.TotalMinutes)
        hs.writelog("tSpan", "Total Seconds: " & ts.TotalSeconds)
        hs.writelog("tSpan", "Days: " & ts.Days)
        hs.writelog("tSpan", "Hours: " & ts.Hours)
        hs.writelog("tSpan", "Minutes: " & ts.Minutes)
        hs.writelog("tSpan", "Seconds: " & ts.Seconds)
    End Sub
    And see what it puts in the log (change your timer name first though)...you will need to work out whether or not visually it is what you want. Look here for the methods and the explanations https://msdn.microsoft.com/en-us/lib...vs.110%29.aspx
    My Plugins:

    Pushover 3P | DoorBird 3P | Current Cost 3P | Velleman K8055 3P | LAMetric 3P | Garadget 3P | Hive 3P |
    Yeelight 3P | Nanoleaf 3P

    Comment


    • #3
      I can reset a timer from a script using hs.TimerReset(runtimer) however when I do this the timer starts running I want to reset the timer in a stopped state, How do I do this?

      I tried hs.TimerStop(runtimer) but it's not implemented.
      If it ain't broke, don't fix it!

      Comment


      • #4
        Originally posted by happnatious1 View Post
        I can reset a timer from a script using hs.TimerReset(runtimer) however when I do this the timer starts running I want to reset the timer in a stopped state, How do I do this?

        I tried hs.TimerStop(runtimer) but it's not implemented.
        It's a bug http://bugzilla.homeseer.com/bugzill...ug.cgi?id=2430 and there is nothing you can do with it really until it is fixed unfortunately.
        My Plugins:

        Pushover 3P | DoorBird 3P | Current Cost 3P | Velleman K8055 3P | LAMetric 3P | Garadget 3P | Hive 3P |
        Yeelight 3P | Nanoleaf 3P

        Comment


        • #5
          Bugs are no longer being worked on so is it possible to call an event from a script? That might be a work around.
          If it ain't broke, don't fix it!

          Comment


          • #6
            Originally posted by happnatious1 View Post
            Bugs are no longer being worked on so is it possible to call an event from a script? That might be a work around.
            Yes you could use hs.triggerevent to run an event that had an action to stop a timer. It is not really the point though the bug should be fixed (and more options added) because there may be a reason to use a script.
            My Plugins:

            Pushover 3P | DoorBird 3P | Current Cost 3P | Velleman K8055 3P | LAMetric 3P | Garadget 3P | Hive 3P |
            Yeelight 3P | Nanoleaf 3P

            Comment


            • #7
              I agree but at this point I think bugzilla is a waste of time.
              If it wasn't for people like yourself homeseer would be toast at this point.

              The funny part is I don't see an action to reset my timer, so I have to use a script command to reset it then use an event action to stop it, that's messed up.

              Thanks MrHappy
              If it ain't broke, don't fix it!

              Comment


              • #8
                Hold on

                Originally posted by happnatious1 View Post
                Bugs are no longer being worked on so is it possible to call an event from a script? That might be a work around.
                Where did I miss this announcement at????????

                Comment

                Working...
                X