OpenHAB & Alexa & Milight - invert command action

items

Dimmer Buero_Colortemp_Test "Büro Farbe" {channel="milight:rgbwwLed:98D86370BBAC:1:ledtemperature"}
Dimmer Buero_Colortemp_Alexa "Büro Farbe" {alexa="ColorTemperatureController.colorTemperatureInKelvin" [range="2700:6500"]}

rules

rule "Buero_Colortemp_Alexa Commands"
when
  Item Buero_Colortemp_Alexa received command
then
  Buero_Colortemp_Test.sendCommand(100 - receivedCommand as PercentType)
end

rule "Buero_Colortemp_Test Changes"
when
  Item Buero_Colortemp_Test changed
then
  Buero_Colortemp_Alexa.postUpdate(100 - Buero_Colortemp_Test.state as PercentType)
end
1 Like