Jump to content
C4 Forums | Control4

Low Battery Alert


cdepaola

Recommended Posts

This has been recently covered and Cyk gave an excellent option for programming this so you don't get constant e-mail or texts.  I've programmed it slightly differently and wanted to run it past to see if I'm missing something and if it should work. 
 
 
Programing for when the remote reports its level at below 25% (I assume it reports its battery level every time its used)

when Family->System Remote Control SR-250 is below 25%? If Variables->Home SR250 Battery is False > Variables->Home SR250 Battery = True

I don't need to be alerted to this sort of stuff daily and thought just a Weekly alert would be fine. I also assume I'll change the battery when this fires so I set the Variable to false

When scheduled event 'Maintenance Alerts' executes? If Variables->Home SR250 Battery is True > Email Notification  > Variables->Home SR250 Battery = False

In case I change the battery early I wanted to catch that so I could clear the variable before the next weekly alert.

When the variable Family->System Remote Control SR-250->BATTERY_LEVEL changes? If Family -> System Remote Control SR-250->Battery_Level Greater Than or Equal to 50 ? If Variables_>Home SR250 Battery is True  > Variables->Home SR250 Battery = False
Link to comment
Share on other sites


? If Variables->Home SR250 Battery is False

 

? If Variables_>Home SR250 Battery is True

 

Are not needed in the first and second part - a varaible set to the level it already is at triggers no change. Nothing wrong with it, but not needed.

 

In the second part, I wouldn't set the variable to false - leave that to the third set you have - setting it to false after sending the notification WILL get it kicked back to true right away (it's unlikely you change the battereis from the moment the email is sent to the next check-in), making the line useless.

Again, nothing wrong with the setup, just some redundant lines.

 

The only question is what battery level changes it reports - ie will it properly report a 'new' 100%, or wait untill it sees 99%, or is it 5% jumps. I'm not sure on that one, but in a weekly report it's quite unlikely to not register.

That said it may be wise to have a second weekly schedule point (a few days after the 'maintenance' one) that sets the variable to false - just in case it waits until 75% before reporting a 'change'. As below 25% will trigger at 20%, 15% etc as well, the risk of a missed low battery event is virtually nill. Or try it as is and see how accurate the high level battery % reporting is.

 

Oh and yes it reports battery level on every check-in, be it being used or it's occasionaly regular check-in.

Link to comment
Share on other sites

Thanks...

 

It's hard to break old habits and I'm use to writing If/Else statements..

 

In reference to:

 

 

The only question is what battery level changes it reports - ie will it properly report a 'new' 100%, or wait untill it sees 99%, or is it 5% jumps. I'm not sure on that one, but in a weekly report it's quite unlikely to not register.

 

If the remote reports its level every check-in then I would have thought the statement of "Greater Than or Equal to 50" would catch any battery change that gets the level to at least 50%.  I choose this number incase a battery wasn't at full power but raised the level enough that I didn't need to worry about a change. Now that I'm home I may need to find some depleted batteries and test it out. 

 

Thanks again for the input

Link to comment
Share on other sites

The "IF" part is the question - I'm pretty sure it reports it the status, but your IF is based off of a CHANGE in percentage.

I'm NOT convinced that the driver registers the 'change' from before on a reboot (which is what of course happens when you change the batteries).

Subsequently there may not be a change in the level for some time - it may be at 95% for some time before dropping to 94%.

THEN there's the question what the driver sees as a change in level - does is see it at that 1%, or does it only trigger every 5%.

 

No pun intended, but there's some big IF's in there that I don't know the answer too (even though I suspect it'll trigger at every 1% and that it would be fine) that would require some real life testing.

Link to comment
Share on other sites

It's hard to break old habits and I'm use to writing If/Else statements..

 

Yeah, as I said what you're doing isn't wrong - there's just redundant code. And I'M used to limit redundancy of code as much as possible (ahh the days when Kb's and KB's (and even just bits and bytes) mattered. ;)

Link to comment
Share on other sites

Archived

This topic is now archived and is closed to further replies.

×
×
  • Create New...

Important Information

By using this site, you agree to our Terms of Use.