Blinkit v1.4 | Philips Hue integration, Blink a lamp on new Upvotes, Followers and Posts

in #utopian-io6 years ago (edited)

image.png

With this new update it is possible to blink a Philips Hue Lamp, new Upvotes will light up the lamp in green, and new Followers in blue, and on new Posts it will blink with red light.


image.png

The Philips Hue system works with a bridge that connects the lamps to your home network, beside controlling the lights with a app, the bridge can be send put, post, get commands, to be able to send and execute those commands a authorized user ID need to be created with the CLIP API Tool on your Bridge, this can be done by following this tutorial from Philips. Once the authorized user is created, the Bridge IP and ID can be copied and saved into the Blinkit interface and used to blink the Philips Hue light on new Upvotes, Followers and Posts.

Added Features:

Philips Hue integration for Blinkit

  • Set/save IP of the Philips Hue Bridge (find the IP in the Philips Hue, Android or IOS app)
  • Set/save the ID for the authorized user
  • Set/save Blinklenght (0-11 seconds)
  • Buttons to turn on and off, and blink the lights
  • Buttons to start the upvotes, followers, posts script
  • Blink Length slider
  • Readme is updated with information about how to get the Authorized user ID
  • Added Upvotes, Followers, Posts scripts that turn the light on in Green, Blue or Red
  • Added settings files for the Philips Hue bridge IP and authorized user ID, and blink length
  • Added blinkphilipshue.bat
  • Added philipshuegreen.exe philipshueblue.exe philipshuered.exe and philipshueoff.exe
    The executables make a put command to the Bridge and are made as well with VB.net:
    Public Class Form1
    
    
        Dim lampstatus As String = "true"
        Dim IP As String = My.Computer.FileSystem.ReadAllText("C:\blinkit\config\philipshueip.txt")
        Dim ID As String = My.Computer.FileSystem.ReadAllText("C:\blinkit\config\philipshueid.txt")
        Dim colour As String = My.Computer.FileSystem.ReadAllText("C:\blinkit\config\philipshuegreen.txt")
        Dim lamp As String = 1
    
        Private Sub Form1_Load(sender As Object, e As EventArgs) Handles MyBase.Load
    
            Dim result As String
            Dim MyURL As String, postData As String
            Dim winHttpReq As Object
            winHttpReq = CreateObject("WinHttp.WinHttpRequest.5.1")
            MyURL = "http://" & IP & "/api/" & ID & "/lights/" & lamp & "/state"
    
            postData = "{""on"": " & lampstatus & " " & colour & " }"
            winHttpReq.Open("PUT", MyURL, False)
            winHttpReq.SetRequestHeader("Content-Type", "application/x-www-form-urlencoded")
            winHttpReq.Send(postData)
    
            result = winHttpReq.ResponseText
    
    
            Close()
        End Sub
    End Class
    

    The above script is made in Visual Basic and used to build the .EXE files, the executable will use the saved Philips Hue settings: IP, ID and Colour to make PUT requests to the Philips Hue Bridge . The script is added into a text file next to the related executables, for me and others to tweak and reuse.

    User Interface

    • Sound module is resized
    • Philips Hue module, next to the Sonoff module

    Now with the new Philips Hue, and the previously added Sonoff Module, The interface is again getting a bit full, and to have maximum space for the improvements of already available and future features, the interface would need a redesign, and this will be my next point to focus on.


    Suggestions are always welcome

    • Interface ideas and examples
    • What Smart lamps do you have and want to see added to Blinkit?
    • What features do you want to see added ?

    The following repositories are updated:

    Blinkit VB .net source files

    Github commit

    Blinkit software

    Github Commit





    Posted on Utopian.io - Rewarding Open Source Contributors



Sort:  

Coin Marketplace

STEEM 0.19
TRX 0.15
JST 0.029
BTC 63501.83
ETH 2650.23
USDT 1.00
SBD 2.81