Ok i will clarify my situation.
- I have this LED Wifi Controller
- I am on Ubuntu 17.10 (GNU/Linux 4.13.0-43-generic x86_64)
- I am on openHAB 2.2.0 Release Build
- Paper UI recognize the controller as wifiled:wifiled:6001949113D8 and the driver used is CLASSIC and protocol used is LD382A
My items/wifiled.items is:
Switch Bedroom_Light_2 "Led" <light> (Bedroom, gLight) {channel="wifiled:wifiled:6001949113D8:power"}
Color Bedroom_Color "Color" <colorlight> (Bedroom, gLight) {channel="wifiled:wifiled:6001949113D8:color"}
With this rules/wifiled.rules:
rule "Wifi led"
when
Item Bedroom_Color received command
then
if (receivedCommand instanceof HSBType) {
val red = (Bedroom_Color.state as HSBType).red * 255
val green = (Bedroom_Color.state as HSBType).green * 255
val blue = (Bedroom_Color.state as HSBType).blue * 255
val newColor = new Color(red.intValue, green.intValue, blue.intValue)
Bedroom_Color_2.sendCommand(new HSBType(newColor))
}
end
My log is:
2018-05-25 12:58:07.015 [ome.event.ItemCommandEvent] - Item âBedroom_Colorâ received command 312,70,100
2018-05-25 12:58:07.020 [ERROR] [ntime.internal.engine.RuleEngineImpl] - Rule âWifi ledâ: An error occurred during the script execution: null
2018-05-25 12:58:07.023 [vent.ItemStateChangedEvent] - Bedroom_Color changed from 52,98,100 to 312,70,100
2018-05-25 12:58:07.128 [ERROR] [nal.common.AbstractInvocationHandler] - An error occurred while calling method âThingHandler.handleCommand()â on âorg.openhab.binding.wifiled.handler.WiFiLEDHandler@6f0a35b9â: Value must be between 0 and 100
java.lang.IllegalArgumentException: Value must be between 0 and 100
at org.eclipse.smarthome.core.library.types.PercentType.validateValue(PercentType.java:55) [109:org.eclipse.smarthome.core:0.10.0.b1]
at org.eclipse.smarthome.core.library.types.PercentType.(PercentType.java:40) [109:org.eclipse.smarthome.core:0.10.0.b1]
at org.openhab.binding.wifiled.handler.LEDStateDTO.valueOf(LEDStateDTO.java:84) [241:org.openhab.binding.wifiled:2.2.0]
at org.openhab.binding.wifiled.handler.ClassicWiFiLEDDriver.getLEDStateDTO(ClassicWiFiLEDDriver.java:47) [241:org.openhab.binding.wifiled:2.2.0]
at org.openhab.binding.wifiled.handler.ClassicWiFiLEDDriver.setColor(ClassicWiFiLEDDriver.java:54) [241:org.openhab.binding.wifiled:2.2.0]
at org.openhab.binding.wifiled.handler.WiFiLEDHandler.handleColorCommand(WiFiLEDHandler.java:128) [241:org.openhab.binding.wifiled:2.2.0]
at org.openhab.binding.wifiled.handler.WiFiLEDHandler.handleCommand(WiFiLEDHandler.java:110) [241:org.openhab.binding.wifiled:2.2.0]
at sun.reflect.GeneratedMethodAccessor58.invoke(Unknown Source) ~[?:?]
at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:43) ~[?:?]
at java.lang.reflect.Method.invoke(Method.java:498) ~[?:?]
at org.eclipse.smarthome.core.internal.common.AbstractInvocationHandler.invokeDirect(AbstractInvocationHandler.java:153) [109:org.eclipse.smarthome.core:0.10.0.b1]
at org.eclipse.smarthome.core.internal.common.InvocationHandlerSync.invoke(InvocationHandlerSync.java:59) [109:org.eclipse.smarthome.core:0.10.0.b1]
at com.sun.proxy.$Proxy139.handleCommand(Unknown Source) [241:org.openhab.binding.wifiled:2.2.0]
at org.eclipse.smarthome.core.thing.internal.profiles.ProfileCallbackImpl.handleCommand(ProfileCallbackImpl.java:72) [116:org.eclipse.smarthome.core.thing:0.10.0.b1]
at org.eclipse.smarthome.core.thing.internal.profiles.SystemDefaultProfile.onCommandFromItem(SystemDefaultProfile.java:49) [116:org.eclipse.smarthome.core.thing:0.10.0.b1]
at sun.reflect.GeneratedMethodAccessor57.invoke(Unknown Source) ~[?:?]
at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:43) ~[?:?]
at java.lang.reflect.Method.invoke(Method.java:498) ~[?:?]
at org.eclipse.smarthome.core.internal.common.AbstractInvocationHandler.invokeDirect(AbstractInvocationHandler.java:153) [109:org.eclipse.smarthome.core:0.10.0.b1]
at org.eclipse.smarthome.core.internal.common.Invocation.call(Invocation.java:53) [109:org.eclipse.smarthome.core:0.10.0.b1]
at java.util.concurrent.FutureTask.run(FutureTask.java:266) [?:?]
at java.util.concurrent.ThreadPoolExecutor.runWorker(ThreadPoolExecutor.java:1149) [?:?]
at java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:624) [?:?]
at java.lang.Thread.run(Thread.java:748) [?:?]
With this rules/wifiled.rules:
rule "Wifi led"
when
Item Bedroom_Color received command
then
if (receivedCommand instanceof HSBType) {
val red = (Bedroom_Color.state as HSBType).red * 2.55
val green = (Bedroom_Color.state as HSBType).green * 2.55
val blue = (Bedroom_Color.state as HSBType).blue * 2.55
val newColor = new Color(red.intValue, green.intValue, blue.intValue)
Bedroom_Color_2.sendCommand(new HSBType(newColor))
}
end
My log is:
2018-05-25 13:01:00.632 [ome.event.ItemCommandEvent] - Item âBedroom_Colorâ received command 59,97,100
2018-05-25 13:01:00.638 [vent.ItemStateChangedEvent] - Bedroom_Color changed from 92,89,100 to 59,97,100
2018-05-25 13:01:00.640 [ERROR] [ntime.internal.engine.RuleEngineImpl] - Rule âWifi ledâ: An error occurred during the script execution: null
2018-05-25 13:01:00.748 [ERROR] [nal.common.AbstractInvocationHandler] - An error occurred while calling method âThingHandler.handleCommand()â on âorg.openhab.binding.wifiled.handler.WiFiLEDHandler@6f0a35b9â: Value must be between 0 and 100
java.lang.IllegalArgumentException: Value must be between 0 and 100
at org.eclipse.smarthome.core.library.types.PercentType.validateValue(PercentType.java:55) [109:org.eclipse.smarthome.core:0.10.0.b1]
at org.eclipse.smarthome.core.library.types.PercentType.(PercentType.java:40) [109:org.eclipse.smarthome.core:0.10.0.b1]
at org.openhab.binding.wifiled.handler.LEDStateDTO.valueOf(LEDStateDTO.java:84) [241:org.openhab.binding.wifiled:2.2.0]
at org.openhab.binding.wifiled.handler.ClassicWiFiLEDDriver.getLEDStateDTO(ClassicWiFiLEDDriver.java:47) [241:org.openhab.binding.wifiled:2.2.0]
at org.openhab.binding.wifiled.handler.ClassicWiFiLEDDriver.setColor(ClassicWiFiLEDDriver.java:54) [241:org.openhab.binding.wifiled:2.2.0]
at org.openhab.binding.wifiled.handler.WiFiLEDHandler.handleColorCommand(WiFiLEDHandler.java:128) [241:org.openhab.binding.wifiled:2.2.0]
at org.openhab.binding.wifiled.handler.WiFiLEDHandler.handleCommand(WiFiLEDHandler.java:110) [241:org.openhab.binding.wifiled:2.2.0]
at sun.reflect.GeneratedMethodAccessor58.invoke(Unknown Source) ~[?:?]
at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:43) ~[?:?]
at java.lang.reflect.Method.invoke(Method.java:498) ~[?:?]
at org.eclipse.smarthome.core.internal.common.AbstractInvocationHandler.invokeDirect(AbstractInvocationHandler.java:153) [109:org.eclipse.smarthome.core:0.10.0.b1]
at org.eclipse.smarthome.core.internal.common.InvocationHandlerSync.invoke(InvocationHandlerSync.java:59) [109:org.eclipse.smarthome.core:0.10.0.b1]
at com.sun.proxy.$Proxy139.handleCommand(Unknown Source) [241:org.openhab.binding.wifiled:2.2.0]
at org.eclipse.smarthome.core.thing.internal.profiles.ProfileCallbackImpl.handleCommand(ProfileCallbackImpl.java:72) [116:org.eclipse.smarthome.core.thing:0.10.0.b1]
at org.eclipse.smarthome.core.thing.internal.profiles.SystemDefaultProfile.onCommandFromItem(SystemDefaultProfile.java:49) [116:org.eclipse.smarthome.core.thing:0.10.0.b1]
at sun.reflect.GeneratedMethodAccessor57.invoke(Unknown Source) ~[?:?]
at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:43) ~[?:?]
at java.lang.reflect.Method.invoke(Method.java:498) ~[?:?]
at org.eclipse.smarthome.core.internal.common.AbstractInvocationHandler.invokeDirect(AbstractInvocationHandler.java:153) [109:org.eclipse.smarthome.core:0.10.0.b1]
at org.eclipse.smarthome.core.internal.common.Invocation.call(Invocation.java:53) [109:org.eclipse.smarthome.core:0.10.0.b1]
at java.util.concurrent.FutureTask.run(FutureTask.java:266) [?:?]
at java.util.concurrent.ThreadPoolExecutor.runWorker(ThreadPoolExecutor.java:1149) [?:?]
at java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:624) [?:?]
at java.lang.Thread.run(Thread.java:748) [?:?]
2018-05-25 13:01:00.939 [ome.event.ItemCommandEvent] - Item âBedroom_Colorâ received command 70,94,100
2018-05-25 13:01:00.941 [vent.ItemStateChangedEvent] - Bedroom_Color changed from 59,97,100 to 70,94,100
2018-05-25 13:01:00.942 [ERROR] [ntime.internal.engine.RuleEngineImpl] - Rule âWifi ledâ: An error occurred during the script execution: null
2018-05-25 13:01:01.092 [ERROR] [nal.common.AbstractInvocationHandler] - An error occurred while calling method âThingHandler.handleCommand()â on âorg.openhab.binding.wifiled.handler.WiFiLEDHandler@6f0a35b9â: Value must be between 0 and 100
java.lang.IllegalArgumentException: Value must be between 0 and 100
at org.eclipse.smarthome.core.library.types.PercentType.validateValue(PercentType.java:55) [109:org.eclipse.smarthome.core:0.10.0.b1]
at org.eclipse.smarthome.core.library.types.PercentType.(PercentType.java:40) [109:org.eclipse.smarthome.core:0.10.0.b1]
at org.openhab.binding.wifiled.handler.LEDStateDTO.valueOf(LEDStateDTO.java:84) [241:org.openhab.binding.wifiled:2.2.0]
at org.openhab.binding.wifiled.handler.ClassicWiFiLEDDriver.getLEDStateDTO(ClassicWiFiLEDDriver.java:47) [241:org.openhab.binding.wifiled:2.2.0]
at org.openhab.binding.wifiled.handler.ClassicWiFiLEDDriver.setColor(ClassicWiFiLEDDriver.java:54) [241:org.openhab.binding.wifiled:2.2.0]
at org.openhab.binding.wifiled.handler.WiFiLEDHandler.handleColorCommand(WiFiLEDHandler.java:128) [241:org.openhab.binding.wifiled:2.2.0]
at org.openhab.binding.wifiled.handler.WiFiLEDHandler.handleCommand(WiFiLEDHandler.java:110) [241:org.openhab.binding.wifiled:2.2.0]
at sun.reflect.GeneratedMethodAccessor58.invoke(Unknown Source) ~[?:?]
at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:43) ~[?:?]
at java.lang.reflect.Method.invoke(Method.java:498) ~[?:?]
at org.eclipse.smarthome.core.internal.common.AbstractInvocationHandler.invokeDirect(AbstractInvocationHandler.java:153) [109:org.eclipse.smarthome.core:0.10.0.b1]
at org.eclipse.smarthome.core.internal.common.InvocationHandlerSync.invoke(InvocationHandlerSync.java:59) [109:org.eclipse.smarthome.core:0.10.0.b1]
at com.sun.proxy.$Proxy139.handleCommand(Unknown Source) [241:org.openhab.binding.wifiled:2.2.0]
at org.eclipse.smarthome.core.thing.internal.profiles.ProfileCallbackImpl.handleCommand(ProfileCallbackImpl.java:72) [116:org.eclipse.smarthome.core.thing:0.10.0.b1]
at org.eclipse.smarthome.core.thing.internal.profiles.SystemDefaultProfile.onCommandFromItem(SystemDefaultProfile.java:49) [116:org.eclipse.smarthome.core.thing:0.10.0.b1]
at sun.reflect.GeneratedMethodAccessor57.invoke(Unknown Source) ~[?:?]
at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:43) ~[?:?]
at java.lang.reflect.Method.invoke(Method.java:498) ~[?:?]
at org.eclipse.smarthome.core.internal.common.AbstractInvocationHandler.invokeDirect(AbstractInvocationHandler.java:153) [109:org.eclipse.smarthome.core:0.10.0.b1]
at org.eclipse.smarthome.core.internal.common.Invocation.call(Invocation.java:53) [109:org.eclipse.smarthome.core:0.10.0.b1]
at java.util.concurrent.FutureTask.run(FutureTask.java:266) [?:?]
at java.util.concurrent.ThreadPoolExecutor.runWorker(ThreadPoolExecutor.java:1149) [?:?]
at java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:624) [?:?]
at java.lang.Thread.run(Thread.java:748) [?:?]
2018-05-25 13:01:01.236 [ome.event.ItemCommandEvent] - Item âBedroom_Colorâ received command 75,96,100
2018-05-25 13:01:01.238 [vent.ItemStateChangedEvent] - Bedroom_Color changed from 70,94,100 to 75,96,100
2018-05-25 13:01:01.245 [ERROR] [ntime.internal.engine.RuleEngineImpl] - Rule âWifi ledâ: An error occurred during the script execution: null
2018-05-25 13:01:01.345 [ERROR] [nal.common.AbstractInvocationHandler] - An error occurred while calling method âThingHandler.handleCommand()â on âorg.openhab.binding.wifiled.handler.WiFiLEDHandler@6f0a35b9â: Value must be between 0 and 100
java.lang.IllegalArgumentException: Value must be between 0 and 100
at org.eclipse.smarthome.core.library.types.PercentType.validateValue(PercentType.java:55) [109:org.eclipse.smarthome.core:0.10.0.b1]
at org.eclipse.smarthome.core.library.types.PercentType.(PercentType.java:40) [109:org.eclipse.smarthome.core:0.10.0.b1]
at org.openhab.binding.wifiled.handler.LEDStateDTO.valueOf(LEDStateDTO.java:84) [241:org.openhab.binding.wifiled:2.2.0]
at org.openhab.binding.wifiled.handler.ClassicWiFiLEDDriver.getLEDStateDTO(ClassicWiFiLEDDriver.java:47) [241:org.openhab.binding.wifiled:2.2.0]
at org.openhab.binding.wifiled.handler.ClassicWiFiLEDDriver.setColor(ClassicWiFiLEDDriver.java:54) [241:org.openhab.binding.wifiled:2.2.0]
at org.openhab.binding.wifiled.handler.WiFiLEDHandler.handleColorCommand(WiFiLEDHandler.java:128) [241:org.openhab.binding.wifiled:2.2.0]
at org.openhab.binding.wifiled.handler.WiFiLEDHandler.handleCommand(WiFiLEDHandler.java:110) [241:org.openhab.binding.wifiled:2.2.0]
at sun.reflect.GeneratedMethodAccessor58.invoke(Unknown Source) ~[?:?]
at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:43) ~[?:?]
at java.lang.reflect.Method.invoke(Method.java:498) ~[?:?]
at org.eclipse.smarthome.core.internal.common.AbstractInvocationHandler.invokeDirect(AbstractInvocationHandler.java:153) [109:org.eclipse.smarthome.core:0.10.0.b1]
at org.eclipse.smarthome.core.internal.common.InvocationHandlerSync.invoke(InvocationHandlerSync.java:59) [109:org.eclipse.smarthome.core:0.10.0.b1]
at com.sun.proxy.$Proxy139.handleCommand(Unknown Source) [241:org.openhab.binding.wifiled:2.2.0]
at org.eclipse.smarthome.core.thing.internal.profiles.ProfileCallbackImpl.handleCommand(ProfileCallbackImpl.java:72) [116:org.eclipse.smarthome.core.thing:0.10.0.b1]
at org.eclipse.smarthome.core.thing.internal.profiles.SystemDefaultProfile.onCommandFromItem(SystemDefaultProfile.java:49) [116:org.eclipse.smarthome.core.thing:0.10.0.b1]
at sun.reflect.GeneratedMethodAccessor57.invoke(Unknown Source) ~[?:?]
at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:43) ~[?:?]
at java.lang.reflect.Method.invoke(Method.java:498) ~[?:?]
at org.eclipse.smarthome.core.internal.common.AbstractInvocationHandler.invokeDirect(AbstractInvocationHandler.java:153) [109:org.eclipse.smarthome.core:0.10.0.b1]
at org.eclipse.smarthome.core.internal.common.Invocation.call(Invocation.java:53) [109:org.eclipse.smarthome.core:0.10.0.b1]
at java.util.concurrent.FutureTask.run(FutureTask.java:266) [?:?]
at java.util.concurrent.ThreadPoolExecutor.runWorker(ThreadPoolExecutor.java:1149) [?:?]
at java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:624) [?:?]
at java.lang.Thread.run(Thread.java:748) [?:?]
Whatâs wrong? Thanks