Rori Posted January 13, 2012 Share Posted January 13, 2012 Hi,Need a bit of help.Programmed SR250 remote so that when battery level below X>send email.I got hundreds of emails today from C4 to let me know.So I thought I would add "STOP" as a second line of code.....however, still getting emails.Any suggestions on this?Thanks! Link to comment Share on other sites More sharing options...
nikon Posted January 13, 2012 Share Posted January 13, 2012 Use a Boolean variable which lets the system know that notification was sent out and have the variable reset itself after a predetermined length of time. Link to comment Share on other sites More sharing options...
CFUG Posted January 13, 2012 Share Posted January 13, 2012 Nikon is right (as ususal). I use a variable that gets flipped below 20% power. I decided to just manually reset it after I change the batteries. Link to comment Share on other sites More sharing options...
ILoveC4 Posted January 13, 2012 Share Posted January 13, 2012 These guys are spot on. The only thing I'd add is that I reset the boolean twice every week, so I get emailed more then once but not crazy like you did today. Link to comment Share on other sites More sharing options...
Godzilla Posted January 14, 2012 Share Posted January 14, 2012 how about an example Link to comment Share on other sites More sharing options...
Rori Posted January 14, 2012 Author Share Posted January 14, 2012 Thanks very much for all the help. Yes an example would be great!I think I sort of understand the idea but not sure I got it right.I created a boolean variable (false) and a non repeating timer (23 hrs 59 mins, as this it the max?). Not sure if this is correct nor how to do reset variable twice every wk.Program as follows:When Remote battery less than X:IF variable false-send email-set variable to true-start timerWhen timer is up-set variable to falseAll I want is a single email, I don't want the timer running (maybe using resources?).Any ideas to fine tune this would be great!Rori Link to comment Share on other sites More sharing options...
thecodeman Posted January 14, 2012 Share Posted January 14, 2012 Use a scheduled event not a timer. When schedulet event fires, reset your variable. Ilovec4 may have it repeat on Monday and Thursday at 9pm for example . Link to comment Share on other sites More sharing options...
ILoveC4 Posted January 14, 2012 Share Posted January 14, 2012 thecodeman is right on.When battery is below xxxSet variable to true.When variable changesIF variable is true send email.At 9PMIf it's Tuesday Set variable to false. StopIf it's Friday Set variable tl false StopIs that enough detail? Link to comment Share on other sites More sharing options...
Godzilla Posted January 14, 2012 Share Posted January 14, 2012 so basically once the variable changes to true.........it stays there.............you reset the variable back to false.................to allow for only 2 emails per week.............then when you replace the batteries it sets itself back to false...is a good example Dan.........thanks Link to comment Share on other sites More sharing options...
Rori Posted January 14, 2012 Author Share Posted January 14, 2012 Wow, thanks soooo much. No way I would have been able to come up with this. A few more steps that I would have thought of but yes, it makes sense.This may be an obvious question but if you have more than one remote (Y, Z ,etc), would you need a variable for each and a program for each, so that:When battery of Y is below xxxset variable of Y to trueWhen variable of Y changesIF variable of Y is true send emailSame above but for Remote ZNot sure then how to do scheduler if you would want to use exact time and day (9PM Tue and Frid as in example) for all remotes because of the Stop. I guess I can use a different times or days for each remote?Thanks a lot for the detail. Link to comment Share on other sites More sharing options...
Ramorous Posted January 14, 2012 Share Posted January 14, 2012 1. Create a Boolean variable (IE: SR250-01-Battery)2. Programming -> Remote2.1 If Battery <= 20% (or whatever)2.1.1 If SR250-01-Battery = FALSE2.1.1.1 Send EMail2.1.1.2 Set SR250-01-Battery to TRUE2.2 If Battery > 20% (or whatever)2.2.1 IF SR250-01-Battery = TRUE2.2.1.1 Set SR250-01-Battery to FALSEThat's the Pseudo code I would do it with. Looking through the other comments, you could add a timer as well if you want to be re-notified. It's relatively easy to accomplish. Link to comment Share on other sites More sharing options...
thecodeman Posted January 14, 2012 Share Posted January 14, 2012 No stop, at least in my case. Use the scheduler.Just have the event be called "battery variable resets" and it resets all the variables for battery status checking to false. In the scheduler you can specify a single event to happen on certain days, at a time, and be repeating.have the programming on if variable living remote battery low = true, send email "living battery remote battery is low, replace soon". Repeat for other variables.Im sure there's a way you can get fancy with a string variable of some kind to populate the info in the variable for you, but the thought process escapes me. Hey, I just got a Dune Link to comment Share on other sites More sharing options...
CFUG Posted January 14, 2012 Share Posted January 14, 2012 This is cool programming but unless you actually change those batteries when it tells you too, you'll be like me with a dead SR at high decibel sound levels. Real popular with sleeping kids and an up-tight wife. Link to comment Share on other sites More sharing options...
thecodeman Posted January 14, 2012 Share Posted January 14, 2012 This is cool programming but unless you actually change those batteries when it tells you too, you'll be like me with a dead SR at high decibel sound levels. Real popular with sleeping kids and an up-tight wife.LOL Link to comment Share on other sites More sharing options...
Rori Posted January 14, 2012 Author Share Posted January 14, 2012 Thanks to everyone for their input.Not super easy after all (at least for me!) but I think I got it. We'll see if it works as I expect.I prefer to be proactive changing batteries (rechargeables work great for me) rather than to get a crisis call in the middle of the day because "C4 does not work", meaning batteries on the remote are low or drained and remote not responding. I don't think I get the "Low Battery" notice on the display consistently, perhaps because the batteries I use, but they serve me quite well.Thanks again. Link to comment Share on other sites More sharing options...
CFUG Posted January 14, 2012 Share Posted January 14, 2012 Yeah, that's a possible issue with me as well. I don't think I see "Low Batteries" on the SR proportional to the actual occurence. Link to comment Share on other sites More sharing options...
TexasBill Posted January 15, 2012 Share Posted January 15, 2012 1. I have it simply sending me an email and I am not getting hundreds - I get one. so hmmmmm....???2. Be awarethat the percentage (I have mine set at 10 percent) is alsmot useless - I was changing batteries like a house afire and then tested them one day - they wee still full accoring tothe tester. I put them back in and they ran another month before the dreade email - so check your batterys before you toss them.Bill Link to comment Share on other sites More sharing options...
Recommended Posts
Archived
This topic is now archived and is closed to further replies.