Is Insteon PLM PlugIn support for the EZFlora EZRain Interface a possibility?
Announcement
Collapse
No announcement yet.
Insteon PlugIn Support for EZFlora EZRain Interface
Collapse
This topic is closed.
X
X
-
seerhomeguyTags: None
-
-
Originally posted by seerhomeguy View PostIs Insteon PLM PlugIn support for the EZFlora EZRain Interface a possibility?
My plugin now has an external interface so another plugin can send and receive msgs via the plm.Mark
HS3 Pro 4.2.19.5
Hardware: Insteon Serial PLM | AD2USB for Vista Alarm | HAI Omnistat2 | 1-Wire HA7E | RFXrec433 | Dahua Cameras | LiftMaster Internet Gateway | Tuya Smart Plugs
Plugins: Insteon (mine) | Vista Alarm (mine) | Omnistat 3 | Ultra1Wire3 | RFXCOM | HS MyQ | BLRadar | BLDenon | Tuya | Jon00 Charting | Jon00 Links
Platform: Windows Server 2022 Standard, i5-12600K/3.7GHz/10 core, 16GB RAM, 500GB SSD
Comment
-
seerhomeguy
Thanks for all the replies! I had bought the EZRain a couple of years ago and had it working via the ExtDeviceSupport with devices defined for each zone in HS. I wanted to leverage mcsSprinkler and was never able to get that to work correctly. I'm kicking around going with a Rain8 controller just to go with the mcsSprinkler default controller. Would love to be able to leverage the functionality of the mcsSprinkler plugin. Thanks again!
Comment
-
seerhomeguy
Tom, you're right in that it isn't what I "wanted" to hear but thanks for mentioning that as I had not considered that option. I am just about off all of my x10 components in my move to Insteon but I want to consider all options.
Thanks!
Comment
-
Originally posted by seerhomeguy View PostThanks for all the replies! I had bought the EZRain a couple of years ago and had it working via the ExtDeviceSupport with devices defined for each zone in HS. I wanted to leverage mcsSprinkler and was never able to get that to work correctly. I'm kicking around going with a Rain8 controller just to go with the mcsSprinkler default controller. Would love to be able to leverage the functionality of the mcsSprinkler plugin. Thanks again!
did you contact MCS about the issues you were having with mcsSprinkler?Mark
HS3 Pro 4.2.19.5
Hardware: Insteon Serial PLM | AD2USB for Vista Alarm | HAI Omnistat2 | 1-Wire HA7E | RFXrec433 | Dahua Cameras | LiftMaster Internet Gateway | Tuya Smart Plugs
Plugins: Insteon (mine) | Vista Alarm (mine) | Omnistat 3 | Ultra1Wire3 | RFXCOM | HS MyQ | BLRadar | BLDenon | Tuya | Jon00 Charting | Jon00 Links
Platform: Windows Server 2022 Standard, i5-12600K/3.7GHz/10 core, 16GB RAM, 500GB SSD
Comment
-
I wanted to leverage mcsSprinkler and was never able to get that to work correctly.
did you contact MCS about the issues you were having with mcsSprinkler?
The downside to this approach is that the interface is 1-way where status requests are not sent and response managed. If the interfacing plugin/script handles the confirmation of state then there is no downside. Not having this confirmation is not that bad either if you have a reliable hardware interface. In my case I still use the original 1-way Rain8-X10 and it workls just fine.
If you try and have issues then just post with the debug information that mcsSprinklers will generate.
Comment
-
seerhomeguy
i have the device on the network and can actually control zones with the smarthome Utility - via the PLM. I also have it recognized in HS as a single device. i did update the ExtDevsupport file. How do i get it recognized as multiple zones in HS? Do I need to leverage mcsSprinkler to accomplish that? Thanks! DON
Comment
-
seerhomeguy
I'm thinking that my extDevSupport file is not correct.
' This is where you set the parameters for your EZRain device
Const EZRainDevName As String = "EZRain1" ' A unique name for the EZRain device. Will be used in the device name as well as the callback ID
Const EZRainAddress As String = "01.7E.15" ' The Insteon address of the EZRain controller
Const EZRainDevLocation As String = "3-Outside" ' The location information for the EZRain HomeSeer device info
Const EZRainDeviceCodeStart As Integer = 1 ' The Device Code (DC) that will hold the first zone device for the EZRain
Comment
-
seerhomeguy
Yep I had not completely setup the ExtDevSupport file. i overlooked setting EZRain to TRUE. I now have the 8 EZRain zones listed and cotrollable from within HS. My hope is that now I can just install the mcsSprinkler plugin and have it leverage the HS "devices" setup for the EZRain zones.
Comment
-
Quick HowTo for Homeseer and EZFlora
I was looking for a simple HOWTO on using EZFlora with Homeseer. I got my neighbor's system working and I think this link is a good place to post a "how to" that would describe the steps on getting it working.
1. You need to set up your insteon network with a smartlink device and homeseer software on your computer and your ezflora device.
2. Connect your transformer and valve wires.
3. Take the attached script called Insteon_ExtDevSupport.vb and edit the EZFlora address to your EZFlora XX.XX.XX address. Note the script used to be for ezrain and ezio and written by Jonathan Ort.
4. Put the file into the scripts directory under HomeSeer HSPRO location.
5. Stop and restart the HomeSeer Pro application service.
6. You should see HomeSeer building the sprinkler system items at startup (it will be the last thing it does).
7. Test the newly built Insteon devices (note the status will show "unknown" until they are used the first time by HomeSeer).
Good luck.
Code:' Updates to Jonathan Ort's script that handled EZRain and EZIO to EZFlora ' Updated by James Hoover 6/21/2011 ' This file adds support for the SimpleHomeNet EZRain Irrigation controller and/or EZIO I/O controller to the stock HomeSeer Insteon plug-in. ' Created 2/2/2007 by Jonathan Ort. ' Version 1.02 ' Set EZFlora to True device. It is possible to have only the RegisterDevices method in the ' Insteon_ExtDevSupport.vb script and then have that method call other scripts with specific device support. For now we will put it all ' together into one script for purposes of this demonstration. Const EnableEZFlora As Boolean = True ' Just a name to use when reporting information and errors through the HomeSeer log Const ScriptName = "Insteon_ExtDevSupport.vb" ' This is where you set the parameters for your EZFlora device Const EZFloraDevName As String = "EZFlora1" ' A unique name for the EZFlora device. Will be used in the device name as well as the callback ID Const EZFloraAddress As String = "19.AD.09" ' The Insteon address of the EZFlora controller Const EZFloraDevLocation As String = "Front Yard" ' The location information for the EZFlora HomeSeer device info Const EZFloraDeviceCodeStart As Integer = 1 ' The Device Code (DC) that will hold the first zone (1-99) device for the EZFlora ' Assign a House Code Const HouseCode As String = "E" ' We are going to use House Code "E" ' Global data for the script Dim PLCAddress As String ' We need to know the PLC Insteon address Dim gProcessingEZFloraStates As Boolean = False ' We need to know if EZFlora device change messages are caused by our own functions Dim gProcessingEZIOStates As Boolean = False ' We need to know if EZIO device change messages are caused by our own functions ' The Insteon plug-in calls this method to let us know that it is ready to accept external device registrations Sub RegisterDevices(ByVal parm As Object) Dim Lp As Integer Try ' We will need the PLC address to help us decode incoming messages PLCAddress = hs.plugin("Insteon").ExtDev_GetPLCAddress("") ' Setup some initial states gProcessingEZFloraStates = False gProcessingEZIOStates = False ' This block of code enables the EZFlora support If EnableEZFlora = True Then ' Register the device. All zones in the EZFlora are controlled via one Insteon device hs.plugin("Insteon").ExtDev_RegisterExternalDeviceSupport(EZFloraDevName, EZFloraAddress, "Insteon_ExtDevSupport.vb", "EZFloraRcv") ' Call a function to make sure we have our HomeSeer devices ready to go CreateEZFloraDevices() ' Send out an off command that will cause the EZFlora to transmit a status changed message so we can get the current state of all valves ' Unfortunately the status shows up as unknown in Homeseer until they are used the first time For Lp = 0 to 7 ' Need to force all valves off to get status - unforunately, if the service is restarted while program is running this hoses the current program hs.plugin("Insteon").ExtDev_TransmitToExternalDevice(EZFloraDevName, &H0F, &H41, Lp) ' Flags = No extra hops and direct command, Cmd1 = Control Off, Cmd 2 = sensor Next End If ' Have HomeSeer call us whenever a device changes state so we can track our own device states hs.RegisterStatusChangeCB("Insteon_ExtDevSupport.vb", "StatusChangeCallBack") Catch ex As Exception hs.WriteLog(ScriptName, "Error in Insteon_ExtDevSupport:RegisterDevices " & ex.ToString) End Try End Sub ' The Insteon plug-in will call this method any time it receives any traffic from the registered device address Sub EZFloraRcv(ByVal InsteonData As String) Dim Data() As String Try hs.WriteLog(ScriptName, "Received Insteon Data " & InsteonData) Data = Split(InsteonData, " ") If Data(0) = "ACK" Then ' This was an ACK response to a prior command. There is extra data here. The standard ACK will also be sent Else ' This is a standard Insteon (not ACK) message -- most often a status msg after sending the ACK Select Case Val(Data(7)) And 224 Case 128 ' Broadcast transmissions from our device If Val(Data(8)) = &H27 Then ' Valve status report ProcessValveStatus(Val(Data(9))) End If Case 0 ' Direct commands from our device to any other device Case 32 ' Ack replies from our device to any other device Case 160 ' Nak replies from our device to any other device Case 192 ' Group control broadcast commands from our device Case 64 ' Group control clean-up commands from our device Case 96 ' Ack replies from our device to group clean-up commands from any device Case 224 ' Nak replies from our device to group clean-up commands from any device End Select End If Catch ex As Exception hs.WriteLog(ScriptName, "Error in EzFloraRcv " & ex.ToString) End Try End Sub ' HomeSeer will call us any time a device changes state. We use this to track when the user wants to control a zone Sub StatusChangeCallBack(ByVal parms) Dim hc As String Dim dc As Integer Dim status As Integer Try ' If the status changes are because of our own script processing then we can ignore it If gProcessingEZFloraStates = True Then Return ' Get the info on the device that changed hc = parms(0) dc = parms(1) status = parms(2) ' Eliminate all devices that are not ours If hc <> HouseCode Then Return ' Handle any changes to the EZFlora zones If dc >= EZFloraDeviceCodeStart And dc <= EZFloraDeviceCodeStart + 7 Then ' Send the command to control the zone If status = 2 Then ' Turn On ControlEZFloraZone(dc - EZFloraDeviceCodeStart, True) ElseIf status = 3 Then ' Turn Off ControlEZFloraZone(dc - EZFloraDeviceCodeStart, False) End If ' Handle any changes to the EZIO outputs End If Catch ex As Exception hs.WriteLog("ScriptName", "Error in StatusChangeCallback" & ex.ToString) End Try End Sub ' Utility functions Sub CreateEZFloraDevices() Dim Lp As Integer Dim Ref As Long Dim dv As Object Dim dc As String Try gProcessingEZFloraStates = True ' Create the 8 devices that will reflect the 8 zones on the controller For Lp = 0 To 7 dc = (EZFloraDeviceCodeStart + Lp).ToString If hs.DeviceExists(HouseCode & dc) = -1 Then Ref = hs.NewDeviceRef(EZFloraDevName & " Zone " & (Lp + 1).ToString) dv = hs.GetDeviceByRef(Ref) dv.dc = dc dv.hc = HouseCode dv.can_dim = False dv.location = EZFloraDevLocation End If Next Catch ex As Exception hs.WriteLog(ScriptName, "Error in CreateEZFloraDevices " & ex.ToString) End Try gProcessingEZFloraStates = False End Sub Sub ProcessValveStatus(ByVal Status As Byte) Dim ValveNum As Integer = (Status And 7) Dim dc As String Dim Lp As Integer Try gProcessingEZFloraStates = True ' Run the 8 zones and set them according to the valve status report For Lp = 0 To 7 dc = (EZFloraDeviceCodeStart + Lp).ToString If ValveNum = Lp And (Status And 128) = 128 Then hs.SetDeviceStatus(HouseCode & dc, 2) ' Set to on Else hs.SetDeviceStatus(HouseCode & dc, 3) ' Set to off End If Next Catch ex As Exception hs.WriteLog(ScriptName, "Error in ProcessValveStatus " & ex.ToString) End Try gProcessingEZFloraStates = False End Sub Sub ControlEZFloraZone(ByVal Zone As Integer, ByVal TurnOn As Boolean) Try hs.WriteLog(ScriptName, "ControlEZFloraZone: " & Zone.ToString & ", " & TurnOn.ToString) If TurnOn = True Then hs.plugin("Insteon").ExtDev_TransmitToExternalDevice(EZFloraDevName, &H0F, &H40, Zone) ' Flags = No extra hops and direct command, Cmd1 = Zone On, Cmd2 = Zone number Else hs.plugin("Insteon").ExtDev_TransmitToExternalDevice(EZFloraDevName, &H0F, &H41, Zone) ' Flags = No extra hops and direct command, Cmd1 = Zone Off, Cmd2 = Zone number End If Catch ex As Exception hs.WriteLog(ScriptName, "Error in ControlEZFloraZone " & ex.ToString) End Try End Sub
Comment
-
James
The directions and code in your post are extremely helpful. Thank you. Another question. I have 14 zones and will have 2 EZRains:
- Should I create 2 scripts, or
- run the procedure as you outline above for the first controller, then update the address to that of the second controller and start and stop a second time?
Thanks
PaulPaul
Comment
-
The EZFloras arrived this morning. I chose to do it with two scripts now that I see what the PLM Plugin is looking for. I replaced the Startup script twice, it found the devices and created the individual zones.
The question is, does the script have to stay after the devices are set up? If so I have a different problem to solve.Paul
Comment
-
Script for supporting 2 EZFloras
The answer to my original question is that a single script is needed to support multiple controllers. The script both sets up zones as well as provides the run time code, which means both have to be dealt with in one script. I have been running it this morning and getting responses back and the controllers are working.
Here is the updated code to support 2 controllers.
Code:' Additional Updates to James Hoover and Jonathon Ort's scripts ' Updates to Jonathan Ort's script that handled EZRain and EZIO to EZFlora ' Updated by James Hoover 6/21/2011 ' Updated by Paul Bates(pbibm) 7/17/2011- This update allows 2 ezfloras to supported simultaneously by the Insteon plug in ' with this update, unit codes must be contigous from controller 1 to controller 2, eg Controller 1 (unit 1 - 8) and Controller 2 (unit 9 -16) ' This file adds support for the SimpleHomeNet EZRain Irrigation controller and/or EZIO I/O controller to the stock HomeSeer Insteon plug-in. ' Created 2/2/2007 by Jonathan Ort. ' Version 1.02 ' Set EZFlora to True device. It is possible to have only the RegisterDevices method in the ' Insteon_ExtDevSupport.vb script and then have that method call other scripts with specific device support. For now we will put it all ' together into one script for purposes of this demonstration. Const EnableEZFlora As Boolean = True ' Just a name to use when reporting information and errors through the HomeSeer log Const ScriptName = "Insteon_ExtDevSupport.vb" ' This is where you set the parameters for your EZFlora devices Const EZFloraDevName As String = "EZFlora1" ' A unique name for the EZFlora device. Will be used in the device name as well as the callback ID Const EZFloraAddress As String = "19.AB.AE" ' The Insteon address of the EZFlora controller Const EZFloraDevLocation As String = "Outside" ' The location information for the EZFlora HomeSeer device info Const EZFloraDeviceCodeStart As Integer = 1 ' The Device Code (DC) that will hold the first zone (1-99) device for the EZFlora Const HouseCode As String = "<" ' Set Homeseer device name. This is not the same as the X10 House code. You need to do that separately Const EZFloraDevName2 As String = "EZFlora2" ' A unique name for the EZFlora device. Will be used in the device name as well as the callback ID Const EZFloraAddress2 As String = "19.AC.FA" ' The Insteon address of the EZFlora controller Const EZFloraDevLocation2 As String = "Outside" ' The location information for the EZFlora HomeSeer device info Const EZFloraDeviceCodeStart2 As Integer = 9 ' The Device Code (DC) that will hold the first zone (1-99) device for the EZFlora Const HouseCode2 As String = ">" ' Set Homeseer device name. This is not the same as the X10 House code. You need to do that separately ' Global data for the script Dim PLCAddress As String ' We need to know the PLC Insteon address Dim gProcessingEZFloraStates As Boolean = False ' We need to know if EZFlora device change messages are caused by our own functions Dim gProcessingEZIOStates As Boolean = False ' We need to know if EZIO device change messages are caused by our own functions ' The Insteon plug-in calls this method to let us know that it is ready to accept external device registrations Sub RegisterDevices(ByVal parm As Object) Dim Lp As Integer Try ' We will need the PLC address to help us decode incoming messages PLCAddress = hs.plugin("Insteon").ExtDev_GetPLCAddress("") ' Setup some initial states gProcessingEZFloraStates = False gProcessingEZIOStates = False ' This block of code enables the EZFlora support If EnableEZFlora = True Then ' EZ FLora 1 ' Register the devices. All zones in the EZFlora are controlled via one Insteon device hs.plugin("Insteon").ExtDev_RegisterExternalDeviceSupport(EZFloraDevName, EZFloraAddress, "Insteon_ExtDevSupport.vb", "EZFloraRcv") ' Call a function to make sure we have our HomeSeer devices ready to go CreateEZFloraDevices() ' Send out an off command that will cause the EZFlora to transmit a status changed message so we can get the current state of all valves ' Unfortunately the status shows up as unknown in Homeseer until they are used the first time ' Must force all valves off to get status - if the service is restarted while program is running this hoses the current program For Lp = 0 to 7 hs.plugin("Insteon").ExtDev_TransmitToExternalDevice(EZFloraDevName, &H0F, &H41, Lp) ' Flags = No extra hops and direct command, Cmd1 = Control Off, Cmd 2 = sensor Next ' EZ FLora 2 ' Register the devices. All zones in the EZFlora are controlled via one Insteon device hs.plugin("Insteon").ExtDev_RegisterExternalDeviceSupport(EZFloraDevName2, EZFloraAddress2, "Insteon_ExtDevSupport.vb", "EZFloraRcv") ' Call a function to make sure we have our HomeSeer devices ready to go CreateEZFloraDevices2() ' Send out an off command that will cause the EZFlora to transmit a status changed message so we can get the current state of all valves ' Unfortunately the status shows up as unknown in Homeseer until they are used the first time ' Must force all valves off to get status - if the service is restarted while program is running this hoses the current program For Lp = 0 to 7 hs.plugin("Insteon").ExtDev_TransmitToExternalDevice(EZFloraDevName2, &H0F, &H41, Lp) ' Flags = No extra hops and direct command, Cmd1 = Control Off, Cmd 2 = sensor Next End If ' Have HomeSeer call us whenever a device changes state so we can track our own device states hs.RegisterStatusChangeCB("Insteon_ExtDevSupport.vb", "StatusChangeCallBack") Catch ex As Exception hs.WriteLog(ScriptName, "Error in Insteon_ExtDevSupport:RegisterDevices " & ex.ToString) End Try End Sub ' The Insteon plug-in will call this method any time it receives any traffic from the registered device address Sub EZFloraRcv(ByVal InsteonData As String) Dim Data() As String Try hs.WriteLog(ScriptName, "Received Insteon Data " & InsteonData) Data = Split(InsteonData, " ") If Data(0) = "ACK" Then ' This was an ACK response to a prior command. There is extra data here. The standard ACK will also be sent Else ' This is a standard Insteon (not ACK) message -- most often a status msg after sending the ACK Select Case Val(Data(7)) And 224 Case 128 ' Broadcast transmissions from our device If Val(Data(8)) = &H27 Then ' Valve status report ProcessValveStatus(Val(Data(9))) End If Case 0 ' Direct commands from our device to any other device Case 32 ' Ack replies from our device to any other device Case 160 ' Nak replies from our device to any other device Case 192 ' Group control broadcast commands from our device Case 64 ' Group control clean-up commands from our device Case 96 ' Ack replies from our device to group clean-up commands from any device Case 224 ' Nak replies from our device to group clean-up commands from any device End Select End If Catch ex As Exception hs.WriteLog(ScriptName, "Error in EzFloraRcv " & ex.ToString) End Try End Sub ' HomeSeer will call us any time a device changes state. We use this to track when the user wants to control a zone Sub StatusChangeCallBack(ByVal parms) Dim hc As String Dim dc As Integer Dim status As Integer Try ' If the status changes are because of our own script processing then we can ignore it If gProcessingEZFloraStates = True Then Return ' Get the info on the device that changed hc = parms(0) dc = parms(1) status = parms(2) ' Eliminate all devices that are not ours If hc <> HouseCode and hc <> HouseCode2 Then Return ' Handle any changes to the EZFlora zones ' Example: Controller 1 starts with 1 and controller 2 ends with 16. If dc >= EZFloraDeviceCodeStart And dc <= EZFloraDeviceCodeStart + 7 Then ' Send the command to control the zone If status = 2 Then ' Turn On ControlEZFloraZone(dc - EZFloraDeviceCodeStart, True) ElseIf status = 3 Then ' Turn Off ControlEZFloraZone(dc - EZFloraDeviceCodeStart, False) End If ' Handle any changes to the EZIO outputs End If ' Duplicate logic for Second EZFlora If hc <> HouseCode and hc <> HouseCode2 Then Return ' Handle any changes to the EZFlora zones ' Paul B update: I make the assumption that device codes are contigous control 1 to controller 2 ' Example: Controller 1 starts with 1 and controller 2 ends with 16. If dc >= EZFloraDeviceCodeStart2 And dc <= EZFloraDeviceCodeStart2 + 7 Then ' Send the command to control the zone If status = 2 Then ' Turn On ControlEZFloraZone2(dc - EZFloraDeviceCodeStart2, True) ElseIf status = 3 Then ' Turn Off ControlEZFloraZone2(dc - EZFloraDeviceCodeStart2, False) End If ' Handle any changes to the EZIO outputs End If Catch ex As Exception hs.WriteLog("ScriptName", "Error in StatusChangeCallback" & ex.ToString) End Try End Sub ' Utility functions Sub CreateEZFloraDevices() Dim Lp As Integer Dim Ref As Long Dim dv As Object Dim dc As String Try gProcessingEZFloraStates = True ' Create the 8 devices that will reflect the 8 zones on the controller For Lp = 0 To 7 dc = (EZFloraDeviceCodeStart + Lp).ToString If hs.DeviceExists(HouseCode & dc) = -1 Then Ref = hs.NewDeviceRef(EZFloraDevName & " Zone " & (Lp + 1).ToString) dv = hs.GetDeviceByRef(Ref) dv.dc = dc dv.hc = HouseCode dv.can_dim = False dv.location = EZFloraDevLocation End If Next Catch ex As Exception hs.WriteLog(ScriptName, "Error in CreateEZFloraDevices " & ex.ToString) End Try gProcessingEZFloraStates = False End Sub Sub CreateEZFloraDevices2() Dim Lp As Integer Dim Ref As Long Dim dv As Object Dim dc As String Try gProcessingEZFloraStates = True ' Create the 8 devices that will reflect the 8 zones on the controller For Lp = 0 To 7 dc = (EZFloraDeviceCodeStart2 + Lp).ToString If hs.DeviceExists(HouseCode2 & dc) = -1 Then Ref = hs.NewDeviceRef(EZFloraDevName2 & " Zone " & (Lp + 1).ToString) dv = hs.GetDeviceByRef(Ref) dv.dc = dc dv.hc = HouseCode2 dv.can_dim = False dv.location = EZFloraDevLocation End If Next Catch ex As Exception hs.WriteLog(ScriptName, "Error in CreateEZFloraDevices " & ex.ToString) End Try gProcessingEZFloraStates = False End Sub Sub ProcessValveStatus(ByVal Status As Byte) Dim ValveNum As Integer = (Status And 7) Dim dc As String Dim Lp As Integer Try gProcessingEZFloraStates = True ' Run the 8 zones and set them according to the valve status report For Lp = 0 To 7 dc = (EZFloraDeviceCodeStart + Lp).ToString If ValveNum = Lp And (Status And 128) = 128 Then hs.SetDeviceStatus(HouseCode & dc, 2) ' Set to on Else hs.SetDeviceStatus(HouseCode & dc, 3) ' Set to off End If next Catch ex As Exception hs.WriteLog(ScriptName, "Error in ProcessValveStatus " & ex.ToString) End Try gProcessingEZFloraStates = False End Sub Sub ControlEZFloraZone(ByVal Zone As Integer, ByVal TurnOn As Boolean) Try hs.WriteLog(ScriptName, "ControlEZFloraZone: " & Zone.ToString & ", " & TurnOn.ToString) If TurnOn = True Then hs.plugin("Insteon").ExtDev_TransmitToExternalDevice(EZFloraDevName, &H0F, &H40, Zone) ' Flags = No extra hops and direct command, Cmd1 = Zone On, Cmd2 = Zone number Else hs.plugin("Insteon").ExtDev_TransmitToExternalDevice(EZFloraDevName, &H0F, &H41, Zone) ' Flags = No extra hops and direct command, Cmd1 = Zone Off, Cmd2 = Zone number End If Catch ex As Exception hs.WriteLog(ScriptName, "Error in ControlEZFloraZone " & ex.ToString) End Try End Sub Sub ControlEZFloraZone2(ByVal Zone As Integer, ByVal TurnOn As Boolean) Try hs.WriteLog(ScriptName, "ControlEZFloraZone: " & Zone.ToString & ", " & TurnOn.ToString) If TurnOn = True Then hs.plugin("Insteon").ExtDev_TransmitToExternalDevice(EZFloraDevName2, &H0F, &H40, Zone) ' Flags = No extra hops and direct command, Cmd1 = Zone On, Cmd2 = Zone number Else hs.plugin("Insteon").ExtDev_TransmitToExternalDevice(EZFloraDevName2, &H0F, &H41, Zone) ' Flags = No extra hops and direct command, Cmd1 = Zone Off, Cmd2 = Zone number End If Catch ex As Exception hs.WriteLog(ScriptName, "Error in ControlEZFloraZone " & ex.ToString) End Try End Sub
The bad news (I think) is if I want to add other supported devices this way. The script will keep growing and changing.
PaulPaul
Comment
Comment