Originally posted by rprade
View Post
Announcement
Collapse
No announcement yet.
Is there any interest in a plugin for Bond Ceiling Fan controller if I write one?
Collapse
X
-
Guest replied
-
-
As far as I know the developer is not producing HS plug-ins any longer. To the best of my understanding, he has turned over his current plug-ins to another developer.
Leave a comment:
-
@sirmeili - Are you still interested in creating a plugin or was there not enough demand?
Leave a comment:
-
Originally posted by Peter Wharton View PostI'm also interested in testing. I have 2 Minka-Aire fans that use the UC7067 controller and should work with Bond and 4 motorized Somfy shades with RF remotes. If you're creating a plug-in then I'll get a Bond to test with it.
Sent from my iPhone using Tapatalk
- Likes 1
Leave a comment:
-
I'm also interested in testing. I have 2 Minka-Aire fans that use the UC7067 controller and should work with Bond and 4 motorized Somfy shades with RF remotes. If you're creating a plug-in then I'll get a Bond to test with it.
Leave a comment:
-
Originally posted by sirmeili View Post
ARGH!!!! I wish you lived closer....LOL. I could really use one for testing I'm likely going to buy one, but now hearing all this I'm going to wait until I know the API is released.
Thank you!
Leave a comment:
-
These were on Woot! yesterday for under $50. I picked one up and am very interested in a plugin.
Leave a comment:
-
Originally posted by sirmeili View Post
Not yet. I'm about to start back on it. I was holding off waiting for the API to mature, but there is now a work around if it's not there yet.
Thank you!
Leave a comment:
-
Spooner Thank you for taking the time to put this little script together. It worked great for me! Cheers!!
Leave a 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
Leave a 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
Leave a comment:
Leave a comment: