Announcement

Collapse
No announcement yet.

Days Till Reminder Script Discussion

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

  • Gogs
    replied
    Originally posted by fungun View Post
    No One ?

    Thanks,
    Tim
    Looks that way

    Leave a comment:


  • fungun
    replied
    No One ?

    Thanks,
    Tim

    Leave a comment:


  • fungun
    replied
    I'm wondering that too now that I have switched to HS3.
    I love this script.

    Thanks,
    Tim

    Leave a comment:


  • Gogs
    replied
    Is there a version of this brilliant script that will work with HS3?

    Leave a comment:


  • Gogs
    replied
    Well spotted.

    Leave a comment:


  • Rotech
    replied
    Thanks neil, I should of just tried putting some kind of value there, aim just afraid of breaking something, any how thank you and Gogs...

    Leave a comment:


  • neiltimms
    replied
    Hector,

    you have for i=89 to 95

    and then if i>44 then exit sub!

    So yes of course it is doing nothing.

    Change the >44 to somthing like >92

    lower down change the i=43 to =91

    this will then read the first 4 reminders provided they are going to occur within 100 days

    Leave a comment:


  • Rotech
    replied
    Gogs, devices have data, and working fine. could it be this part of the script? where its says >44 and =43

    if i>44 then
    exit sub
    end if
    if (left(hs.devicestring ("y" & Cstr(i+1)),3))>100 then
    exit sub
    end if

    if i=43 then
    hs.speak "and, There are " & hs.devicestring("y" & Cstr(i))
    exit sub
    end if

    Leave a comment:


  • Gogs
    replied
    Originally posted by Rotech View Post
    Gogs

    Last nigth I ran a test, to see what would happen. I replaced the "x" with my code "Y", units codes with "89 thru 95".placed your scritp in a event and manualy, triggered it, but nothing happened. There where no error codes in the log. 89 thru 93 are birth dates, 94 and 95 are daylight savings. code 89 is 1 day of completing (actual birthday) and 90 is only 3 days aways. What should the script do when all is ok?
    The script should cause HS to speak the device strings. I cannot see any reason in the script why it should not work.

    Check the devices and make sure there is data in the status box, it should read something like "10 days until whoevers birthday", or whatever you have setup the ini file to put there.

    Leave a comment:


  • Bill Brower
    replied
    Originally posted by Rotech View Post
    Gogs

    Last nigth I ran a test, to see what would happen. I replaced the "x" with my code "Y", units codes with "89 thru 95".placed your scritp in a event and manualy, triggered it, but nothing happened. There where no error codes in the log. 89 thru 93 are birth dates, 94 and 95 are daylight savings. code 89 is 1 day of completing (actual birthday) and 90 is only 3 days aways. What should the script do when all is ok?
    Bump, Gogs

    Leave a comment:


  • Rotech
    replied
    Originally posted by Gogs View Post
    Yes you were correct to replace my "X" with your housecode, but to do it without understanding what you were doing can be a bit risky, however, it is not a bad way to learn how things work or don't as the case might be. Hope you also changed the Unit Code to suite your setup.

    As to where to specify the actual trigger, an event in HomeSeer, might be a good place to start.

    And before you ask, how you trigger the event is completely up to you. It can be a time event, motion detected, or whatever suites you. Just have the event run the script.

    There are other ways of doing it, but, lets keep it simple just now until you have the grasp of it.

    Hope your plan is coming together.

    Gogs

    Last nigth I ran a test, to see what would happen. I replaced the "x" with my code "Y", units codes with "89 thru 95".placed your scritp in a event and manualy, triggered it, but nothing happened. There where no error codes in the log. 89 thru 93 are birth dates, 94 and 95 are daylight savings. code 89 is 1 day of completing (actual birthday) and 90 is only 3 days aways. What should the script do when all is ok?

    sub main()

    for i = 89 to 95
    if (left(hs.devicestring ("y" & Cstr(i)),3))="Tod" then
    hs.speak hs.devicestring("y" & Cstr(i))
    i=i+1
    end if
    if (left(hs.devicestring ("y" & Cstr(i)),3))="Tom" then
    hs.speak hs.devicestring("y" & Cstr(i))
    i=i+1
    end if

    if i>44 then
    exit sub
    end if
    if (left(hs.devicestring ("y" & Cstr(i+1)),3))>100 then
    exit sub
    end if

    if i=43 then
    hs.speak "and, There are " & hs.devicestring("y" & Cstr(i))
    exit sub
    end if


    if (left(hs.devicestring ("y" & Cstr(i)),2))<89 then
    hs.speak "There are " & hs.devicestring("y" & Cstr(i))
    end if
    next

    end sub

    Leave a comment:


  • Gogs
    replied
    Originally posted by Rotech View Post
    Gogs I did not quite catch what you said, so I change the codes in the second line, then replace the "X" for my current letter codes? where do I specify The actual trigger????
    Yes you were correct to replace my "X" with your housecode, but to do it without understanding what you were doing can be a bit risky, however, it is not a bad way to learn how things work or don't as the case might be. Hope you also changed the Unit Code to suite your setup.

    As to where to specify the actual trigger, an event in HomeSeer, might be a good place to start.

    And before you ask, how you trigger the event is completely up to you. It can be a time event, motion detected, or whatever suites you. Just have the event run the script.

    There are other ways of doing it, but, lets keep it simple just now until you have the grasp of it.

    Hope your plan is coming together.
    Last edited by Gogs; May 29, 2008, 07:27 PM.

    Leave a comment:


  • Rotech
    replied
    Gogs I did not quite catch what you said, so I change the codes in the second line, then replace the "X" for my current letter codes? where do I specify The actual trigger????

    Leave a comment:


  • Gogs
    replied
    Originally posted by Rotech View Post
    How do you make an event that when it reaches a certain count down number, will trigger a event?
    Use a script, it's simpler I think. The following is set up for the reminders to have house codes X40 upwards.
    Code:
    sub main()
     
    for i = 40 to 59
    if (left(hs.devicestring ("x" & Cstr(i)),3))="Tod" then
    hs.speak hs.devicestring("x" & Cstr(i))
    i=i+1
    end if
    if (left(hs.devicestring ("x" & Cstr(i)),3))="Tom" then
    hs.speak hs.devicestring("x" & Cstr(i))
    i=i+1
    end if
     
    if i>44 then 
    exit sub
    end if
    if (left(hs.devicestring ("x" & Cstr(i+1)),3))>100 then
    exit sub
    end if
     
    if i=43 then
    hs.speak "and, There are " & hs.devicestring("x" & Cstr(i))
    exit sub
    end if
     
     
    if (left(hs.devicestring ("x" & Cstr(i)),2))<40 then
    hs.speak "There are " & hs.devicestring("x" & Cstr(i))
    end if
    next
     
    end sub
    This script is speaking the reminders, but only if they are dure to occur withing the next 40 days. Instead of HS.Speak you can substitute any HS. command line.

    Leave a comment:


  • Rotech
    replied
    How do you make an event that when it reaches a certain count down number, will trigger a event?

    Leave a comment:

Working...
X