Jump to content

Welcome, Guest!

Be a part of CinemaVision today! Once registered and logged in, you will have access to public chat and your own private messenger, you can view and contribute guides, collaborate on the forums, review downloads, give reputation to your fellow members, contribute content and so much more. Registering is quick and completely free, so what are you waiting for?
   Sign In    Sign Up

Become a RedCarpet Club Member Today!

   Join Now
  • 0
cr08

[TIP] Sengled smart bulb support

Question

Thought I'd add this as a tip here as I found a supporting github repo recently and was able to get some nice python scripts going.

---

So I use mainly Sengled brand smart bulbs in my house including their own Zigbee based hub as they have historically been cheap and easy to acquire from a number of retailers including Amazon as well as local brick-and-mortars like Microcenter and Home Depot in my neck of the woods. However using their own hub means there's no stock 'integration' or API options outside of their own app or Alexa/Google Home.

Found a GitHub repo that provides a very clean 'API' of sorts for Sengled products that goes through their web servers and doesn't require migrating to a third party hub.

https://github.com/vroy/python-sengled-client

Here's a quick and dirty sample python script I wrote using this. It is largely using the examples right on the github page. REALLY easy to read and understand.

import sengled

api = sengled.api(
    # The username/password that you used to create your mobile account in
    # the Sengled Home app.
    username="***",
    password="***",

    # Optional path to persist the session across multiple process
    # starts and reduce the number of logins.
    #session_path="~/sengled.pickle",

    # Prints details of the api request/responses when True, defaults to false.
    debug=True
)

api.find_by_id("ABCDEF1234567890") \
.on() \
.set_brightness(100) \
.set_brightness(95) \
.set_brightness(90) \
.set_brightness(85) \
.set_brightness(80) \
.set_brightness(75) \
.set_brightness(70) \
.set_brightness(65) \
.set_brightness(60) \
.set_brightness(55) \
.set_brightness(50) \
.set_brightness(45) \
.set_brightness(40) \
.set_brightness(35) \
.set_brightness(30) \
.set_brightness(25) \
.set_brightness(20) \
.set_brightness(15) \
.set_brightness(10) \
.set_brightness(5) \
.set_brightness(4) \
.set_brightness(3) \
.set_brightness(1)

Which basically just makes sure the selected bulbs/groups are brought up to 100% and slowly dims down to 1%. It also supports their smart plugs and color changing bulbs in addition to the barebones single color/temp dimmable bulbs.

  • Like 1

Share this post


Link to post
Share on other sites

0 answers to this question

Recommended Posts

There have been no answers to this question yet

Join the conversation

You can post now and register later. If you have an account, sign in now to post with your account.

Guest
Answer this question...

×   Pasted as rich text.   Paste as plain text instead

  Only 75 emoji are allowed.

×   Your link has been automatically embedded.   Display as a link instead

×   Your previous content has been restored.   Clear editor

×   You cannot paste images directly. Upload or insert images from URL.

Loading...

About Us

CinemaVision began in 2014 as a collaboration to create content for use with your home theater, offering movie trivia slides and video bumpers. It has since grown to be THE PREMIER WAY to create and customize your preshow experience. Download the CinemaVision add-on for Kodi today from the official Kodi repository, and easily create a sequence of trivia, videos, trailers, home automation triggers and more that will bring the experience of a movie theater straight to your screen!

×
×
  • Create New...

Important Information

By using this site, you agree to our Guidelines and Terms of Use.