Library for controlling philips wifi HUE bulb

Cor

Active Member
Licensed User
Longtime User
I'am looking for a library for controling the wifi HUE lamp from Philips

anyone have experience with this?
 

appie21

Active Member
Licensed User
Longtime User
Hello

I try also to get my lights on with B4A

But i must place a PUT Methode

I want to sent this

PHP:
{"on":true, "sat":255, "bri":255,"hue":100}

in the documentation I can't find only POST
 
Upvote 0

appie21

Active Member
Licensed User
Longtime User
My code in Vb.net looks like this:

how do it in b4a?


Dim lampstatus As String = "true"


Private Sub CheckBox1_CheckedChanged(sender As Object, e As EventArgs) Handles CheckBox1.CheckedChanged
If CheckBox1.Checked = True Then
lampstatus = "true"
Else
lampstatus = "false"

End If

Dim result As String
Dim MyURL As String, postData As String
Dim winHttpReq As Object
winHttpReq = CreateObject("WinHttp.WinHttpRequest.5.1")
MyURL = "http://192.168.1.5/api/newdeveloper/lights/" & "1" & "/state"

postData = "{""on"": " & lampstatus & "}"
winHttpReq.Open("PUT", MyURL, False)
winHttpReq.SetRequestHeader("Content-Type", "application/x-www-form-urlencoded")
winHttpReq.Send(postData)

result = winHttpReq.ResponseText
REM CheckBox1.Text = result
End Sub
 
Upvote 0
Top