Do we have a Bond plug-in?
Announcement
Collapse
No announcement yet.
Is there any interest in a plugin for Bond Ceiling Fan controller if I write one?
Collapse
X
-
Originally posted by The Barnacle View PostAny updates? Looking forward to Beta testing, if needed. Bought the Bond a few weeks ago and it's been great!HS4 4.2.6.0 &HSTouch Designer 3.0.80
Plugin's:
BLBackup, BLOccupied, BLShutdown, EasyTrigger, Ecobee, Nest, AK Bond
EnvisaLink DSC, PHLocation, Pushover, SONOS, Blue Iris, UltraRachio3,
weatherXML, Jon00 Alexa Helper, Network Monitor, MyQ, Z-Wave
Comment
-
I am in process of installing 3 fans that all need to be on the same circuit, and the fans do not allow for separate wiring of light and fan. Long story short, in order to automate them and be able to individually turn light/fan on for 3 different fans, i'm going to need something like this. From the looks of it, this integration probably isn't going anywhere anytime soon? Does anyone have alternatives (since I don't have a bond yet), that would work now with homeseer?
Thanks!
Comment
-
Originally posted by smikkelsen View PostI am in process of installing 3 fans that all need to be on the same circuit, and the fans do not allow for separate wiring of light and fan. Long story short, in order to automate them and be able to individually turn light/fan on for 3 different fans, i'm going to need something like this. From the looks of it, this integration probably isn't going anywhere anytime soon? Does anyone have alternatives (since I don't have a bond yet), that would work now with homeseer?
Thanks!
Are they AC fans controlled by knob on the wall, or DC fans controlled by a remote?
I've been using DC fans (Lucci brand) controlled by the RFXCOM plugin and it works brilliantly. The same plugin/TRX device also controls my motorised blinds.
Just brainstorming: If you're locked to an AC fan, maybe a HS-FC200 on the wall to control all three fans in tandem, then see if you can wire something like a Qubino 1-relay module into the base of each fan to do the light?
Comment
-
This is Version 1 of 2. This device works well without Alexa, Version 2 works with Alexa, and will allow you to set the speed via %.
Create a virtual device that will control the ceiling fan
Create an event that will monitor this virtual device for any changes.
The parameters are a comma separated string.
xxxx,bond-device-id,bond-token,name used in log
Here is a script that works with Bond Bridge v2
PHP Code:Imports System.IO
Imports System.Net
Imports System.Text
Sub Main(parm as object)
'parms() =
'0: Vurtual device ID to monitor;
'1: Bond device ID curl -H "BOND-Token: bond-TOKEN" -i http://bond-IP/v2/devices
'2: Bond token curl -i http://bond-IP/v2/token
'3: Homeseer Device Name used in log
'bond JSON from http://docs-local.appbond.com/#section/Getting-Started/Getting-the-Bond-Token
Dim parms()
Dim dVal
const server = "bond-IP"
If parm Is Nothing Then
hs.WriteLog("Alexa Fan", "Error; no parameters given " & parm.ToString)
Exit Sub
Else
parms = Split(parm.ToString,",")
End If
dVal = hs.DeviceValue(parms(0))
hs.WriteLog("Alexa Bond", parms(3)& ": " & hs.DeviceVSP_GetStatus(parms(0), hs.devicevalue(parms(0)), 1))
Dim json_data As String = "{""argument"":1}"
Dim uri As String = "http://" & server & "/v2/devices/" & parms(1) & "/actions/TurnOn"
Select Case dVal
Case 100 'off
json_data = "{""power"":1}"
uri = "http://" & server & "/v2/devices/" & parms(1) & "/actions/TurnOff"
Case 101 'on
json_data = "{""power"":1}"
uri = "http://" & server & "/v2/devices/" & parms(1) & "/actions/TurnOn"
Case Else
json_data = Replace(json_data,"1",dVal)
uri = "http://" & server & "/v2/devices/" & parms(1) & "/actions/SetSpeed"
End Select
Dim request As Net.HttpWebRequest = Net.HttpWebRequest.Create(uri)
request.Method = "PUT"
request.Headers.Add("BOND-Token", parms(2))
request.ContentType = "application/json"
Dim json_bytes() As Byte = System.Text.Encoding.ASCII.GetBytes(json_data)
request.ContentLength = json_bytes.Length
Dim stream As IO.Stream = request.GetRequestStream
stream.Write(json_bytes, 0, json_bytes.Length)
Dim response As Net.HttpWebResponse = request.GetResponse
Dim dataStream As IO.Stream = response.GetResponseStream()
Dim reader As New IO.StreamReader(dataStream) ' Open the stream using a StreamReader for easy access.
Dim responseFromServer As String = reader.ReadToEnd() ' Read the content.
'hs.WriteLog("Response", responseFromServer)
reader.Close()
dataStream.Close()
response.Close()
End Sub
- Likes 1
Comment
-
This is version 2. The virtual device used will work with Alexa and allow you to control a light switch that powers the fan. The commands used to Alexa are "Alexa Master Ceiling Fan 20%" "Alexa Master Ceiling Fan On" "Alexa Master Ceiling Fan Off". If the power switch is off and you ask "Alexa Master Ceiling Fan 20%", it will turn on the switch, wait 5 seconds, and issue the speed command for 20% of 1-6. The On and Off commands only control the light switch.
Create a virtual device
Create an event that will monitor the virtual device for any changes.
The parameters are a comma separated string.
xxxx,xxxx,bond-device-id,bond-token,name used in log
Here is a script that works with Bond Bridge v2
Replace the bond-IP and bond-TOKEN with IP address and Token of your bond device. Both Ver1 and Ver2 are saved with a VB extension, script.vb.
Both scripting for Ver1 and Ver2 were taken from examples found using google.
PHP Code:Imports System.IO
Imports System.Net
Imports System.Text
Sub Main(parm as object)
'parms() =
'0: Vurtual device ID to monitor;
'1: Z-wave Device ID on/off switch;
'2: Bond device ID curl -H "BOND-Token: bond-TOKEN" -i http://bond-IP/v2/devices
'3: Bond token curl -i http://bond-IP/v2/token
'4: Homeseer Device Name used in log
'bond JSON from http://docs-local.appbond.com/#section/Getting-Started/Getting-the-Bond-Token
Dim parms()
Dim dVal
Dim dSwitch
const server = "bond-IP"
If parm Is Nothing Then
hs.WriteLog("Alexa Fan", "Error; no parameters given " & parm.ToString)
Exit Sub
Else
parms = Split(parm.ToString,",")
End If
dVal = hs.DeviceValue(parms(0))
If (dVal = 0) OR (dVal > 100) Then
If dVal = 255 Then
hs.CAPIControlHandler(hs.CAPIGetSingleControl(parms(1), true, "On", false, true))
hs.WriteLog("Alexa Fan", parms(4)& ": Switch On")
End If
If dVal = 0 Then
hs.CAPIControlHandler(hs.CAPIGetSingleControl(parms(1), true, "Off", false, true))
hs.WriteLog("Alexa Fan", parms(4)& ": Switch Off")
End If
Exit Sub
Else
dVal = Decimal.Round((((dVal - 0) * (6-1)) / (100-0)) + 1, 0, MidpointRounding.AwayFromZero)
'If dVal = 0 Then dVal = 1
dSwitch = hs.DeviceValue(parms(1))
If dSwitch = 0 Then
hs.CAPIControlHandler(hs.CAPIGetSingleControl(parms(1), true, "On", false, true))
hs.WaitSecs(5)
End If
hs.WriteLog("Alexa Fan", parms(4)& ": Button " & dVal)
End If
Dim json_data As String = "{""argument"":1}"
json_data = Replace(json_data,"1",dVal)
' Create a request using a URL that can receive a post.
Dim uri As String = "http://" & server & "/v2/devices/" & parms(2) & "/actions/SetSpeed"
Dim request As Net.HttpWebRequest = Net.HttpWebRequest.Create(uri)
request.Method = "PUT"
request.Headers.Add("BOND-Token", parms(3))
request.ContentType = "application/json"
Dim json_bytes() As Byte = System.Text.Encoding.ASCII.GetBytes(json_data)
request.ContentLength = json_bytes.Length
Dim stream As IO.Stream = request.GetRequestStream
stream.Write(json_bytes, 0, json_bytes.Length)
Dim response As Net.HttpWebResponse = request.GetResponse
Dim dataStream As IO.Stream = response.GetResponseStream()
Dim reader As New IO.StreamReader(dataStream) ' Open the stream using a StreamReader for easy access.
Dim responseFromServer As String = reader.ReadToEnd() ' Read the content.
'hs.WriteLog("Response", responseFromServer)
reader.Close()
dataStream.Close()
response.Close()
End Sub
- Likes 1
Comment
Comment