GithubHelp home page GithubHelp logo

davidramiro / fluxee Goto Github PK

View Code? Open in Web Editor NEW
63.0 7.0 6.0 9.55 MB

๐Ÿ’ก Controlling Yeelight smart lights corresponding to f.lux display color temperature

License: Other

Python 100.00%
yeelight smart-home smarthome python

fluxee's Introduction

fluxee

Setting up a light scene with Yeelight smart lamps corresponding to your f.lux display temperature. Supports any number of lamps simultaneously.

Prerequisites

  • Python 3.11+
  • Pipenv
  • f.lux installed
  • Any Yeelight/Xiaomi/Mijia Wi-Fi lamp

Usage

  • Clone the repo
  • Run pipenv install && pipenv shell
  • Enable LAN Control on your lamps in the Yeelight app.
  • Create a copy of config.yaml.default called config.yaml
  • Find out your lamp's IP addresses and put them into config.yaml.
  • If you know your lamp's color temperature range you should set it in the config file aswell. If you don't know it, the script will use the widest range possible but you might get an error message. It will still work, though.
  • In f.lux settings enter http://127.0.0.1:8080/room_1 in the bottom URL
  • Run python fluxee.py

Important note

Keep in mind that your f.lux settings might not match your lamp's capabilities. For example, my Yeelight RGBW Bulb supports 1700K to 6500K, my Mi Desk Lamp only 2700K to 6500K. On default, f.lux ranges from 1900K to 6500K, its effectiveness may vary depending on your lamp. If you're very sensitive even 2700K might not be dim enough for you to achieve full melatonin secretion.

Potential Issues

Some people seem to have issues getting the script to work flawlessly with the Xiaomi Mi LED Desk Lamp (Xiaomi Mijia Yeelight MJTD01YL). For me it works most of the time with an occasional error regarding the power state of the lamp. Disabling the state check in the config.ini might help.

Credits

Thanks to ekzi for providing the idea and basis behind this project!

Gratefully using the Yeelight python library by Stavros Korokithakis.
Copyright (c) 2016, Stavros Korokithakis
All rights reserved.

License

This project is licensed under the MIT License - see the LICENSE file for details

fluxee's People

Contributors

davidramiro avatar dependabot[bot] avatar wiles avatar

Stargazers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

Watchers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar

fluxee's Issues

Seems to not work anymore

Hello, since some days the Fluxee app crash when tying to initializing the lamp, i checked the yeelight app and the third control access is still authorized, i updated python and fluxee, i don't know where is the problem

Port on use OSError: [WinError 10013]

Thanks for your work I'm still testing with no success.

For the first error that I found: OSError: [WinError 10013], the solution for me is to choose another port 8090 in my case, I changed both in code and on f.lux.

But Flux is not updating the light brightness. I'll keep trying.

Can't run with pythonw

I was trying to get the fluxee.py to run in the background without the console window. The default method for that would be to use pythonw interpreter instead of python.

Unfortunately running pythonw fluxee.py or even changing the extenstion to fluxee.pyw causes the script to immediately terminate.

After a bit of research I found out a few things:

  1. Python in no-console mode does not like errors/exceptions/any output - so I've tried to simply comment all the print statements - no luck there
  2. Bottle has a quiet mode, that prevents it from producing any output - but it still does not mitigate the issue
  3. The program is still somehow triggering the immediate termination, but I didn't dig deep enough into the code to determine what is the cause

I can't simply use the prebuilt .exe version, because I wanted to change some things in the code (for example I wanted the brightness to be constant all the time at 50%, not at 100% at startup because it melts my eyes ;)). For now I just use a dirty trick of using:

cmd /k "C:\Programy\Python364\pythonw.exe P:\yeelight-fluxee-master\fluxee.py 1>stdout.txt 2>stderr.txt"
exit

But it's really annoying.

Corrupted Release

I can't extract the archive of your new release for some reason. Maybe the files got corrupted. Downloaded and tried multiple times.

Fluxee not working after changing config

Hi David,

I changed the config file while Fluxee was running (Set StaticBrightness from False to True).
Fluxee gave some errors, I didn't capture a screenshot of them unfortunately, but seems logical 'cause of the sudden change in config.
I restarted fluxee.exe but now it hangs at Initializing (see screenshot) and just terminates after about 4 seconds.

I'm on Windows 10. Fluxee has always worked before, even when changing the config file. (I believe I even changed the config file while fluxee was running once before, which didn't cause any problems then.)

I know it's not a lot of information to go by, so please let me know if you need to know more. Hopefully I can provide.

fluxee screenshot

Bulb closed the connection

Hi David,

I have just found out about Fluxee and got real excited. I downloaded the package and followed the config guidelines. After setting up everything I ran fluxee.exe and I got this message:

Welcome to fluxee by davidramiro
Reading config...
Initializing...
Initializing Yeelight at 192.168.73.112
Traceback (most recent call last):
  File "fluxee.py", line 83, in <module>
  File "fluxee.py", line 65, in main
  File "yeelight\main.py", line 313, in get_properties
  File "yeelight\main.py", line 377, in send_command
yeelight.main.BulbException: Bulb closed the connection.
[15112] Failed to execute script fluxee

I have the Smart LED bulb 1S (model: YLDP13YL). I tried disabling checking the bulb state in the config.ini but it did not change anything. What do you think could cause this problem?

Thanks.

No issue

LAN-control was deactivated after switching the yeelight server.

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.