I would like to fade out a light when I push a button, so the button is the trigger.
I’d like to set the level to 0% in a short but defined amount of time for example 3seconds
How can realize that with dzevents?
My lights are Yeelight so they support .dimTo() and my dzevents is 2.2.0
Thanks in advance
Fabrizio
How to dim a light?
Moderator: leecollings
- waaren
- Posts: 6028
- Joined: Tuesday 03 January 2017 14:18
- Target OS: Linux
- Domoticz version: Beta
- Location: Netherlands
- Contact:
Re: How to dim a light?
With current version of dzVents ( 2.4.5 ) you can dim using only native dzVents code with steps of 1 second using the afterSec() method. Look here for an example. So if you want to do it in 3 seconds then it would not go very smoothly. As far as I understand there is no support yet for user defined smoothness in the domoticz code for the Yeelight hardware (Yeelight.cpp) . If you could work out what the http string should be, It must be possible to call the Yeelight bulb with dzVents openURL.
Look for a solution with os.execute (described in the wiki) Here
Or create a Python script using the package described here and call that from a device's off and/or on action
you could do whatever action is possible with your yeelight bulbs.
python code to dim to zero in 15 seconds.. // Script needs Yeelight module; install with ==>> pip install Yeelight
Look for a solution with os.execute (described in the wiki) Here
Or create a Python script using the package described here and call that from a device's off and/or on action
you could do whatever action is possible with your yeelight bulbs.
python code to dim to zero in 15 seconds.. // Script needs Yeelight module; install with ==>> pip install Yeelight
Code: Select all
#!/usr/bin/python
from yeelight import discover_bulbs
from yeelight import Bulb
bulb = Bulb("nnn.nnn.nnn.nnn", effect="smooth", duration=15000) # 15 seconds
bulb.turn_off()Debian buster, bullseye on RPI-4, Intel NUC.
dz Beta, Z-Wave, RFLink, RFXtrx433e, P1, Youless, Hue, Yeelight, Xiaomi, MQTT
==>> dzVents wiki
dz Beta, Z-Wave, RFLink, RFXtrx433e, P1, Youless, Hue, Yeelight, Xiaomi, MQTT
==>> dzVents wiki
-
acaonweb
- Posts: 92
- Joined: Thursday 23 March 2017 14:18
- Target OS: Raspberry Pi / ODroid
- Domoticz version:
- Contact:
Re: How to dim a light?
thanx for your answer
cool, very nice the python way
there is a way to execute python script in dzvents?
cool, very nice the python way
there is a way to execute python script in dzvents?
- waaren
- Posts: 6028
- Joined: Tuesday 03 January 2017 14:18
- Target OS: Linux
- Domoticz version: Beta
- Location: Netherlands
- Contact:
Re: How to dim a light?
Yes but you will have to use the os.execute command
Debian buster, bullseye on RPI-4, Intel NUC.
dz Beta, Z-Wave, RFLink, RFXtrx433e, P1, Youless, Hue, Yeelight, Xiaomi, MQTT
==>> dzVents wiki
dz Beta, Z-Wave, RFLink, RFXtrx433e, P1, Youless, Hue, Yeelight, Xiaomi, MQTT
==>> dzVents wiki
-
acaonweb
- Posts: 92
- Joined: Thursday 23 March 2017 14:18
- Target OS: Raspberry Pi / ODroid
- Domoticz version:
- Contact:
Re: How to dim a light?
many thanx!!!
Who is online
Users browsing this forum: No registered users and 1 guest