Announcement

Collapse
No announcement yet.

Alert on low batteries?

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

    Alert on low batteries?

    I'd like to create an event that is triggered by low battery warnings for my various devices - at a minimum for my 4 Kwikset locks, but ideally for any device with a battery status.

    The thing is, right now I have 4 locks plus one sensor that are battery powered, eventually I may have *many* that are. So I don't really want to have to create a separate event for each and every device if I can help it.

    Anyone found a way to consolidate battery alerts a bit to alert you on low batteries?

    regards,

    Paul

    #2
    For mine I have a single event which has each battery operated device separated with an or statement based on battery being between 0-40%.

    If any one of them goes below 40% it triggers an email to me with the below content showing the battery level for each device.



    HOME ENERGY MONITOR
    ===========================================
    HEM Bat $$DSR:732:
    MOTION SENSORS
    ===========================================
    Garage Sensor $$DSR:210:
    Front Entrance $$DSR:754:
    Upstairs $$DSR:760:
    Bedroom Wardrobe $$DSR:165:
    Stairs $$DSR:194:
    Computer Room $$DSR:172:
    Kitchen $$DSR:531:
    Lounge $$DSR:161:
    Dining Room $$DSR:201:
    Formal Lounge $$DSR:221:
    DOOR SENSORS
    ===========================================
    Family Room $$DSR:226:
    Garage $$DSR:234:
    Study $$DSR:232:
    Server Cupboard $$DSR:230:
    AIR CONDITIONING
    ===========================================
    Lounge $$DSR:115:
    Bedroom $$DSR:127:

    Next I get it to run a script to play a tts reminder via my wall mounted tablets. I don't profess to be a coder so am sure there are more efficient/tidy ways of achieving the same, but it works for me.

    sub main()
    if hs.devicevalue("188") < 40 or hs.devicevalue("165") < 40 or hs.devicevalue("194") < 40 or hs.devicevalue("172") < 40 or hs.devicevalue("210") < 40 or hs.devicevalue("215") < 40 or hs.devicevalue("201") < 40 or hs.devicevalue("234") < 40 or hs.devicevalue("161") < 40 or hs.devicevalue("221") < 40 Then
    hs.speak greeting() & "The battery level on the following sensors are getting low. " & lowbatt(),TRUE,"*:Kindle HD"
    end if
    end sub
    Function lowbatt()
    lowbatt =""
    if hs.devicevalue("188") < 40 Then
    lowbatt=lowbatt&"Outside Front Door. "
    end if
    if hs.devicevalue("165") < 40 Then
    lowbatt=lowbatt&"Kitchen. "
    end if
    if hs.devicevalue("194") < 40 Then
    lowbatt=lowbatt&"Stairs. "
    end if
    if hs.devicevalue("172") < 40 Then
    lowbatt=lowbatt&"Study. "
    end if
    if hs.devicevalue("210") < 40 Then
    lowbatt=lowbatt&"Garage Sensor. "
    end if
    if hs.devicevalue("215") < 40 Then
    lowbatt=lowbatt&"Upstairs. "
    end if
    if hs.devicevalue("201") < 40 Then
    lowbatt=lowbatt&"Dining Room. "
    end if
    if hs.devicevalue("234") < 40 Then
    lowbatt=lowbatt&"Garage Door. "
    end if
    if hs.devicevalue("161") < 40 Then
    lowbatt=lowbatt&"Family Room Sensor. "
    end if
    if hs.devicevalue("221") < 40 Then
    lowbatt=lowbatt&"Formal Lounge Sensor. "
    end if
    End Function

    Function greeting()
    dim phrase(6), choice, choices
    choices = Ubound(phrase) - 1
    phrase(1) = "Hello Owen Family. "
    phrase(2) = "Hello! "
    phrase(3) = "Yo Yo Yo. Whats Up. "
    phrase(4) = "Missus Owen. "
    phrase(5) = "Stop ignoring me. I am trying to tell you something important. "
    Randomize
    choice = Int((choices * Rnd)) + 1
    greeting = phrase(choice)
    End Function

    Comment


      #3
      Hmmm..... Something like that (minus the tts) might work for me, it still means putting each device in individually, but it's better than doing a separate event for each one. Unless anyone does have something more efficient?

      regards,

      Paul

      Comment


        #4
        Originally posted by paul View Post
        Hmmm..... Something like that (minus the tts) might work for me, it still means putting each device in individually, but it's better than doing a separate event for each one. Unless anyone does have something more efficient?

        regards,

        Paul
        I have something similar for the first part.

        A single event that has all the battery devices testing for <30% with OR statements, then a single Pushover action with the current battery levels for all devices using the " $$DVC:<device code>: " version of replacement variables.
        cheeryfool

        Comment

        Working...
        X