Skip to content

Commit

Permalink
Insteon: Sump pump alarm monitoring
Browse files Browse the repository at this point in the history
  • Loading branch information
ocdtrekkie committed Oct 28, 2023
1 parent 1d3ec5e commit 376f501
Show file tree
Hide file tree
Showing 4 changed files with 37 additions and 1 deletion.
3 changes: 3 additions & 0 deletions App.config
Original file line number Diff line number Diff line change
Expand Up @@ -290,6 +290,9 @@
<setting name="Pihole_APIKey" serializeAs="String">
<value />
</setting>
<setting name="Insteon_SumpAlarmAddr" serializeAs="String">
<value />
</setting>
</HAController.My.MySettings>
</userSettings>
<entityFramework>
Expand Down
14 changes: 13 additions & 1 deletion My Project/Settings.Designer.vb

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

3 changes: 3 additions & 0 deletions My Project/Settings.settings
Original file line number Diff line number Diff line change
Expand Up @@ -272,5 +272,8 @@
<Setting Name="Pihole_APIKey" Type="System.String" Scope="User">
<Value Profile="(Default)" />
</Setting>
<Setting Name="Insteon_SumpAlarmAddr" Type="System.String" Scope="User">
<Value Profile="(Default)" />
</Setting>
</Settings>
</SettingsFile>
18 changes: 18 additions & 0 deletions modInsteon.vb
Original file line number Diff line number Diff line change
Expand Up @@ -527,6 +527,8 @@
strTemp = strTemp & InsteonDoorSensorResponse(Command1, Command2)
ElseIf FromAddress = My.Settings.Insteon_SmokeBridgeAddr AndAlso Flags = 203 AndAlso x(ms + 5) = 0 AndAlso x(ms + 6) = 0 Then ' TODO: Detect this by device model
strTemp = strTemp & InsteonSmokeBridgeResponse(x(ms + 7))
ElseIf FromAddress = My.Settings.Insteon_SumpAlarmAddr AndAlso Flags = 203 AndAlso x(ms + 5) = 0 AndAlso x(ms + 6) = 0 Then
strTemp = strTemp & InsteonSumpAlarmResponse(Command1)
Else
strTemp = strTemp & " Command1: " & Hex(Command1) & " (" & modInsteon.InsteonCommandLookup(Command1) & ")" & " Command2: " & Hex(Command2)
End If
Expand Down Expand Up @@ -1970,6 +1972,22 @@
End Select
End Function

Function InsteonSumpAlarmResponse(ByVal ToBit As Byte) As String
Select Case ToBit
Case 17
My.Application.Log.WriteEntry("ALERT: Sump Pump Alarm Triggered!", TraceEventType.Warning)
modSpeech.Say("Sump pump alarm triggered")
modMail.Send("Sump pump alarm triggered", "Sump pump alarm triggered")
Return "Sump Pump Alarm Detected"
Case 19
My.Application.Log.WriteEntry("CANCEL ALERT: Sump Pump No Longer in Alarm State", TraceEventType.Information)
modMail.Send("Sump pump no longer in alarm state", "Sump pump no longer in alarm state")
Return "All Clear Detected"
Case Else
Return "New or Unknown Message Detected"
End Select
End Function

Function InsteonThermostatResponse(ByVal comm1 As Byte, ByVal comm2 As Byte, ByVal FromAddress As String) As String
Select Case comm1
Case 106
Expand Down

0 comments on commit 376f501

Please sign in to comment.