Announcement

Collapse
No announcement yet.

Help with Status Device Code Ref

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

    Help with Status Device Code Ref

    I'm trying to find a way to send a "Pushover" notification to my iphone if a backup is not completed.

    I tought I could use the Status Device Code Ref to build a script and send the message if a backup is not completed but I can't find anyway to read the statuts of a backup

    Can anyone help please

    Thanks

    #2
    I found out a way, maybe not the cleanest but it work... here is a simple script looking for the result of the backup ParmArray(0) for wich I first write a BLBackup Info log line in HS3 log and then send a pushover message to the device ParmArray(1) depending on the backup state that I run 30 minutes after running a backup event...



    Sub Main(ByVal Parms As Object)

    Dim ParmArray() As String
    ParmArray = Parms.ToString.Split("|")

    dim Dev_Val = hs.DeviceExistsCode(ParmArray(0))
    dim BlBackup_result = hs.DeviceValue(Dev_Val)

    select case BlBackup_result

    case 0
    hs.writelog("BLBackup Info", "Backup Homeseer "& ParmArray(0) & " Fail")
    hs.PluginFunction("Pushover 3P", "", "Pushscript", New Object() {ParmArray(1), "Backup Homeseer "& ParmArray(0) & " Fail", "BLBackup", "high", "tugboat",Nothing, Nothing, Nothing})

    case 1
    hs.writelog("BLBackup Info", "Backup Homeseer "& ParmArray(0) & " Succes")
    hs.PluginFunction("Pushover 3P", "", "Pushscript", New Object() {ParmArray(1), "Backup Homeseer "& ParmArray(0) & " `Success", "BLBackup", "normal", "tugboat",Nothing, Nothing, Nothing})

    case 2
    hs.writelog("BLBackup Info", "Backup Homeseer "& ParmArray(0) & " In Progress")
    hs.PluginFunction("Pushover 3P", "", "Pushscript", New Object() {ParmArray(1), "Backup Homeseer "& ParmArray(0) & " In Progress", "BLBackup", "normal", "tugboat",Nothing, Nothing, Nothing})

    case else
    hs.writelog("BLBackup Info", "Backup Homeseer "& ParmArray(0) & " Unknown code")
    hs.PluginFunction("Pushover 3P", "", "Pushscript", New Object() {ParmArray(1), "Backup Homeseer "& ParmArray(0) & " Unkwnown code", "BLBackup", "high", "tugboat",Nothing, Nothing, Nothing})
    end select


    End Sub

    Comment

    Working...
    X