Jump to content

Program to Turn on A Device Monthly


arf1410

Recommended Posts

The other option if he doesn't want to change firmware or start using node servers is to install the programs I wrote over a decade ago and are on the wiki that do the same thing the node server does.  Those programs work perfectly and for the most part I still use them because . .. they work perfect.  But if I were starting from scratch, I would do the node server. 

 

https://wiki.universal-devices.com/index.php?title=ISY-99i_Generic_Calendar_Using_Programs_and_Variables

  • Like 1
Link to comment
17 hours ago, apostolakisl said:

I have similar concerns and manage it similar to what you have suggested.

First, installing node servers is a pretty good idea.  You will need to upgrade to the newer hardware UD sells (Eisy).  There are probably 100 or more node servers now that create nodes on your ISY for boat loads of things that aren't Insteon or Zwave switches.  So many things you just need to peruse the list.  I have node servers that track my electricity usage from Emporia energy monitor, my water usage via a Flume, my Tesla, my alarm systems, my Blue Iris security camera software, and a bunch of other stuff.  The one node that pertains here is one that creates nodes for a bunch of calendar stuff.  So you can make a program that turns something on every 15th of the month, every June 3rd, or you get the idea.  Each of the items in the screen shot below is a node that you can use in a program.  You can also make something happen every 3rd day or whatever using the days since epoch (ie for 3, divide by 3 and run it when the remainder is either 0,1,or 2 depending on your preference).  Anyway, back to the data threats, I have a series of hard drives that backups are saved to on a schedule.  The hard drives are powered by Insteon appliance links.  The hard drives are only powered up while the backup is being made.  Furthermore, new backups do not overwrite old backups, so if I get encrypted, I don't ruin my non-encrypted backup I previously made.  The appliance link creates a hard disconnect between the hard drive and electricity which protects it from be accessed by anyone wishing harm.  It also protects it from power surges.  Furthermore, if you have a water event, often times hard drives will survive submersion if you properly dry them out before applying power.  At least long enough to get your data off anyway.

image.thumb.png.db1f2980ef09441cf13b34abda1cf222.png

It doesn't appear it would solve @GeorgeRufle's problem of finding the last day of each month. I would have thought that would have been a supplied field since I have only ever figured any way except a bruteforce method using a list of 12 and some logic magic for leap years.

IIRC, I wanted to accomplish this myself once but ended up changing my human logic instead and went for another date in each month instead.

An even more perplexing one is to determine Easter but I think @asbrilhas the NS for that one using a Google calendar.

Edited by larryllix
Link to comment
55 minutes ago, larryllix said:

It doesn't appear it would solve @GeorgeRufle's problem of finding the last day of each month. I would have thought that would have been a supplied field since I have only ever figured any way except a bruteforce method using a list of 12 and some logic magic for leap years.

IIRC, I wanted to accomplish this myself once but ended up changing my human logic instead and went for another date in each month instead.

An even more perplexing one is to determine Easter but I think @asbrilhas the NS for that one using a Google calendar.

I wrote a program that calculates Orthodox Easter.  I am not positive how Western Easter is calculated, but Eastern Orthodox is a bit complex.  It is the first Sunday, after the first full moon, after the spring equinox.  Sounds easy enough to program, right?  Wrong.  The issue is they don't use the actual equinox and the actual full moon.  They use predictions for when these things would be, not when they actually are.  And the math was done  thousand years ago and isn't accurate.  Also, while these things happen at a moment in time that is the same everywhere, the date on the calendar is different depending on where you are on the planet.  In short, it is easiest to just input the dates manually for the next 10 or 20 years or whatever.

As far as being the last day of the month.  This is not hard, though bulky.  You could do this with fewer programs using a else wait 24hours for all of the 30 day months and skip the 31 day month program, also for leap year feb.  But I prefer not to use wait 24 hour lines since a reboot will cause issues.

If 

month = 1,3,5,6,8,10,12

and 

day = 31

Then

do backup

 

If month = 2

and leap year =0

and day = 28

Then

do backup

 

If month =2

and leap year = 1

and day = 29

then do backup

 

If month = 4,6,7,9,11

and day = 30

then do backup

 

EDIT:  You could also ask the maker of the node server to add a field "last day of month" that is either true or false.

Edited by apostolakisl
  • Like 1
Link to comment
2 hours ago, larryllix said:

It doesn't appear it would solve @GeorgeRufle's problem of finding the last day of each month. I would have thought that would have been a supplied field since I have only ever figured any way except a bruteforce method using a list of 12 and some logic magic for leap years.

IIRC, I wanted to accomplish this myself once but ended up changing my human logic instead and went for another date in each month instead.

An even more perplexing one is to determine Easter but I think @asbrilhas the NS for that one using a Google calendar.

@firstone 's Google Holidays is a powerful Node Server that deserves to be known and used. It is a bit complicated to install because of Google's authentication process. Its use needs some learning but I can assure you that once you understand the process, it becomes very powerful and easy.

For the installation I would share @firstone's instructions. As said, these are complicated but if I can do it, then anyone can do it :-) .

For the actual use, there are some one-time steps, which consist of creating sub-calendars in your Google calendar. Once that is done, you create all-day events in a sub-calendar and it will create a today and a tomorrow node in your ISY.  With these nodes you can create whatever program you want.

As an example, once a week I add a one-day event in a sub-calendar that represents days that my wife works the following week. I have a ISY program that acts when the today node of that sub calendar is true, and in Then it sets a light to on, opens the curtains and has Alexa say "hey gorgeous, time to open your eyes".

Once that program has been set up, the only thing I do is once a week (or I could do that once a month) add the appropriate all-day events in my Google calendar.

If you have an annual event, let's say Christmas, then all you do is once create a all-day event of the selected sub-calendar and then the program will run forever.

True, if is just for Christmas or another official holiday, then the Holidays Node Server is sufficient and easier to set up, but for any non official holyday or special day, the Holidays Google is superb.

Edited by asbril
  • Like 1
Link to comment
21 hours ago, arf1410 said:

OP here.  Appreciate the input.  Let me add a bit more context.

My ISY programming, and network management skills are much more basic than 98% of the folks here.  Terms like "node server" don't have much meaning to me.

here's more of the "Big Picture"... I was hit with a ransomwear attack last summer, where the bulk of the files on my old QNAP 2-disk NAS were encrypted, and I came close to loosing lots of important things, until I managed to find an old hard drive in a closet to bail myself out.  Because these were files I dont access regularly, I didnt even notice the encryption until 3 months after the attack.  Trying to avoid that again, so bought a new Synology as my primary NAS, and was going to attempt to automate its backup about once a month (or 2?), via windows task manager, and FreeFileSync, to the QNAP.  For added security, that QNAP was going to be mostly powered off.  It is in a mode such that when power is restored (after power outage, etc), it boots back up.

So, using a basic insteon module, have the QNAP turned on for, say, 24 hours on the 15th of every month (or every other month?), then turned off.  I would assume is the QNAP is powered off, it will be nearly impossible to hack into.  I would schedule the backups to happen during that 24 hour window of being powered on.

thanks.

 

I think there is a better way to do the backups with synology using either its hyperbackup or active backup or combination depending what you want backed up . You also may be able to send a wol packet to qnap via Node Server but if you don’t run node servers use a program to schedule on a pc. qnap can also use scheduler built in to turn itself on. 
 

https://www.qnap.com/en/how-to/faq/article/enabling-power-schedule-on-the-nas

Edited by brians
Link to comment
@firstone 's Google Holidays is a powerful Node Server that deserves to be known and used. It is a bit complicated to install because of Google's authentication process. It's use needs some learning but I can assure you that once you understand the process, it becomes very powerful and easy.
For the installation I would share @firstone's instructions. As said, these are complicated but if I can do it, then anyone can do it :-) .
For the actual use, there are some one-time steps, which consist of creating sub-calendars in your Google calendar. Once that is done, you create all-day events in a sub-calendar and it will create a today and a tomorrow node in your ISY.  With these nodes you can create whatever program you want.
As an example, once a week I add a one-day event in a sub-calendar that represents days that my wife works the following week. I have a ISY program that acts when the today node of that sub calendar is true, and in Then it sets a light to on, opens the curtains and has Alexa say "hey gorgeous, time to open your eyes".
Once that program has been set up, the only thing I do is once a week (or I could do that once a month) add the appropriate all-day events in my Google calendar.
If you have an annual event, let's say Christmas, then all you do is once create a all-day event of the selected sub-calendar and then the program will run forever.
True, if is just for Christmas or another official holiday, then the Holidays Node Server is sufficient and easier to set up, but for any non official holyday or special day, the Holidays Google is superb.
Like they say. 'it's not what I know, it's the Asbril that you know.'

Sent from my SM-G781W using Tapatalk

  • Haha 2
Link to comment
3 hours ago, brians said:

I think there is a better way to do the backups with synology using either its hyperbackup or active backup or combination depending what you want backed up . You also may be able to send a wol packet to qnap via Node Server but if you don’t run node servers use a program to schedule on a pc. qnap can also use scheduler built in to turn itself on. 
 

https://www.qnap.com/en/how-to/faq/article/enabling-power-schedule-on-the-nas

That is interesting.  I wonder just how "shut down" it is and if a bad actor could know about that interface and turn the drives on.  Personally, I have done shut down drives two ways, one is with ISY and appliancelinks, I do it like this for my church backups.  It is very easy to setup.  But someone who knew about it somehow could potentially hack ISY and turn the drives on remotely.  For my business backups, I set up a webcontrol board, programmed it using its own internal language and then have relays control the power supply.  The webcontrol board is unhackable, the device, once programmed, does not need an internet connection and thus I have it unplugged from the network.  It is impossible to turn those drives on remotely.  And the hard disconnect also protects against power line spikes and having zero electricity in the hard drive should give some resistance against a water event.   Certainly the NAS with this built-in feature is going to be the easiest to configure.  My webcontrol board required wiring up some relays in addition to programming it using a somewhat archaic language.  

Link to comment
40 minutes ago, apostolakisl said:

That is interesting.  I wonder just how "shut down" it is and if a bad actor could know about that interface and turn the drives on.  Personally, I have done shut down drives two ways, one is with ISY and appliancelinks, I do it like this for my church backups.  It is very easy to setup.  But someone who knew about it somehow could potentially hack ISY and turn the drives on remotely.  For my business backups, I set up a webcontrol board, programmed it using its own internal language and then have relays control the power supply.  The webcontrol board is unhackable, the device, once programmed, does not need an internet connection and thus I have it unplugged from the network.  It is impossible to turn those drives on remotely.  And the hard disconnect also protects against power line spikes and having zero electricity in the hard drive should give some resistance against a water event.   Certainly the NAS with this built-in feature is going to be the easiest to configure.  My webcontrol board required wiring up some relays in addition to programming it using a somewhat archaic language.  

They would need access to your network and then know the MAC address of the QNAP to wake it up if you use WOL, which must also be enabled on QNAP. If you set the QNAP to wake up on schedule then there is should be no way for someone to remotely turn it on.

 

Link to comment

The QNAP power cycle schedule only allows for daily / weekly events, best I can gather.

Wouldn't this really simple routine work fine with much less complexity than other proposed solutions? It could power on my QNAP for 24 hours each quarter, allowing time for backup.  I prefer a copy of files, rather than the synology proprietary backup system.  Its really simple to duplicate those dates, so I could easily add 4 or 8 more, to cover a few years.

image.png.fda13f92ca7aa9a35165302410f8c9d4.png

  • Like 1
Link to comment
Guest
This topic is now closed to further replies.

×
×
  • Create New...