Setting Color in a python script

Python and python framework

Moderator: leecollings

Post Reply
pipiche
Posts: 2034
Joined: Monday 02 April 2018 20:33
Target OS: Linux
Domoticz version:
Contact:

Setting Color in a python script

Post by pipiche »

Hello,

I'm writing a python script by using the i"mport DomoticzEvents" statement to interact with the Domoticz commands and variable.
However I didn't find the way to set Light Colors.

here after is the python3 script store in scripts/python

Code: Select all

import DomoticzEvents as Dz
Dz.Command( "Led #1 Bureau", 'On FOR 10')
I would like to set at the same time the color of the Led, how can I do that ? Color like "{ bri: 100, color: '{m: 2, RGB: 000000, CWWW: 05fa, CT: 250}"
User avatar
waltervl
Posts: 7005
Joined: Monday 28 January 2019 18:48
Target OS: Linux
Domoticz version: 2026.3
Location: NL
Contact:

Re: Setting Color in a python script

Post by waltervl »

As this python scripting is hardly documented I would advise you to switch to dzVents. Also better integrated into Domoticz database. https://www.domoticz.com/wiki/DzVents:_ ... _scripting

Other possibility is to create a Python Plugin: https://www.domoticz.com/wiki/Developin ... hon_plugin
Domoticz running on Udoo X86 (on Ubuntu)
Devices/plugins: ZigbeeforDomoticz (with Xiaomi, Ikea, Tuya devices), Nefit Easy, Midea Airco, Omnik Solar, Goodwe Solar
Post Reply