www.homeseer.com    
 

Go Back   HomeSeer Message Board > HomeSeer Products & Services > HomeSeer General Discussion Area

HomeSeer General Discussion Area General discussion about HomeSeer that does not fall into any other category or are not specific to 1.x or 2.x versions of HomeSeer.

Reply
 
Thread Tools Display Modes
  #1  
Old December 16th, 2017, 11:00 PM
swanie2000 swanie2000 is offline
Seer Deluxe
 
Join Date: Feb 2002
Location: Las Vegas
Posts: 291
How to determine if tomorrow is not a school day? (Answered!)

Hi all,
I am trying to have homeseer look at tomorrows (day/date) and decide if tomorrow is a school day or not. I need to have homeseer know before 12:01 am.

Some context to the problem.
I want to shut off the network switch to my kid’s room at 10pm on school nights. This will shut down KODI, and my network tuners, so they cannot stay up all night watching TV, surfing the net, etc. when they should be sleeping for school the next morning. (let’s just say the honor system is not working).

What I want is a virtual device called (school night) and have homeseer enable/disable this device today at 5pm, based on what tomorrow is.

Add into the mix, there are several weekdays though the year that the kids do not have school. I want to be able to add all those days into this equation as well. It would be nice to sit down with a school calendar, once a year, and manually add all the holidays/days off into homeseer. Then homeseer will just take care of this automatically all year long.

I hope this isn't a super easy (I should have figured it out on my own) type question. I have been trying to make this work for a while, and would appreciate any idea other parents might be implementing.

Last edited by swanie2000; December 17th, 2017 at 06:21 PM.
Reply With Quote
  #2  
Old December 17th, 2017, 12:16 AM
Stuart Stuart is offline
Seer Master
 
Join Date: Mar 2002
Location: Massachusetts
Posts: 811
So I guess it starts the night before the first day of school and runs till the next to last day of school (because they do nothing on the last day). So Sundays through thursday night shut it off at 10pm except for the nights before each holdiay. The norm is shutting it off all the time except for the school list and its the night before the day off. then have it turn on next morning after they go to school.
If days sun, mon, tues, wed, thurs, turn off the goodies., then run another event by date
if holiday-1, then enable good stuff for each entry on the day before. This event would folllow the first and override the shut off events by turning them on second.
etc....
hope it helps

Stuart
Reply With Quote
  #3  
Old December 17th, 2017, 12:17 AM
chrisfraser05 chrisfraser05 is offline
Seer
 
Join Date: Dec 2017
Location: scotland
Posts: 11
Google calender and ifttt?
Reply With Quote
  #4  
Old December 17th, 2017, 12:36 AM
tome10 tome10 is offline
Seer Deluxe
 
Join Date: Sep 2016
Location: Arkansas
Posts: 498
You'd probably have to incorporate a calendar from somewhere. You'd have parent teacher days, and odd off days you'd have to enter. Snow days if you get snow. Maybe the School has a website with an RSS feed for something with a banner that says "School Cancelled" or "Teacher Meeting" that you could grab and parse data from.
Reply With Quote
  #5  
Old December 17th, 2017, 02:36 AM
lveatch lveatch is offline
Seer Deluxe
 
Join Date: Dec 2012
Location: USA - Illinois
Posts: 163
When my kids were younger, I did something similar but with different actions. I haven't used it in awhile, but it's based on using homeseer's receiving email capabilities.

I setup a google calendar with a new account where I'd manually enter all days off. I set the calendar's title to "No School".

I then set up email notifications on that calendar, X amount of time before the start time. You can set this in minutes, hours, and more.

I set up homeseer to check for emails on this gmail account matching on from and the subject line setting a virtual device.

I reset the virtual device daily at a set time.

For example, setting up the calendar entry at 12:10 am allows for easy calendar entry matching your kid's school calendar, while you can set the notification to occur 2 hours before the start time, allowing the virtual device to be set by 10:10pm. You can add multiple notifications allowing an earlier notification at 5pm in addition to the 10pm notification trigger.
Attached Images
 
__________________
Len


HomeSeer Version: HS3 Pro Edition 3.0.0.368
Linux version: Linux homeseer Ubuntu 16.04 x86_64
Number of Devices: 555
Number of Events: 750
Available Threads: 600

Enabled Plug-Ins
2.0.49.0: BLBackup
2.0.38.0: BLLAN
3.0.0.40: EasyTrigger
30.0.0.36: RFXCOM
3.0.0.76: weatherXML
3.0.1.130: Z-Wave

Last edited by lveatch; December 17th, 2017 at 02:46 AM.
Reply With Quote
  #6  
Old December 17th, 2017, 03:47 AM
swanie2000 swanie2000 is offline
Seer Deluxe
 
Join Date: Feb 2002
Location: Las Vegas
Posts: 291
Great ideas!

I will experiment with (Holiday-1) to see if I can get that to work. I didn't know I could do math with the dates.

I don't know what ifttt is? I will google it.

A separate google calendar, and email receive into homeseer, that seems like it may work for me as well, but it is complicated. I like a good challenge.

Thanks for the ideas! I will start tinkering with them in the morning.

Still open to hearing any other ideas.
Reply With Quote
  #7  
Old December 17th, 2017, 11:18 AM
Uncle Michael's Avatar
Uncle Michael Uncle Michael is offline
OverSeer
 
Join Date: Feb 2006
Location: Rochester, NY
Posts: 5,670
While this isn't likely to be on the path you are describing, it may be worth considering a different approach. You can fairly easily turn off the power every Sunday - Thursday night. So, restoring the power on those nights when there is no school the next day is what makes the problem difficult.

Have you considered sending yourself a reminder each day to keep power on? If there's school, ignore it. If there is not school, then manually set the virtual device to allow power to be on. I raise this option, not so much because the automation of it is difficult, but because your personal involvement may be more important than the state of the power to your network switch. Other circumstances may arise that make you want to override the default, too. Just wondering if making this too impersonal may send the wrong message about how important studying and learning are to you.
__________________
Mike____________________________________________________________ __________________
HS3 Pro Edition 3.0.0.318

HW: Stargate | NX8e | CAV6.6 | Squeezebox | PCS | WGL 800RF, Rain8Net+ | RFXCOM | QSE100D | Vantage Pro | Green-Eye | X10:
Compose, XTB-232, -IIR | Edgeport/8 | Way2Call | Ecobee3

Reply With Quote
  #8  
Old December 17th, 2017, 11:56 AM
prsmith777 prsmith777 is offline
Seer Master
 
Join Date: Oct 2001
Location: Colorado
Posts: 553
I do something similar for my work schedule using Google Calendar and Blades plugins BLGData. Plugin is worth the money IMO. Only problem is you have to enter everything in Google Calendar. But its not bad. You can easily add all M-F and then go back and deselect the holidays etc.

Its also good for birthday reminders and appointments too.
Reply With Quote
  #9  
Old December 17th, 2017, 11:57 AM
langenet's Avatar
langenet langenet is offline
OverSeer
 
Join Date: May 2003
Location: Ottawa, Ontario, Canada
Posts: 2,513
Interesting... I never looked into this and now have found a great use of it.

However, when I tried this, aside from the fact that it worked, it seems that HS complains.

Dec-17 10:45:15 AM Error Getting POP message header, count: 1982 Index: 1234 :The enveloped-data message does not contain the specified recipient.

Dec-17 10:45:15 AM Error Getting POP message header, count: 1982 Index: 384 :The enveloped-data message does not contain the specified recipient.

Dec-17 10:45:15 AM email Initializing email, found 1982 messages

Dec-17 10:45:15 AM email Start checking server for email using POP

Dec-17 10:45:15 AM Startup Initializing email, will check server for new email

Dec-17 10:42:38 AM TTS Speak ():This is a test

Dec-17 10:42:38 AM Event Event Trigger "Calenadar Email Recieve test"

Dec-17 10:42:38 AM Error Getting POP message header, count: 1982 Index: 1234 :The enveloped-data message does not contain the specified recipient.

Dec-17 10:42:38 AM Error Getting POP message header, count: 1982 Index: 384 :The enveloped-data message does not contain the specified recipient.

Is this a bug? What is the default behavior of POP - leave email on server?

I run my own e-mail server which supports calendaring on the same system along side HS3. When the calendar event comes up, the system will send a reminder message. I see that HS logs in without issue... Just the error throws me off.

Have I missed something?

Robert
__________________
HS3PRO 3.0.0.318 as a Fire Daemon service, Windows 2016 Server Std Intel Core i5 PC HTPC Slim SFF 4GB, 120GB SSD drive, WLG800, RFXCom, TI103,NetCam, UltraNetcam3, BLBackup, CurrentCost 3P Rain8Net, MCsSprinker, HSTouch, Ademco Security plugin/AD2USB, various Oregon Scientific temp/humidity sensors, Z-Net, Zsmoke, Aeron Labs micro switches, Amazon Echo Dot, WS+, WD+ ... on and on.
Reply With Quote
  #10  
Old December 17th, 2017, 12:49 PM
jon00's Avatar
jon00 jon00 is online now
OverSeer
 
Join Date: Jan 2002
Location: London UK
Posts: 11,106
Quote:
Originally Posted by swanie2000 View Post
Hi all,
I am trying to have homeseer look at tomorrows (day/date) and decide if tomorrow is a school day or not. I need to have homeseer know before 12:01 am.

Some context to the problem.
I want to shut off the network switch to my kid’s room at 10pm on school nights. This will shut down KODI, and my network tuners, so they cannot stay up all night watching TV, surfing the net, etc. when they should be sleeping for school the next morning. (let’s just say the honor system is not working).

What I want is a virtual device called (school night) and have homeseer enable/disable this device today at 5pm, based on what tomorrow is.

Add into the mix, there are several weekdays though the year that the kids do not have school. I want to be able to add all those days into this equation as well. It would be nice to sit down with a school calendar, once a year, and manually add all the holidays/days off into homeseer. Then homeseer will just take care of this automatically all year long.

I hope this isn't a super easy (I should have figured it out on my own) type question. I have been trying to make this work for a while, and would appreciate any idea other parents might be implementing.
I'm more comfortable with scripts so this is how I would do it:

Copy the script below and save it in the scripts directory (something like SchoolTomorrow.vb)

Create a virtual device and note its reference number

Change the 1234 in the script to the actual reference number of your device you have just created.

Create a text file called NoSchoolTomorrowDates.txt and save it to your Homeseer Data directory.

In the text file, list the dates where there is no school tomorrow when this falls outside the normal Sunday to Thursday days.

Example:

12/24/2017
12/25/2017

(Make sure there are no spaces in the list including the top).

Run the script at 5:00pm each day from an event and the virtual device will have a value of 1 if there is a school day tomorrow and 0 if not.

Code:
Imports System.IO

      Sub Main(ByVal Parm As Object)

        Try
            Dim Path As String = ""
            Dim FileReader As StreamReader
            Dim Data As String = ""
            Dim DayOfWeek As Integer
            Dim SchoolDayTomorrow As Boolean = True
            Dim DVRef As Integer = 1234


            Path = hs.GetAppPath & "\data\NoSchoolTomorrowDates.txt"
            FileReader = New StreamReader(Path)
            DayOfWeek = DateTime.Now.DayOfWeek

            Select Case DayOfWeek
                Case 1 To 5 'Sunday To Thursday
                    SchoolDayTomorrow = True
                Case 6 To 7 ' Friday & Saturday
                    SchoolDayTomorrow = False
            End Select

            Do While FileReader.Peek >= 0
                Data = FileReader.ReadLine()
                If Data <> "" Then
                    If DateTime.Now.ToString.Contains(Data) Then
                        SchoolDayTomorrow = False
                        Exit Do
                    End If
                End If
            Loop
            FileReader.Close()

            If hs.DeviceExistsRef(DvRef) Then
                If SchoolDayTomorrow Then
                    hs.SetDeviceValueByRef(DvRef, 1, True)
                    hs.SetDeviceString(DVref, "School Tomorrow", True)
                Else
                    hs.SetDeviceValueByRef(DvRef, 0, True)
                    hs.SetDeviceString(DVref, "No School Tomorrow", True)
                End If
            End If

        Catch Ex As Exception
            hs.WriteLog("Error", "Error in SchoolTomorrow.vb: " & Ex.ToString)
        End Try
    End Sub
__________________
Jon

Reply With Quote
  #11  
Old December 17th, 2017, 01:11 PM
jbbtex's Avatar
jbbtex jbbtex is offline
Seer Deluxe
 
Join Date: Dec 2010
Location: Texas
Posts: 441
I use a few events to set a virtual device "School" on/off.
Attached Images
   
__________________
Brady
Reply With Quote
  #12  
Old December 17th, 2017, 02:13 PM
lj502 lj502 is offline
Seer Deluxe
 
Join Date: Dec 2008
Location: Sugar Land, Texas
Posts: 293
Kinda about this, My father "asked nice" of course a didn't listen so he came in and cut the cord off my stereo right in front of me. I think it was right around the time I took an interest in electronics, go figure!

By the way, I have my own now, make sure you can't reach the neighbors wifi from there devices, sneaky little shits!

John
Reply With Quote
  #13  
Old December 17th, 2017, 02:14 PM
swanie2000 swanie2000 is offline
Seer Deluxe
 
Join Date: Feb 2002
Location: Las Vegas
Posts: 291
Thanks for all the input and great ideas.

I have had some time to look into this, and I still cannot figure out how you get homeseer to except a "Holiday-1" or any date minus 1 for that matter.

I have already added a huge list of actual dates (special days/holidays) from the school calendar, and cannot get homeseer to do any math with them.

I could get this to work, as mentioned, by selecting the DAY BEFORE, the actual holiday, but I feel this would get confusing, and lead me to errors (selecting the wrong day)

I looked into google calendar, and If This Then That (IFTTT). That solution seems to have a large learning curve, Maybe later I will explore IFTTT.

I do agree the personal touch is important, and I do have a secrete quick way to turn on/off the network when I forget and without logging into homeseer to do it, but I am looking for a way to automate this, so my kids do not need to remind me when I forget.

I am not the best with scripts, but I think I can get my head around the script Jon00 posted. That seems to be the most straight forward approach to this problem.

Thanks to everyone for your ideas!
Reply With Quote
  #14  
Old December 17th, 2017, 02:20 PM
swanie2000 swanie2000 is offline
Seer Deluxe
 
Join Date: Feb 2002
Location: Las Vegas
Posts: 291
Quote:
Originally Posted by lj502 View Post
Kinda about this, My father "asked nice" of course a didn't listen so he came in and cut the cord off my stereo right in front of me. I think it was right around the time I took an interest in electronics, go figure!

By the way, I have my own now, make sure you can't reach the neighbors wifi from there devices, sneaky little shits!

John
Too funny!
I do not give them a computer with WiFi ability, for this exact reason!

Also, I already have my router disabling the WiFi for their phones MAC address at night, but then they just burn through the monthly allowed data from sprint.

Sprint has mobile phone controls, and that service has put a stop to that, but cost another 6 bucks a month.
Reply With Quote
  #15  
Old December 17th, 2017, 02:30 PM
Rupp's Avatar
Rupp Rupp is offline
OverSeer
 
Join Date: Jan 2001
Location: Huntsville, Al. USA
Posts: 36,883
You could do it the old fashion way and trust them until they break the trust and they will. Then when the trust is broken take away the privilege for, oh say, a month and I'll bet they'd maintain the trust when they get their phones and wifi back. My 27 year old daughter told me a few weeks ago that one of the best things we ever did for her was take her phone, tv, and door (yep bed room door) away for a month when she was 17.
__________________
-Rupp
Reply With Quote
  #16  
Old December 17th, 2017, 03:22 PM
bdraper's Avatar
bdraper bdraper is offline
Seer Master
 
Join Date: Feb 2005
Location: White House, TN
Posts: 1,102
Quote:
Originally Posted by Rupp View Post
You could do it the old fashion way and trust them until they break the trust and they will. Then when the trust is broken take away the privilege for, oh say, a month and I'll bet they'd maintain the trust when they get their phones and wifi back. My 27 year old daughter told me a few weeks ago that one of the best things we ever did for her was take her phone, tv, and door (yep bed room door) away for a month when she was 17.
Bedroom door... LOL, that brings back some memories... I have 3 kids myself (the youngest is 19), been there done that.
__________________
Billy
Reply With Quote
  #17  
Old December 17th, 2017, 03:44 PM
langenet's Avatar
langenet langenet is offline
OverSeer
 
Join Date: May 2003
Location: Ottawa, Ontario, Canada
Posts: 2,513
Quote:
Originally Posted by langenet View Post
Interesting... I never looked into this and now have found a great use of it.

However, when I tried this, aside from the fact that it worked, it seems that HS complains.

Dec-17 10:45:15 AM Error Getting POP message header, count: 1982 Index: 1234 :The enveloped-data message does not contain the specified recipient.

Dec-17 10:45:15 AM Error Getting POP message header, count: 1982 Index: 384 :The enveloped-data message does not contain the specified recipient.

Dec-17 10:45:15 AM email Initializing email, found 1982 messages

Dec-17 10:45:15 AM email Start checking server for email using POP

Dec-17 10:45:15 AM Startup Initializing email, will check server for new email

Dec-17 10:42:38 AM TTS Speak ():This is a test

Dec-17 10:42:38 AM Event Event Trigger "Calenadar Email Recieve test"

Dec-17 10:42:38 AM Error Getting POP message header, count: 1982 Index: 1234 :The enveloped-data message does not contain the specified recipient.

Dec-17 10:42:38 AM Error Getting POP message header, count: 1982 Index: 384 :The enveloped-data message does not contain the specified recipient.

Is this a bug? What is the default behavior of POP - leave email on server?

I run my own e-mail server which supports calendaring on the same system along side HS3. When the calendar event comes up, the system will send a reminder message. I see that HS logs in without issue... Just the error throws me off.

Have I missed something?

Robert
So I think there's a limitation to the number of e-mails that the account has in order to have this work without error. My account I defined above is actually an Imap account and with 1982 messages it appears that HS3 has issue digesting the return list or something. When I tested with another account which only had one message in it, it works fine.
I can send a calendar message to it and despite checking each minute, it is processed cleanly. Can anyone else confirm this? I could create a rule such that if I get the reminder e-mail, I could forward it to the other account, but this gets a bit messy which in my opinion shouldn't be required.

Robert
Reply With Quote
  #18  
Old December 17th, 2017, 03:57 PM
sonypoolplr sonypoolplr is offline
Seer Master
 
Join Date: Dec 2001
Location: New Jersey
Posts: 1,092
Not really fancy, but I just go through the kids school calendars at the beginning of the year and I have events that trigger based on the dates I put into the events.
Reply With Quote
  #19  
Old December 17th, 2017, 04:10 PM
S-F's Avatar
S-F S-F is offline
OverSeer
 
Join Date: Jun 2012
Location: Goobertown AR 72450
Posts: 2,931
Yep. There's no door on my 17 year old daughter's bedroom. It still looks and smells like a barn stall though.
__________________
Quote:
Originally Posted by rprade View Post
There is no rhyme or reason to the anarchy a defective Z-Wave device can cause
Reply With Quote
  #20  
Old December 17th, 2017, 04:31 PM
swanie2000 swanie2000 is offline
Seer Deluxe
 
Join Date: Feb 2002
Location: Las Vegas
Posts: 291
Quote:
Originally Posted by jon00 View Post
I'm more comfortable with scripts so this is how I would do it:

Copy the script below and save it in the scripts directory (something like SchoolTomorrow.vb)

Create a virtual device and note its reference number

Change the 1234 in the script to the actual reference number of your device you have just created.

Create a text file called NoSchoolTomorrowDates.txt and save it to your Homeseer Data directory.

In the text file, list the dates where there is no school tomorrow when this falls outside the normal Sunday to Thursday days.

Example:

12/24/2017
12/25/2017

(Make sure there are no spaces in the list including the top).

Run the script at 5:00pm each day from an event and the virtual device will have a value of 1 if there is a school day tomorrow and 0 if not.

Code:
Imports System.IO

      Sub Main(ByVal Parm As Object)

        Try
            Dim Path As String = ""
            Dim FileReader As StreamReader
            Dim Data As String = ""
            Dim DayOfWeek As Integer
            Dim SchoolDayTomorrow As Boolean = True
            Dim DVRef As Integer = 1234


            Path = hs.GetAppPath & "\data\NoSchoolTomorrowDates.txt"
            FileReader = New StreamReader(Path)
            DayOfWeek = DateTime.Now.DayOfWeek

            Select Case DayOfWeek
                Case 1 To 5 'Sunday To Thursday
                    SchoolDayTomorrow = True
                Case 6 To 7 ' Friday & Saturday
                    SchoolDayTomorrow = False
            End Select

            Do While FileReader.Peek >= 0
                Data = FileReader.ReadLine()
                If Data <> "" Then
                    If DateTime.Now.ToString.Contains(Data) Then
                        SchoolDayTomorrow = False
                        Exit Do
                    End If
                End If
            Loop
            FileReader.Close()

            If hs.DeviceExistsRef(DvRef) Then
                If SchoolDayTomorrow Then
                    hs.SetDeviceValueByRef(DvRef, 1, True)
                    hs.SetDeviceString(DVref, "School Tomorrow", True)
                Else
                    hs.SetDeviceValueByRef(DvRef, 0, True)
                    hs.SetDeviceString(DVref, "No School Tomorrow", True)
                End If
            End If

        Catch Ex As Exception
            hs.WriteLog("Error", "Error in SchoolTomorrow.vb: " & Ex.ToString)
        End Try
    End Sub
Hi Jon00,
Thanks for this script!
I have been trying to get it to work, with a little success.
I created a new device called "School Night (True/false)" Ref ID# 337
I created a text file with no spaces(the rest of this school year), and added tomorrows date as a test. 12/18/2017 is Monday, normally there is school, but I added it to the top of the list, to test if the script would see it.

****************************************
12/18/2017
12/25/2017
12/26/2017
12/27/2017
12/28/2017
12/29/2017
1/1/2018
1/2/2018
1/3/2018
1/4/2018
1/5/2018
1/15/2018
2/15/2018
2/16/2018
2/19/2018
3/26/2018
3/27/2018
3/28/2018
3/29/2018
3/30/2018
4/2/2018
5/25/2018
5/28/2018
5/29/2018
5/30/2018
5/31/2018
**********************************************

I copied the script, pasted it into NotePad++, changed "1234" to "337" and saved it as SchoolTomorrow.vb

Created a manual test event, to run the script.

If I manually turn off my virtual device #337, and manually run the script, the device will turn on. Works every time.

However, regardless if (12/18/2017) is in the date text file, Running the script will always turn the device on, and never turn the device back off.

Did I do something wrong?
Not sure on the virtual device, as it defaults to 100 is on, 0 is off.
Reply With Quote
Reply

Bookmarks

Thread Tools
Display Modes

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off

Forum Jump

Similar Threads
Thread Thread Starter Forum Replies Last Post
Trigger even to run tomorrow? jquincy HS3 / HS3PRO Discussion 5 September 5th, 2017 04:35 PM
Weather forecast for tomorrow U5tabil YR Weather Plugin (3P) 12 February 10th, 2017 04:13 AM
Inhibit Today-Tomorrow langenet mcsSprinklers 1 June 15th, 2016 08:19 PM
Inhibit Tomorrow langenet mcsSprinklers 3 August 25th, 2012 01:47 PM
hs.sunrise time for tomorrow rmorton27 Web Server and Interface 7 January 29th, 2005 09:09 AM


All times are GMT -4. The time now is 09:26 AM.


Copyright HomeSeer Technologies, LLC