Option Explicit On Error Resume Next Dim Action Dim ActionReceive Dim ReceivedData Dim Status Dim ImagePath Dim intTemp 'Used for storing LoByte when HiByte is set to calculate the Temperature Dim DeurbelDateTime 'Used for storing latest doorbell time to prevent multiple logging within 2 seconds Dim PatioScreenFlag 'Screen down command can only be given once by the task. If manually turned up, it stays up Const HouseCode = 1 Const DeviceName = 2 Const DeviceType = 3 Const DeviceSource = 4 'Only used for FHT devices (Quinta / Avanta) Const DeviceCode = 4 Const SmallGroupCode = 5 Const AlarmGroupCode = 6 Const LargeGroupCode = 7 Const MaxFS20Units = 46 Const MaxFHTUnits = 10 Const MaxAvantaUnits = 4 Const MaxQuintaUnits = 6 ReDim arrFS20Units(7, MaxFS20Units) ReDim arrFHTUnits(4, MaxFHTUnits) ImagePath = "C:\Program Files\Meedio\Meedio HouseBot\Config\Themes\AutoHome\" DeurbelDateTime = Date() & " " & Time() PatioScreenFlag = False Call Set_DeviceArrays() '------------------------------------------------------- '- Main: Checks Received Data and Handles Send Data ---- '------------------------------------------------------- Do Sleep 10 'ActionReceive gets set by a task that triggers on a change in ReceivedData 'This is done to accept duplicates in ReceivedData for being able to get multiple of the same Power State updates ActionReceive = GetPropertyValue("FS20 Status.Action Receive") If ActionReceive = "GetReceivedData" Then SetPropertyValue "FS20 Status.Action Receive", "Waiting" ReceivedData = GetPropertyValue("FS20.Received Hex Data") Call Handle_ReceivedData(ReceivedData) Sleep 200 End If Action = GetPropertyValue("FS20 Status.Action") If Action <> "Waiting" Then If Action <> "" Then Call Handle_SendData(Action) End If SetpropertyValue "FS20 Status.Action", "Waiting" Sleep 100 End If If Status <> "" Then SetPropertyValue "FS20 Status.Status", Status Status = "" End If Loop '------------------------------------------------------- '------------------------------------------------------- '------------------------------------------------------- Sub Handle_ReceivedData(Data) Dim MessageData Dim nit Dim Length 'Total Message Length Dim LengthByte 'Length byte per String in Total Message Dim TrimmedData Dim HexBytes Dim Index Dim EndFlag If Left(Data, 2) = "04" Then 'poor fix for separated data Data = "81 0C " & Data End If EndFlag = False Index = 0 TrimmedData = Replace(Data, " " , "") Length = Len(TrimmedData) / 2 LengthByte = 0 If Length > 4 Then Data = Replace(Data, "FE", "00") HexBytes = Split(Data, " ") While EndFlag = False 'Parse multiple messages from Received Data LengthByte = CLng("&H" & HexBytes(Index + 1)) MessageData = VerifyMessage(Index, LengthByte, HexBytes) If IsArray(MessageData) = True Then Select Case MessageData(1) '(1) = Telegram Type, (2) = Device Type, (3) = Position in array(), (4) = Device/Small/Alarm/LargeGroupCode - ?? - Function, (5) = HouseCode Case "04": Select Case MessageData(2) Case "0101A001": Call Rx_FS20Components(MessageData(4), MessageData(5)) Case "0909A001": Call Rx_FHT80b(MessageData(3), MessageData(4)) Case "0510A001": Call Rx_FS20HGS(MessageData(3), MessageData(4)) Case "83098301": Call Rx_CVReply(MessageData(3), MessageData(4)) End Select Case "C9": 'Algemene data If Left(MessageData(2), 8) = "01028701" Then SetPropertyValue "FS20 Status.Status", "Memory Trouble: " & Hex(Right(MessageData(2), 2)) & " Bytes Free" End If End Select 'SetPropertyValue "FS20 Status.Status", "Valid Data: " & MessageData(1) & " - " & MessageData(2) & " - " & MessageData(3) & " - " & MessageData(4) Index = Index + LengthByte + 2 If Index >= Length Then EndFlag = True End If Else Status = "Invalid Received Data: " & MessageData 'MessageData contains a status here EndFlag = True End If Wend Else If Data <> "81 0C" Then Status = "Invalid Received Data: Wrong Length (Too short)" End If End If End Sub '------------------------------------------------------- '------------------------------------------------------- '------------------------------------------------------- Sub Handle_SendData(Action) Dim Data Dim arrSendData(2) arrSendData(1) = "04" Data = Split(Action, "^") Select Case Data(0) Case "FS20": 'FS20^Tuinkamer Plafondlampen^On arrSendData(2) = Tx_FS20Components(Data(1), Data(2)) Case "MS2": 'MS2^Tuinkamer Vouwgordijn^Up_10 arrSendData(2) = Tx_MS2Components(Data(1), Data(2)) Case "FHT80b": 'FHT80b^Tuinkamer Thermostaat^15 arrSendData(2) = Tx_FHT80bComponents(Data(1), Data(2)) Case "Set Timer": Call Integration_LightTimers(Data(1)) Case "Droog": SetPropertyValue "Now Playing Server PC.Regen Image", ImagePath & "Common\HBR_Button_Transparant.png" SetPropertyValue "FS20 Status.Regen Sensor", "Droog" Call WriteLog("Log Regen Sensor", "Droog") Case "Check Patio Screen": 'Triggered by One Minute Timer Call Integration_PatioScreen() End Select If arrSendData(2) <> "" Then Call SendCommand(arrSendData) End If End Sub '------------------------------------------------------- '- Functions below handle received data ---------------- '------------------------------------------------------- '- Rx FS20 Components ---------------------------------- '------------------------------------------------------- Sub Rx_FS20Components(Data, strHouseCode) Dim nit Dim SwitchAction Select Case Right(Data, 2) Case "00": SwitchAction = "Off" Case "11": SwitchAction = "On" Case "12": SwitchAction = "Toggle" Case "13": SwitchAction = "Bright" Case "14": SwitchAction = "Dim" Case Else If IsNumeric(Right(Data, 2)) Then If CInt(Right(Data, 2)) >= 1 And CInt(Right(Data, 2)) <= 10 Then SwitchAction = "Dim" End If End If End Select For nit = 1 To MaxFS20Units If arrFS20Units(LargeGroupCode, nit) = HexToQuad(Left(Data, 2)) Or arrFS20Units(AlarmGroupCode, nit) = HexToQuad(Left(Data, 2)) Or arrFS20Units(SmallGroupCode, nit) = HexToQuad(Left(Data, 2)) Or arrFS20Units(DeviceCode, nit) = HexToQuad(Left(Data, 2)) Then Select Case arrFS20Units(DeviceName, nit) Case "Deurbel": If strHouseCode = arrFS20Units(HouseCode, nit) Then 'Filter HouseCode because another equal devicecode may exist Call Integration_Doorbell() End If Case "Regen Sensor": Call Integration_RegenSensor() Case "Veranda Zone2 Power": If GetPropertyValue("Alarm Status.Area 1 Armed Status") = "Disarmed" Then Select Case SwitchAction Case "On" : SetPropertyValue "Receiver 2 Status.Action", "Selector_Zone2 FM" Case "Off" : SetPropertyValue "Receiver 2 Status.Action", "Power_Zone2 Off" Case "Dim" : SetPropertyValue "Receiver 2 Status.Action", "Volume_Zone2 Down" Case "Bright": SetPropertyValue "Receiver 2 Status.Action", "Volume_Zone2 Up" End Select End If Case "Veranda Zone2 Preset": If GetPropertyValue("Alarm Status.Area 1 Armed Status") = "Disarmed" Then Select Case SwitchAction Case "On" : SetPropertyValue "Receiver 2 Status.Action", "PresetZone2_Up" Case "Off" : SetPropertyValue "Receiver 2 Status.Action", "PresetZone2_Down" Case "Dim" : SetPropertyValue "Receiver 2 Status.Action", "Volume_Zone2 Down" Case "Bright": SetPropertyValue "Receiver 2 Status.Action", "Volume_Zone2 Up" End Select End If Case "Woonkamer Vouwgordijn", "Tuinkamer Vouwgordijn", "Alle Vouwgordijnen", "Patio Screen": Select Case Mid(Data, 5, 2) Case "00", "14", "38": SwitchAction = "Down" '11 - 13 = Remote (Off or Dim), 38 = PC Action (Down) Case "11", "13", "39": SwitchAction = "Up" '00 - 14 = Remote (On or Bright), 39 = PC Action (Up) End Select SetPropertyValue "FS20 Status." & arrFS20Units(DeviceName, nit), SwitchAction Case "Woonkamer Gashaard": Select Case SwitchAction Case "On" : SetPropertyValue "Verwarming.Gashaard Switch", "Aan" Case "Off" : SetPropertyValue "Verwarming.Gashaard Switch", "Uit" Case "Dim" : SetPropertyValue "Zender.Gashaard Control", "Gashaard Lager" Case "Bright": SetPropertyValue "Zender.Gashaard Control", "Gashaard Hoger" End Select Case "Woonkamer Zone2 Audio": Select Case SwitchAction Case "On" : SetPropertyValue "Receiver Status.Action Room Source", "Zone2_FM" Sleep 1000 SetPropertyValue "Receiver Status.Action", "Preset_0A" Case "Off" : SetPropertyValue "Receiver Status.Action", "Power_Zone2 Off" Case "Dim" : SetPropertyValue "Receiver Status.Action", "Volume_Zone2 Down" Case "Bright": SetPropertyValue "Receiver Status.Action", "Volume_Zone2 Up" End Select Case "Bioscoop Gordijnen": Select Case SwitchAction Case "On" : SetPropertyValue "Zender.Gordijnen Control", "Smart Open Bioscoop" Case "Off" : SetPropertyValue "Zender.Gordijnen Control", "Smart Close Bioscoop" Case "Dim" : SetPropertyValue "Zender.Gordijnen Control", "Stop Bioscoop" Case "Bright": SetPropertyValue "Zender.Gordijnen Control", "Stop Bioscoop" End Select Case "Bioscoop CFSound": Select Case SwitchAction Case "On" : SetPropertyValue "CFSound Status.Action", "Random Play^Start_Achtergrond" Case "Off" : SetPropertyValue "CFSound Status.Action", "Play^Stop And Flush" Case "Dim" : SetPropertyValue "CFSound Status.Action", "Volume^Down_2" Case "Bright": SetPropertyValue "CFSound Status.Action", "Volume^Up_2" End Select Case Else: If strHouseCode = arrFS20Units(HouseCode, nit) Then 'Filter HouseCode because another equal devicecode may exist SetPropertyValue "FS20 Status." & arrFS20Units(DeviceName, nit), SwitchAction End If End Select End If Next End Sub '------------------------------------------------------- '- FHT80b Units ---------------------------------------- '- Data = 0000A631 - Command, xx, Command or 69, Data -- '- 12345678 ------------------------------------- '------------------------------------------------------- Sub Rx_FHT80b(intSettingsPosit, Data) Dim strData Select Case Left(Data, 2) Case "00": If Mid(Data, 5, 2) = "2C" Then 'Status = "FHT80b: SyncTime: " & CLng("&H" & Right(Data, 2)) \ 2 Else If Mid(Data, 6, 1) = "6" Then SetPropertyValue "FS20 Status." & arrFHTUnits(DeviceName, intSettingsPosit) & " Stel", CLng("&H" & Mid(Data, 7, 2)) * 4 \ 10 'Status = "FHT80b: " & arrFHTUnits(DeviceName, intSettingsPosit) & " Instelwaarde Stelaandrijving: " & CLng("&H" & Mid(Data, 7, 2)) * 4 \ 10 End If End If '01 - 08 komt langs door An A (aantal stelkoppen) te veranderen Case "3E": Select Case Right(Data, 2) Case "00": strData = "Auto" Case "01": strData = "Manual" Case "02": strData = "Holiday" End Select SetPropertyValue "FS20 Status." & arrFHTUnits(DeviceName, intSettingsPosit) & " Mode", strData 'Status = "FHT80b: " & arrFHTUnits(DeviceName, intSettingsPosit) & " Mode: " & strData Case "41": Call Compare_CurTemp(intSettingsPosit, CLng("&H" & Right(Data, 2)) * 5) SetPropertyValue "FS20 Status." & arrFHTUnits(DeviceName, intSettingsPosit) & " Set Temp", CLng("&H" & Right(Data, 2)) / 2 SetPropertyValue "FS20 Status." & arrFHTUnits(DeviceName, intSettingsPosit) & " Set State", "On" Call Check_DeviceSource(intSettingsPosit) 'Status = "FHT80b: " & arrFHTUnits(DeviceName, intSettingsPosit) & " Set Temp: " & CLng("&H" & Right(Data, 2)) / 2 Case "42": SetPropertyValue "FS20 Status." & arrFHTUnits(DeviceName, intSettingsPosit) & " Time Stamp", Date() & " " & Time() intTemp = CLng("&H" & Right(Data, 2)) 'Used when HiByte is set If intTemp >= 90 Then '>90 -> 9C, <90 -> 25.5 + 9 = 34.5C SetPropertyValue "FS20 Status." & arrFHTUnits(DeviceName, intSettingsPosit) & " Cur Temp", intTemp / 10 & " C" 'Lo Byte If GetPropertyValue("FS20 Status." & arrFHTUnits(DeviceName, intSettingsPosit) & " Set Temp") * 10 > intTemp Then SetPropertyValue "Verwarming." & arrFHTUnits(DeviceName, intSettingsPosit) & " Image", ImagePath & "Common\Transparent.png" Else SetPropertyValue "Verwarming." & arrFHTUnits(DeviceName, intSettingsPosit) & " Image", ImagePath & "Common\Transparant.png" End If Else SetPropertyValue "FS20 Status." & arrFHTUnits(DeviceName, intSettingsPosit) & " Cur Temp", (255 + intTemp) / 10 & " C" If GetPropertyValue("FS20 Status." & arrFHTUnits(DeviceName, intSettingsPosit) & " Set Temp") * 10 > (255 + intTemp) Then SetPropertyValue "Verwarming." & arrFHTUnits(DeviceName, intSettingsPosit) & " Image", ImagePath & "Common\Transparent.png" Else SetPropertyValue "Verwarming." & arrFHTUnits(DeviceName, intSettingsPosit) & " Image", ImagePath & "Common\Transparant.png" End If End If 'Status = "FHT80b: " & arrFHTUnits(DeviceName, intSettingsPosit) & " Current Temp: " & CLng("&H" & Right(Data, 2)) / 10 Case "43": 'Hi Byte (01) if Lo Byte > FF (255 or 25.5 degrees C) 'If CInt(Right(Data, 2)) > 0 Then ' If GetPropertyValue("FS20 Status." & arrFHTUnits(DeviceName, intSettingsPosit) & " Set Temp") * 10 > (255 + intTemp) Then ' SetPropertyValue "Verwarming." & arrFHTUnits(DeviceName, intSettingsPosit) & " Image", ImagePath & "Common\Transparent.png" ' Else ' SetPropertyValue "Verwarming." & arrFHTUnits(DeviceName, intSettingsPosit) & " Image", ImagePath & "Common\Transparant.png" ' End If ' ' SetPropertyValue "FS20 Status." & arrFHTUnits(DeviceName, intSettingsPosit) & " Cur Temp", (255 + intTemp) / 10 & " C" 'End If Case "44": Select Case Right(Data, 2) Case "00": strData = "OK" Case "01": strData = "Leeg" End Select SetPropertyValue "FS20 Status." & arrFHTUnits(DeviceName, intSettingsPosit) & " Batt Status", strData 'Status = "FHT80b: " & arrFHTUnits(DeviceName, intSettingsPosit) & " Batterij: " & strData Case Else: Status = "FHT80b: " & arrFHTUnits(DeviceName, intSettingsPosit) & " - " & Data End Select End Sub '------------------------------------------------------- '- FS20HGS Units -------------------------------------- '------------------------------------------------------- Sub Rx_FS20HGS(intSettingsPosit, Data) Status = "FS20HGS: " & Data End Sub '------------------------------------------------------- '- Handle Data replied on CV settings ------------------ '------------------------------------------------------- Sub Rx_CVReply(intSettingsPosit, Data) 'CV = Centrale Verwarming Dim strData Select Case Left(Data, 2) Case "3E": Select Case Mid(Data, 3, 2) Case "00": strData = "Auto" Case "01": strData = "Manual" Case "02": strData = "Holiday" End Select SetPropertyValue "FS20 Status." & arrFHTUnits(DeviceName, intSettingsPosit) & " Mode", strData Case "41": Call Compare_CurTemp(intSettingsPosit, CLng("&H" & Mid(Data, 3, 2)) * 5) SetPropertyValue "FS20 Status." & arrFHTUnits(DeviceName, intSettingsPosit) & " Set Temp", CLng("&H" & Mid(Data, 3, 2)) / 2 SetPropertyValue "FS20 Status." & arrFHTUnits(DeviceName, intSettingsPosit) & " Set State", "On" Call Check_DeviceSource(intSettingsPosit) Case Else: Status = "CV Reply: " & Data End Select End Sub '------------------------------------------------------- '- Tx FS20 Components ----------------------------------- '------------------------------------------------------- Function Tx_FS20Components(strDeviceName, strSwitchCommand) Dim nit Dim SwitchAction Dim strSendData Select Case strSwitchCommand Case "Off" : SwitchAction = "00" Case "On" : SwitchAction = "11" Case "Toggle": SwitchAction = "12" Case "Bright": SwitchAction = "13" Case "Dim" : SwitchAction = "14" Case Else If IsNumeric(strSwitchCommand) Then If CInt(strSwitchCommand) >= 1 And CInt(strSwitchCommand) <= 16 Then 'Dim Value 1 - 10 SwitchAction = L_Pad(Hex(strSwitchCommand), 2, "0") End If End If End Select For nit = 1 To MaxFS20Units If strDeviceName = arrFS20Units(DeviceName, nit) Then If strDeviceName = "Media PC" Then If GetPropertyValue("Meedio Control.PC 1 Media Indicator") <> "Off" Then Exit For End If End If strSendData = "020101" & arrFS20Units(HouseCode, nit) & QuadToHex(arrFS20Units(DeviceCode, nit)) & SwitchAction Exit For End If Next Tx_FS20Components = strSendData End Function '------------------------------------------------------- '- Tx MS2 Components (Markiezen) ----------------------- '------------------------------------------------------- Function Tx_MS2Components(strDeviceName, strCommand) Dim nit Dim SwitchAction Dim strSendData Dim strSwitchCommand Dim strTime strSwitchCommand = Split(strCommand, "_") Select Case strSwitchCommand(0) Case "Down": SwitchAction = "38" Case "Up" : SwitchAction = "39" End Select Select Case strSwitchCommand(1) Case "1" : strTime = "04" Case "2" : strTime = "08" Case "3" : strTime = "0C" Case "4" : strTime = "18" Case "5" : strTime = "1A" Case "6" : strTime = "1C" Case "7" : strTime = "1E" Case "8" : strTime = "28" Case "9" : strTime = "29" Case "10": strTime = "2A" Case "11": strTime = "2B" Case "12": strTime = "2C" Case "13": strTime = "2D" Case "14": strTime = "2E" Case "15": strTime = "2F" Case "30": strTime = "3F" End Select For nit = 1 To MaxFS20Units If strDeviceName = arrFS20Units(DeviceName, nit) Then If strSwitchCommand(0) = "Stop" Then 'Stop using the correct direction (+ 1 second) Select Case GetPropertyValue("FS20 Status." & arrFS20Units(DeviceName, nit)) Case "Down": SwitchAction = "38" Case "Up" : SwitchAction = "39" End Select End If strSendData = "020101" & arrFS20Units(HouseCode, nit) & QuadToHex(arrFS20Units(DeviceCode, nit)) & SwitchAction & strTime Exit For End If Next Tx_MS2Components = strSendData End Function '------------------------------------------------------- '- Tx FHT80b Components -------------------------------- '------------------------------------------------------- Function Tx_FHT80bComponents(strDeviceName, strCommand) Dim nit Dim SwitchAction Dim strSendData Dim intTemp Dim Data Dim SetState Dim SetTemp Tx_FHT80bComponents = "" SetState = "" For nit = 1 To MaxFHTUnits If strDeviceName = arrFHTUnits(DeviceName, nit) Then SetTemp = GetPropertyValue("FS20 Status." & arrFHTUnits(DeviceName, nit) & " Set Temp") If IsNumeric(SetTemp) = False Then SetTemp = 150 Else SetTemp = SetTemp * 10 End If Exit For End If Next Select Case strCommand Case "Init" : Data = "65ff66ff" Case "Mode Auto" : Data = "3E00" Case "Mode Manual" : Data = "3E01" Case "Mode Holiday": Data = "3E02" Case "Set Up": SetTemp = SetTemp + 5 If SetTemp > 305 Then SetTemp = 305 End If Call Compare_CurTemp(nit, SetTemp) SetPropertyValue "FS20 Status." & arrFHTUnits(DeviceName, nit) & " Set Temp", SetTemp / 10 SetPropertyValue "FS20 Status." & arrFHTUnits(DeviceName, nit) & " Set State", "Off" Exit Function Case "Set Down": SetTemp = SetTemp - 5 If SetTemp < 55 Then SetTemp = 55 End If Call Compare_CurTemp(nit, SetTemp) SetPropertyValue "FS20 Status." & arrFHTUnits(DeviceName, nit) & " Set Temp", SetTemp / 10 SetPropertyValue "FS20 Status." & arrFHTUnits(DeviceName, nit) & " Set State", "Off" Exit Function Case "Activate": intTemp = SetTemp * 2 / 10 Data = "41" & L_Pad(Hex(intTemp), 2, "0") SetState = "Off" Case Else If IsNumeric(strCommand) Then SetTemp = CInt(strCommand) intTemp = SetTemp * 2 / 10 Data = "41" & L_Pad(Hex(intTemp), 2, "0") SetState = "Off" End If End Select For nit = 1 To MaxFHTUnits If strDeviceName = arrFHTUnits(DeviceName, nit) Then strSendData = "020183" & arrFHTUnits(HouseCode, nit) & Data If SetState = "Off" Then SetPropertyValue "FS20 Status." & arrFHTUnits(DeviceName, nit) & " Set State", SetState SetPropertyValue "FS20 Status." & arrFHTUnits(DeviceName, nit) & " Set Temp", SetTemp / 10 End If Call Compare_CurTemp(nit, SetTemp) Call Check_DeviceSource(nit) Exit For End If Next Tx_FHT80bComponents = strSendData End Function '------------------------------------------------------- '------------------------------------------------------- '------------------------------------------------------- Function VerifyMessage(Index, LengthByte, HexBytes) Dim nit Dim CommandData(5) Dim strHouseCode Dim strDeviceCode Dim strComponentType Dim CheckSum Dim Message Message = "" If UBound(HexBytes) >= Index + LengthByte + 1 Then For nit = 0 To LengthByte + 1 Message = Message & HexBytes(Index + nit) Next If HexBytes(Index) = "81" Then For nit = 4 To LengthByte + 1 CheckSum = CheckSum + CInt("&H" & HexBytes(Index + nit)) Next If Right(Hex(Checksum), 2) = HexBytes(Index + 3) Then Select Case HexBytes(Index + 2) Case "04": 'Telegram Type strComponentType = HexBytes(Index + 4) & HexBytes(Index + 5) & HexBytes(Index + 6) & HexBytes(Index + 7) strHouseCode = L_Pad(HexBytes(Index + 8), 2, "0") & L_Pad(HexBytes(Index + 9), 2, "0") strDeviceCode = HexBytes(Index + 10) Select Case strComponentType Case "0101A001": 'FS20Components For nit = 1 To MaxFS20Units If (strHouseCode <> "0000" And strHouseCode = Left(arrFS20Units(HouseCode, nit), 2) & Right(arrFS20Units(HouseCode, nit), 2)) Or (strHouseCode = "0000" And (strDeviceCode = QuadToHex(arrFS20Units(DeviceCode, nit)) Or strDeviceCode = QuadToHex(arrFS20Units(SmallGroupCode, nit)) Or strDeviceCode = QuadToHex(arrFS20Units(LargeGroupCode, nit)))) Then CommandData(1) = HexBytes(Index + 2) 'Telegram Type CommandData(2) = strComponentType CommandData(3) = nit 'Position in arrFS20Units CommandData(4) = Right(Message, Len(Message) - 20) CommandData(5) = strHouseCode VerifyMessage = CommandData Exit For End If Next Case "0909A001", "83098301": 'FHT80b, CVReply For nit = 1 To MaxFHTUnits If (strHouseCode <> "0000" And strHouseCode = Left(arrFHTUnits(HouseCode, nit), 2) & Right(arrFHTUnits(HouseCode, nit), 2)) Then CommandData(1) = HexBytes(Index + 2) 'Telegram Type CommandData(2) = strComponentType CommandData(3) = nit 'Position in arrFHTUnits CommandData(4) = Right(Message, Len(Message) - 20) CommandData(5) = strHouseCode VerifyMessage = CommandData Exit For End If Next Case "0510A001": 'FS20HGS End Select If IsArray(VerifyMessage) = False Then VerifyMessage = "Unrecognised HouseCode (" & L_Pad(HexBytes(Index + 8), 2, "0") & L_Pad(HexBytes(Index + 9), 2, "0") & ") or DeviceCode (" & HexToQuad(strDeviceCode) &")" & " - " & Message End If Case "C9": CommandData(1) = HexBytes(Index + 2) CommandData(2) = Right(Message, Len(Message) - 4) 'Rest of Message (Data, HouseCode etc) CommandData(3) = "" CommandData(4) = "" VerifyMessage = CommandData End Select Else VerifyMessage = "Wrong Checksum " & HexBytes(Index + 3) End If Else VerifyMessage = "Wrong Startbyte " & HexBytes(Index) End If Else VerifyMessage = "Index out of range! LengthByte: " & Index + LengthByte + 1 & " HexBytes: " & UBound(HexBytes) End If End Function '------------------------------------------------------- '- Data(1) = Telegram Type ----------------------------- '- Data(2) = Device Type + HouseCode + Function + Data - '------------------------------------------------------- Sub SendCommand(Data) Dim nit Dim CheckSum Dim Length CheckSum = 0 Length = CInt(Len(Data(2))) / 2 + 2 If Length < 16 Then Length = "0" + Hex(Length) Else Length = Hex(Length) End If For nit = 1 To Len(Data(2)) Step 2 CheckSum = CheckSum + CInt("&H" & Mid(Data(2), nit, 2)) Next SetPropertyValue "FS20.Send Data", "81" & Length & Data(1) & L_Pad(Right(Hex(CheckSum), 2), 2, "0") & Data(2) End Sub '------------------------------------------------------- '- Data is a 2-posit HEX number as string -------------- '------------------------------------------------------- Function HexToQuad(Data) Dim nin Dim nit nin = CInt("&H" & Data) nit = 3 Do While nit >= 0 HexToQuad = HexToQuad & CStr((nin \ 4^nit)) nin = nin Mod 4^nit nit = nit - 1 Loop HexToQuad = CStr(HexToQuad + 1111) End Function '------------------------------------------------------- '- Data is a 4 digit FS20 number ----------------------- '------------------------------------------------------- Function QuadToHex(Data) Dim nin Dim nit nin = StrReverse(10 * Data + 88891) 'To keep leading 0's nit = 2 Do While nit < 6 QuadToHex = QuadToHex + Mid(nin, nit, 1) * 4^(nit - 2) nit = nit + 1 Loop If QuadToHex < 16 Then QuadToHex = CStr("0" & Hex(QuadToHex)) Else QuadToHex = CStr(Hex(QuadToHex)) End If End Function '------------------------------------------------------- '- Commonly used Functions ----------------------------- '------------------------------------------------------- '- Format Data (Volume etc) to include leading 0's ----- '------------------------------------------------------- Function L_Pad(Data, Length, Char) L_Pad = String(Length - Len(Data), Char) & Data End Function '------------------------------------------------------- '- Write a Logline ------------------------------------- '------------------------------------------------------- Sub WriteLog(strLogType, strLogData) Dim nit Dim strLog Dim LogLines Dim LogCount strLog = GetPropertyValue("FS20 Status." & strLogType) If strLog = "Geen items aanwezig" Then strLog = "" End If LogLines = Split(strLog, vbLF) LogCount = UBound(LogLines) strLog = "*S-" & vbTAB & GetPropertyValue("System Time.TimeAndDate") & " - " & strLogData If LogCount > 50 Then LogCount = 50 End If For nit = 0 to LogCount LogLines(nit) = Replace(LogLines(nit), "*S-", "") strLog = strLog & vbLF & LogLines(nit) Next SetPropertyValue "FS20 Status." & strLogType, strLog End Sub '------------------------------------------------------- '- Specific FS20 Integrated Functions ------------------ '------------------------------------------------------- '- Handle Doorbell ------------------------------------- '------------------------------------------------------- Sub Integration_Doorbell() Dim DeurbelCount If DateDiff("s", DeurbelDateTime, Now) > 3 Then 'Prevent multiple logging within 3 seconds of first ring DeurbelDateTime = Date() & " " & Time() DeurbelCount = GetPropertyValue("FS20 Status.Deurbel Count") DeurbelCount = DeurbelCount + 1 SetPropertyValue "FS20 Status.Deurbel Count", DeurbelCount SetPropertyValue "Deurbel.Action", "Handle Doorbell" End If End Sub '------------------------------------------------------- '- Handle Regen Sensor --------------------------------- '------------------------------------------------------- Sub Integration_RegenSensor() SetPropertyValue "Regen Timer.Running", "Yes" SetPropertyValue "Regen Timer.Sleep Time", "Minutes=2" If GetPropertyValue("FS20 Status.Regen Sensor") <> "Nat" Then SetPropertyValue "Now Playing Server PC.Regen Image", ImagePath & "Now Playing\Regen.png" SetPropertyValue "FS20 Status.Regen Sensor", "Nat" Call WriteLog("Log Regen Sensor", "Nat") End If End Sub '------------------------------------------------------- '- Handle Light Timers --------------------------------- '------------------------------------------------------- Sub Integration_LightTimers(Room) Select Case Room Case "Bijkeuken" : SetPropertyValue "Bijkeuken Timer.Sleep Time", "Minutes=" & GetPropertyValue("FS20 Status.Bijkeuken Timer") Case "Keuken" : SetPropertyValue "Keuken Timer.Sleep Time", "Minutes=" & GetPropertyValue("FS20 Status.Keuken Timer") Case "Eetkamer" : SetPropertyValue "Eetkamer Timer.Sleep Time", "Minutes=" & GetPropertyValue("FS20 Status.Eetkamer Timer") Case "Hal" : SetPropertyValue "Hal Timer.Sleep Time", "Minutes=" & GetPropertyValue("FS20 Status.Hal Timer") Case "Speelkamer": SetPropertyValue "Speelkamer Timer.Sleep Time", "Minutes=" & GetPropertyValue("FS20 Status.Speelkamer Timer") Case "Kantoor" : SetPropertyValue "Kantoor Timer.Sleep Time", "Minutes=" & GetPropertyValue("FS20 Status.Kantoor Timer") Case "Boekengang": SetPropertyValue "Boekengang Timer.Sleep Time", "Minutes=" & GetPropertyValue("FS20 Status.Boekengang Timer") Case "Tuinkamer" : SetPropertyValue "Tuinkamer Timer.Sleep Time", "Minutes=" & GetPropertyValue("FS20 Status.Tuinkamer Timer") Case "Woonkamer" : SetPropertyValue "Woonkamer Timer.Sleep Time", "Minutes=" & GetPropertyValue("FS20 Status.Woonkamer Timer") Case "Bioscoop" : SetPropertyValue "Bioscoop Timer.Sleep Time", "Minutes=" & GetPropertyValue("FS20 Status.Bioscoop Timer") Case "Garage" : SetPropertyValue "Garage Timer.Sleep Time", "Minutes=" & GetPropertyValue("FS20 Status.Garage Timer") End Select End Sub '------------------------------------------------------- '- Handle Patio Screen --------------------------------- '------------------------------------------------------- Sub Integration_PatioScreen() If GetPropertyValue("FS20 Status.Patio Screen Mode") = "On" Then If GetPropertyValue("FS20 Status.Patio Screen") = "Up" Then If Time() > "11:45" And Time() < "16:00" Then If GetPropertyValue("FS20 Status.Regen Sensor") = "Droog" And PatioScreenFlag = False Then If CInt(GetPropertyValue("Verwarming.Buiten Temp")) >= 24 And CInt(GetPropertyValue("Verwarming.Woonkamer Temp")) >= 20 Then ExecuteTask("Patio Screen Down") PatioScreenFlag = True End If End If End If Else If Hour(Now) = 17 And Minute(Now) = 1 Then ExecuteTask("Patio Screen Up") End If End If End If If Hour(Now) = 17 And Minute(Now) = 1 Then PatioScreenFlag = False 'Reset Flag for the next day End If End Sub '------------------------------------------------------- '- Comapare Cur Temp with Set Temp and set correct image '------------------------------------------------------- Sub Compare_CurTemp(intArrayPos, lngSetTemp) If Replace(GetPropertyValue("FS20 Status." & arrFHTUnits(DeviceName, intArrayPos) & " Cur Temp"), " C", "") * 10 < lngSetTemp Then SetPropertyValue "Verwarming." & arrFHTUnits(DeviceName, intArrayPos) & " Image", ImagePath & "Common\Transparent.png" Else SetPropertyValue "Verwarming." & arrFHTUnits(DeviceName, intArrayPos) & " Image", ImagePath & "Common\Transparant.png" End If End Sub '------------------------------------------------------- '- Check difference between CurTemp and SetTemp and switch applicable Source (Quinta or Avanta) On '------------------------------------------------------- Sub Check_DeviceSource(intArrayPos) Dim nit Dim AvantaCount Dim QuintaCount If GetPropertyValue("Alarm Status.Area 1 Armed Status") = "Disarmed" Then Sleep 500 'make sure that the Set Temp property has its value to prevent switching the source when resetting to 15 If GetPropertyValue("FS20 Status." & arrFHTUnits(DeviceName, intArrayPos) & " Set Temp") * 10 >= 170 Or _ (Replace(GetPropertyValue("FS20 Status." & arrFHTUnits(DeviceName, intArrayPos) & " Cur Temp"), " C", "") * 10) + 5 < GetPropertyValue("FS20 Status." & arrFHTUnits(DeviceName, intArrayPos) & " Set Temp") * 10 Then If GetPropertyValue("verwarming." & arrFHTUnits(DeviceSource, intArrayPos) & " Switch") <> "Aan" Then SetPropertyValue "Verwarming." & arrFHTUnits(DeviceSource, intArrayPos) & " Switch", "Aan" End If End If AvantaCount = 0 QuintaCount = 0 For nit = 1 To MaxFHTUnits Select Case arrFHTUnits(DeviceSource, nit) Case "Avanta": If GetPropertyValue("FS20 Status." & arrFHTUnits(DeviceName, nit) & " Set Temp") = "15" Then AvantaCount = AvantaCount + 1 End If Case "Quinta": If GetPropertyValue("FS20 Status." & arrFHTUnits(DeviceName, nit) & " Set Temp") = "15" Then QuintaCount = QuintaCount + 1 End If End Select Next If AvantaCount = MaxAvantaUnits Then 'All Rooms heated by Avanta are set @ 15C -> Switch Off Avanta SetPropertyValue "Verwarming.Avanta Switch", "Uit" End If If QuintaCount = MaxQuintaUnits Then 'All Rooms heated by Quinta are set @ 15C -> Switch Off Quinta SetPropertyValue "Verwarming.Quinta Switch", "Uit" End If End If End Sub '------------------------------------------------------- 'Set Device arrays ------------------------------------- '------------------------------------------------------- Sub Set_DeviceArrays() '-- FHT Units arrFHTUnits(HouseCode, 1) = "0812" '"0818" arrFHTUnits(DeviceName, 1) = "Logeer Thermostaat" arrFHTUnits(DeviceSource, 1) = "Avanta" arrFHTUnits(DeviceType, 1) = "FHT80b" arrFHTUnits(HouseCode, 2) = "4809" '"7209" arrFHTUnits(DeviceName, 2) = "Imke Thermostaat" arrFHTUnits(DeviceSource, 2) = "Avanta" arrFHTUnits(DeviceType, 2) = "FHT80b" arrFHTUnits(HouseCode, 3) = "4015" '"6421" arrFHTUnits(DeviceName, 3) = "Matthijs Thermostaat" arrFHTUnits(DeviceSource, 3) = "Avanta" arrFHTUnits(DeviceType, 3) = "FHT80b" arrFHTUnits(HouseCode, 4) = "393C" '"5760" arrFHTUnits(DeviceName, 4) = "Ouder Thermostaat" arrFHTUnits(DeviceSource, 4) = "Quinta" arrFHTUnits(DeviceType, 4) = "FHT80b" arrFHTUnits(HouseCode, 5) = "3422" '"5234" arrFHTUnits(DeviceName, 5) = "Keuken Thermostaat" arrFHTUnits(DeviceSource, 5) = "Avanta" arrFHTUnits(DeviceType, 5) = "FHT80b" arrFHTUnits(HouseCode, 6) = "332B" '"5143" arrFHTUnits(DeviceName, 6) = "Speelkamer Thermostaat" arrFHTUnits(DeviceSource, 6) = "Quinta" arrFHTUnits(DeviceType, 6) = "FHT80b" arrFHTUnits(HouseCode, 7) = "4160" '"6596" arrFHTUnits(DeviceName, 7) = "Kantoor Thermostaat" arrFHTUnits(DeviceSource, 7) = "Quinta" arrFHTUnits(DeviceType, 7) = "FHT80b" arrFHTUnits(HouseCode, 8) = "3D47" '"6171" arrFHTUnits(DeviceName, 8) = "Woonkamer Thermostaat" arrFHTUnits(DeviceSource, 8) = "Quinta" arrFHTUnits(DeviceType, 8) = "FHT80b" arrFHTUnits(HouseCode, 9) = "4B51" '"7581" arrFHTUnits(DeviceName, 9) = "Tuinkamer Thermostaat" arrFHTUnits(DeviceSource, 9) = "Quinta" arrFHTUnits(DeviceType, 9) = "FHT80b" arrFHTUnits(HouseCode, 10) = "291E" '"4130" arrFHTUnits(DeviceName, 10) = "Bioscoop Thermostaat" arrFHTUnits(DeviceSource, 10) = "Quinta" arrFHTUnits(DeviceType, 10) = "FHT80b" '-- FS20 Units arrFS20Units(HouseCode, 1) = "0000" '11111111 arrFS20Units(DeviceCode, 1) = "2211" arrFS20Units(SmallGroupCode, 1) = "0000" arrFS20Units(AlarmGroupCode, 1) = "4411" arrFS20Units(LargeGroupCode, 1) = "4444" arrFS20Units(DeviceName, 1) = "Kantoor Plafondlampen" arrFS20Units(DeviceType, 1) = "FS20" arrFS20Units(HouseCode, 2) = "0000" arrFS20Units(DeviceCode, 2) = "1311" arrFS20Units(SmallGroupCode, 2) = "0000" arrFS20Units(AlarmGroupCode, 2) = "0000" arrFS20Units(LargeGroupCode, 2) = "4444" arrFS20Units(DeviceName, 2) = "Bijkeuken Plafondlamp" arrFS20Units(DeviceType, 2) = "FS20" arrFS20Units(HouseCode, 3) = "0000" arrFS20Units(DeviceCode, 3) = "3211" arrFS20Units(SmallGroupCode, 3) = "3244" arrFS20Units(AlarmGroupCode, 3) = "4411" arrFS20Units(LargeGroupCode, 3) = "4444" arrFS20Units(DeviceName, 3) = "Woonkamer Muurlampen" arrFS20Units(DeviceType, 3) = "FS20" arrFS20Units(HouseCode, 4) = "0000" arrFS20Units(DeviceCode, 4) = "2311" arrFS20Units(SmallGroupCode, 4) = "0000" arrFS20Units(AlarmGroupCode, 4) = "4411" arrFS20Units(LargeGroupCode, 4) = "4444" arrFS20Units(DeviceName, 4) = "Boekengang Plafondlampen" arrFS20Units(DeviceType, 4) = "FS20" arrFS20Units(HouseCode, 5) = "0000" arrFS20Units(DeviceCode, 5) = "3111" arrFS20Units(SmallGroupCode, 5) = "3144" arrFS20Units(AlarmGroupCode, 5) = "4411" arrFS20Units(LargeGroupCode, 5) = "4444" arrFS20Units(DeviceName, 5) = "Tuinkamer Plafondlampen" arrFS20Units(DeviceType, 5) = "FS20" arrFS20Units(HouseCode, 6) = "0000" arrFS20Units(DeviceCode, 6) = "2111" arrFS20Units(SmallGroupCode, 6) = "0000" arrFS20Units(AlarmGroupCode, 6) = "4411" arrFS20Units(LargeGroupCode, 6) = "4444" arrFS20Units(DeviceName, 6) = "Speelkamer Plafondlampen" arrFS20Units(DeviceType, 6) = "FS20" arrFS20Units(HouseCode, 7) = "0000" arrFS20Units(DeviceCode, 7) = "3231" arrFS20Units(SmallGroupCode, 7) = "0000" arrFS20Units(AlarmGroupCode, 7) = "4411" arrFS20Units(LargeGroupCode, 7) = "4444" arrFS20Units(DeviceName, 7) = "Patio Muurlampen" arrFS20Units(DeviceType, 7) = "FS20" arrFS20Units(HouseCode, 8) = "0000" arrFS20Units(DeviceCode, 8) = "1111" arrFS20Units(SmallGroupCode, 8) = "0000" arrFS20Units(AlarmGroupCode, 8) = "0000" arrFS20Units(LargeGroupCode, 8) = "4444" arrFS20Units(DeviceName, 8) = "Hal Plafondlampen" arrFS20Units(DeviceType, 8) = "FS20" arrFS20Units(HouseCode, 9) = "0000" arrFS20Units(DeviceCode, 9) = "1112" arrFS20Units(SmallGroupCode, 9) = "0000" arrFS20Units(AlarmGroupCode, 9) = "4411" arrFS20Units(LargeGroupCode, 9) = "4444" arrFS20Units(DeviceName, 9) = "Hal Muurlampen" arrFS20Units(DeviceType, 9) = "FS20" arrFS20Units(HouseCode, 10) = "0000" arrFS20Units(DeviceCode, 10) = "2221" arrFS20Units(SmallGroupCode, 10) = "0000" arrFS20Units(AlarmGroupCode, 10) = "0000" arrFS20Units(LargeGroupCode, 10) = "0000" arrFS20Units(DeviceName, 10) = "Media PC" arrFS20Units(DeviceType, 10) = "FS20" arrFS20Units(HouseCode, 11) = "48E3" '21314314 - Oude is 4169 -> 21122332 arrFS20Units(DeviceCode, 11) = "1111" arrFS20Units(SmallGroupCode, 11) = "0000" arrFS20Units(AlarmGroupCode, 11) = "0000" arrFS20Units(LargeGroupCode, 11) = "0000" arrFS20Units(DeviceName, 11) = "Deurbel" arrFS20Units(DeviceType, 11) = "FS20" arrFS20Units(HouseCode, 12) = "0000" arrFS20Units(DeviceCode, 12) = "4444" arrFS20Units(SmallGroupCode, 12) = "0000" arrFS20Units(AlarmGroupCode, 12) = "0000" arrFS20Units(LargeGroupCode, 12) = "4444" arrFS20Units(DeviceName, 12) = "All Lights" arrFS20Units(DeviceType, 12) = "FS20" arrFS20Units(HouseCode, 13) = "0000" arrFS20Units(DeviceCode, 13) = "3141" arrFS20Units(SmallGroupCode, 13) = "3444" arrFS20Units(AlarmGroupCode, 13) = "0000" arrFS20Units(LargeGroupCode, 13) = "0000" arrFS20Units(DeviceName, 13) = "Tuinkamer Vouwgordijn" arrFS20Units(DeviceType, 13) = "MS2" arrFS20Units(HouseCode, 14) = "0000" arrFS20Units(DeviceCode, 14) = "3241" arrFS20Units(SmallGroupCode, 14) = "3444" arrFS20Units(AlarmGroupCode, 14) = "0000" arrFS20Units(LargeGroupCode, 14) = "0000" arrFS20Units(DeviceName, 14) = "Woonkamer Vouwgordijn" arrFS20Units(DeviceType, 14) = "MS2" arrFS20Units(HouseCode, 15) = "0000" arrFS20Units(DeviceCode, 15) = "3444" arrFS20Units(SmallGroupCode, 15) = "3444" arrFS20Units(AlarmGroupCode, 15) = "0000" arrFS20Units(LargeGroupCode, 15) = "0000" arrFS20Units(DeviceName, 15) = "Alle Vouwgordijnen" arrFS20Units(DeviceType, 15) = "MS2" arrFS20Units(HouseCode, 16) = "0000" arrFS20Units(DeviceCode, 16) = "1214" arrFS20Units(SmallGroupCode, 16) = "1244" arrFS20Units(AlarmGroupCode, 16) = "4411" arrFS20Units(LargeGroupCode, 16) = "4444" arrFS20Units(DeviceName, 16) = "Keuken Plafondlamp" arrFS20Units(DeviceType, 16) = "FS20" arrFS20Units(HouseCode, 17) = "0000" arrFS20Units(DeviceCode, 17) = "3121" arrFS20Units(SmallGroupCode, 17) = "3144" arrFS20Units(AlarmGroupCode, 17) = "4411" arrFS20Units(LargeGroupCode, 17) = "4444" arrFS20Units(DeviceName, 17) = "Tuinkamer Vloerlamp" arrFS20Units(DeviceType, 17) = "FS20" arrFS20Units(HouseCode, 18) = "0000" arrFS20Units(DeviceCode, 18) = "4411" arrFS20Units(SmallGroupCode, 18) = "0000" arrFS20Units(AlarmGroupCode, 18) = "4411" arrFS20Units(LargeGroupCode, 18) = "0000" arrFS20Units(DeviceName, 18) = "Alarm Lights" arrFS20Units(DeviceType, 18) = "FS20" arrFS20Units(HouseCode, 19) = "0000" arrFS20Units(DeviceCode, 19) = "3411" arrFS20Units(SmallGroupCode, 19) = "0000" arrFS20Units(AlarmGroupCode, 19) = "0000" arrFS20Units(LargeGroupCode, 19) = "0000" arrFS20Units(DeviceName, 19) = "Regen Sensor" arrFS20Units(DeviceType, 19) = "FS20" arrFS20Units(HouseCode, 20) = "0000" arrFS20Units(DeviceCode, 20) = "4111" arrFS20Units(SmallGroupCode, 20) = "4144" arrFS20Units(AlarmGroupCode, 20) = "4411" arrFS20Units(LargeGroupCode, 20) = "4444" arrFS20Units(DeviceName, 20) = "Bioscoop Bies" arrFS20Units(DeviceType, 20) = "FS20" arrFS20Units(HouseCode, 21) = "0000" arrFS20Units(DeviceCode, 21) = "4112" arrFS20Units(SmallGroupCode, 21) = "4144" arrFS20Units(AlarmGroupCode, 21) = "4411" arrFS20Units(LargeGroupCode, 21) = "4444" arrFS20Units(DeviceName, 21) = "Bioscoop Podium" arrFS20Units(DeviceType, 21) = "FS20" arrFS20Units(HouseCode, 22) = "0000" arrFS20Units(DeviceCode, 22) = "4113" arrFS20Units(SmallGroupCode, 22) = "4144" arrFS20Units(AlarmGroupCode, 22) = "4411" arrFS20Units(LargeGroupCode, 22) = "4444" arrFS20Units(DeviceName, 22) = "Bioscoop Vloerlampen" arrFS20Units(DeviceType, 22) = "FS20" arrFS20Units(HouseCode, 23) = "0000" arrFS20Units(DeviceCode, 23) = "4114" arrFS20Units(SmallGroupCode, 23) = "4144" arrFS20Units(AlarmGroupCode, 23) = "4411" arrFS20Units(LargeGroupCode, 23) = "4444" arrFS20Units(DeviceName, 23) = "Bioscoop Muurlampen" arrFS20Units(DeviceType, 23) = "FS20" arrFS20Units(HouseCode, 24) = "0000" arrFS20Units(DeviceCode, 24) = "3114" arrFS20Units(SmallGroupCode, 24) = "3144" arrFS20Units(AlarmGroupCode, 24) = "4411" arrFS20Units(LargeGroupCode, 24) = "4444" arrFS20Units(DeviceName, 24) = "Tuinkamer TVlamp" arrFS20Units(DeviceType, 24) = "FS20" arrFS20Units(HouseCode, 25) = "0000" arrFS20Units(DeviceCode, 25) = "3233" arrFS20Units(SmallGroupCode, 25) = "0000" arrFS20Units(AlarmGroupCode, 25) = "0000" arrFS20Units(LargeGroupCode, 25) = "0000" arrFS20Units(DeviceName, 25) = "Woonkamer Gashaard" arrFS20Units(DeviceType, 25) = "FS20" arrFS20Units(HouseCode, 26) = "0000" arrFS20Units(DeviceCode, 26) = "3234" arrFS20Units(SmallGroupCode, 26) = "0000" arrFS20Units(AlarmGroupCode, 26) = "0000" arrFS20Units(LargeGroupCode, 26) = "0000" arrFS20Units(DeviceName, 26) = "Woonkamer Zone2 Audio" arrFS20Units(DeviceType, 26) = "FS20" arrFS20Units(HouseCode, 27) = "0000" arrFS20Units(DeviceCode, 27) = "4144" arrFS20Units(SmallGroupCode, 27) = "4144" arrFS20Units(AlarmGroupCode, 27) = "0000" arrFS20Units(LargeGroupCode, 27) = "0000" arrFS20Units(DeviceName, 27) = "All Cinema Lights" arrFS20Units(DeviceType, 27) = "FS20" arrFS20Units(HouseCode, 28) = "0000" arrFS20Units(DeviceCode, 28) = "1211" arrFS20Units(SmallGroupCode, 28) = "1244" arrFS20Units(AlarmGroupCode, 28) = "4411" arrFS20Units(LargeGroupCode, 28) = "4444" arrFS20Units(DeviceName, 28) = "Keuken Eettafellamp" arrFS20Units(DeviceType, 28) = "FS20" arrFS20Units(HouseCode, 29) = "0000" arrFS20Units(DeviceCode, 29) = "1244" arrFS20Units(SmallGroupCode, 29) = "1244" arrFS20Units(AlarmGroupCode, 29) = "0000" arrFS20Units(LargeGroupCode, 29) = "0000" arrFS20Units(DeviceName, 29) = "All Keuken Lights" arrFS20Units(DeviceType, 29) = "FS20" arrFS20Units(HouseCode, 30) = "0000" arrFS20Units(DeviceCode, 30) = "3213" arrFS20Units(SmallGroupCode, 30) = "3244" arrFS20Units(AlarmGroupCode, 30) = "4411" arrFS20Units(LargeGroupCode, 30) = "4444" arrFS20Units(DeviceName, 30) = "Woonkamer Eettafellampen" arrFS20Units(DeviceType, 30) = "FS20" arrFS20Units(HouseCode, 31) = "0000" arrFS20Units(DeviceCode, 31) = "3244" arrFS20Units(SmallGroupCode, 31) = "3244" arrFS20Units(AlarmGroupCode, 31) = "0000" arrFS20Units(LargeGroupCode, 31) = "0000" arrFS20Units(DeviceName, 31) = "All Woonkamer Lights" arrFS20Units(DeviceType, 31) = "FS20" arrFS20Units(HouseCode, 32) = "0000" arrFS20Units(DeviceCode, 32) = "3144" arrFS20Units(SmallGroupCode, 32) = "3144" arrFS20Units(AlarmGroupCode, 32) = "0000" arrFS20Units(LargeGroupCode, 32) = "0000" arrFS20Units(DeviceName, 32) = "All Tuinkamer Lights" arrFS20Units(DeviceType, 32) = "FS20" arrFS20Units(HouseCode, 33) = "0000" arrFS20Units(DeviceCode, 33) = "2222" arrFS20Units(SmallGroupCode, 33) = "0000" arrFS20Units(AlarmGroupCode, 33) = "0000" arrFS20Units(LargeGroupCode, 33) = "0000" arrFS20Units(DeviceName, 33) = "Kantoor Monitor" arrFS20Units(DeviceType, 33) = "FS20" arrFS20Units(HouseCode, 34) = "0000" arrFS20Units(DeviceCode, 34) = "3214" arrFS20Units(SmallGroupCode, 34) = "3244" arrFS20Units(AlarmGroupCode, 34) = "4411" arrFS20Units(LargeGroupCode, 34) = "4444" arrFS20Units(DeviceName, 34) = "Woonkamer Haardlampen" arrFS20Units(DeviceType, 34) = "FS20" arrFS20Units(HouseCode, 35) = "0000" arrFS20Units(DeviceCode, 35) = "1312" arrFS20Units(SmallGroupCode, 35) = "0000" arrFS20Units(AlarmGroupCode, 35) = "0000" 'Niet uitzetten bij Armen van Alarm omdat je juist buiten licht wilt hebben arrFS20Units(LargeGroupCode, 35) = "0000" ' nadat je het alarm armed om bv weg te gaan arrFS20Units(DeviceName, 35) = "Garage Muurlampen" arrFS20Units(DeviceType, 35) = "FS20" arrFS20Units(HouseCode, 36) = "0000" arrFS20Units(DeviceCode, 36) = "3113" arrFS20Units(SmallGroupCode, 36) = "0000" arrFS20Units(AlarmGroupCode, 36) = "4411" arrFS20Units(LargeGroupCode, 36) = "4444" arrFS20Units(DeviceName, 36) = "Veranda Plafondlampen" arrFS20Units(DeviceType, 36) = "FS20" arrFS20Units(HouseCode, 37) = "0000" arrFS20Units(DeviceCode, 37) = "3122" arrFS20Units(SmallGroupCode, 37) = "0000" arrFS20Units(AlarmGroupCode, 37) = "0000" arrFS20Units(LargeGroupCode, 37) = "0000" arrFS20Units(DeviceName, 37) = "Plasma Meubel" arrFS20Units(DeviceType, 37) = "FS20" arrFS20Units(HouseCode, 38) = "0000" arrFS20Units(DeviceCode, 38) = "4211" arrFS20Units(SmallGroupCode, 38) = "4144" arrFS20Units(AlarmGroupCode, 38) = "4411" arrFS20Units(LargeGroupCode, 38) = "4444" arrFS20Units(DeviceName, 38) = "Bioscoop Plafondlampen" arrFS20Units(DeviceType, 38) = "FS20" arrFS20Units(HouseCode, 39) = "0000" arrFS20Units(DeviceCode, 39) = "1213" arrFS20Units(SmallGroupCode, 39) = "1244" arrFS20Units(AlarmGroupCode, 39) = "4411" arrFS20Units(LargeGroupCode, 39) = "4444" arrFS20Units(DeviceName, 39) = "Keuken Aanrechtlamp" arrFS20Units(DeviceType, 39) = "FS20" arrFS20Units(HouseCode, 40) = "0000" arrFS20Units(DeviceCode, 40) = "4212" arrFS20Units(SmallGroupCode, 40) = "0000" arrFS20Units(AlarmGroupCode, 40) = "0000" arrFS20Units(LargeGroupCode, 40) = "0000" arrFS20Units(DeviceName, 40) = "Bioscoop Gordijnen" arrFS20Units(DeviceType, 40) = "FS20" arrFS20Units(HouseCode, 41) = "0000" arrFS20Units(DeviceCode, 41) = "4213" arrFS20Units(SmallGroupCode, 41) = "0000" arrFS20Units(AlarmGroupCode, 41) = "0000" arrFS20Units(LargeGroupCode, 41) = "0000" arrFS20Units(DeviceName, 41) = "Bioscoop CFSound" arrFS20Units(DeviceType, 41) = "FS20" arrFS20Units(HouseCode, 42) = "0000" arrFS20Units(DeviceCode, 42) = "1121" arrFS20Units(SmallGroupCode, 42) = "0000" arrFS20Units(AlarmGroupCode, 42) = "0000" arrFS20Units(LargeGroupCode, 42) = "0000" arrFS20Units(DeviceName, 42) = "RFXCom" arrFS20Units(DeviceType, 42) = "FS20" arrFS20Units(HouseCode, 43) = "0000" arrFS20Units(DeviceCode, 43) = "3232" arrFS20Units(SmallGroupCode, 43) = "0000" arrFS20Units(AlarmGroupCode, 43) = "0000" arrFS20Units(LargeGroupCode, 43) = "0000" arrFS20Units(DeviceName, 43) = "Patio Screen" arrFS20Units(DeviceType, 43) = "MS2" arrFS20Units(HouseCode, 44) = "0000" arrFS20Units(DeviceCode, 44) = "3131" arrFS20Units(SmallGroupCode, 44) = "0000" arrFS20Units(AlarmGroupCode, 44) = "0000" arrFS20Units(LargeGroupCode, 44) = "0000" arrFS20Units(DeviceName, 44) = "Veranda Zone2 Power" arrFS20Units(DeviceType, 44) = "FS20" arrFS20Units(HouseCode, 45) = "0000" arrFS20Units(DeviceCode, 45) = "3132" arrFS20Units(SmallGroupCode, 45) = "0000" arrFS20Units(AlarmGroupCode, 45) = "0000" arrFS20Units(LargeGroupCode, 45) = "0000" arrFS20Units(DeviceName, 45) = "Veranda Zone2 Preset" arrFS20Units(DeviceType, 45) = "FS20" arrFS20Units(HouseCode, 46) = "0000" arrFS20Units(DeviceCode, 46) = "2223" arrFS20Units(SmallGroupCode, 46) = "0000" arrFS20Units(AlarmGroupCode, 46) = "0000" arrFS20Units(LargeGroupCode, 46) = "0000" arrFS20Units(DeviceName, 46) = "Kantoor PC" arrFS20Units(DeviceType, 46) = "FS20" End Sub