So I have the following code, which changes my Lights to different colors:
.items:
Group gLEDcolor "Gruppenfarbe" ["Lightning"]
.sitemap
Selection item=gLEDcolor label="Farbe wählen" mappings=[0="Aus",
1="Rot",
2="Blau",
3="Grün",
4="Magenta",
5="Cyan",
6="Gelb",
7="Weiß",
8="Epilepsie"
] icon=script
.rules
var Timer timer = null
rule "Alle Lichter Steuerung"
when
Item gLight received command ON
then
if (timer === null) {
timer = createTimer(now.plusMinutes(90)) [|
sendCommand(gArilux, OFF)
sendCommand(gYeelight, OFF)
timer = null
]
}
end
rule "7 Farben auswählen"
when
Item gLEDcolor received command
then
switch ((gLEDcolor.state as DecimalType).intValue){
//Aus
case 0:
{
gLight.sendCommand(OFF)
}
//Rot
case 1:
{
gLight.sendCommand(ON)
gLEDpr.sendCommand(38)
grLEDps.sendCommand(97)
gLEDcolor.sendCommand(new HSBType(new DecimalType(0),new PercentType(100),new PercentType(100)))
}
//Blau
case 2:
{
gLight.sendCommand(ON)
gLEDcolor.sendCommand(new HSBType(new DecimalType(240),new PercentType(100),new PercentType(100)))
gLight.sendCommand(ON)
//gLEDpr.sendCommand(40)
grLEDps.sendCommand(97)
}
//Grün
case 3:
{
gLight.sendCommand(ON)
gLEDpr.sendCommand(39)
grLEDps.sendCommand(97)
gLEDcolor.sendCommand(new HSBType(new DecimalType(120),new PercentType(99),new PercentType(100)))
}
//Magenta/Violett
case 4:
{
gLight.sendCommand(ON)
gLEDpr.sendCommand(43)
grLEDps.sendCommand(97)
gLEDcolor.sendCommand(new HSBType(new DecimalType(300),new PercentType(99),new PercentType(100)))
}
//Cyan
case 5:
{
gLight.sendCommand(ON)
gLEDpr.sendCommand(42)
grLEDps.sendCommand(97)
gLEDcolor.sendCommand(new HSBType(new DecimalType(180),new PercentType(99),new PercentType(100)))
}
//Gelb
case 6:
{
gLight.sendCommand(ON)
gLEDpr.sendCommand(41)
grLEDps.sendCommand(97)
gLEDcolor.sendCommand(new HSBType(new DecimalType(60),new PercentType(99),new PercentType(100)))
}
//Weiß
case 7:
{
gLight.sendCommand(ON)
gLEDpr.sendCommand(44)
grLEDps.sendCommand(97)
}
case 8:
{
gYeelight.sendCommand(OFF)
gArilux.sendCommand(ON)
}
}
if (timer === null) {
timer = createTimer(now.plusMinutes(90)) [|
sendCommand(gArilux, OFF)
sendCommand(gYeelight, OFF)
timer = null
]
}
end
rule "Automatisch auf 96"
when
Item grLEDps received command
then
if (grLEDps.state > 97)
{
grLEDps.sendCommand(96)
}
end
Is there a way to implement these into Alexa with saying “Turn my into blue” ?
I’ve seen this working with HUEs but over the normal gateway without any Home automation Plattform.
I’m thankful for everyone helping