[SOLVED] TPLink HS220 issue - Value must be between 0 and 100

Hi
I am having an issue with TPLink switch. It is working fine but log file has an exception. It is dimmer so I think I configured something wrong or Binding has an issue. I have configured everything in files:
Things:

Thing tplinksmarthome:hs220:DCD645 “Swiatlo w salonie” @ “salon” [ deviceId=“xxxD645” ]

Items:

Dimmer LivingRoom_Light_Dimmer “Dim” {channel=“tplinksmarthome:hs220:DCD645:brightness”}
Switch LivingRoom_Light_Switch “Switch” {channel=“tplinksmarthome:hs220:DCD645:brightness”}

My log file has exception:

2019-01-19 07:38:02.200 [ERROR] [ome.core.thing.link.ThingLinkManager] - Exception occurred while informing handler: 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:58) ~[?:?]
at org.eclipse.smarthome.core.library.types.PercentType.<init>(PercentType.java:53) ~[?:?]
at org.eclipse.smarthome.core.library.types.DecimalType.as(DecimalType.java:160) ~[?:?]
at org.eclipse.smarthome.core.internal.items.ItemStateConverterImpl.convertToAcceptedState(ItemStateConverterImpl.java:58) ~[?:?]
at org.eclipse.smarthome.core.thing.internal.profiles.ProfileCallbackImpl.sendUpdate(ProfileCallbackImpl.java:135) ~[?:?]
at org.eclipse.smarthome.core.thing.internal.profiles.SystemDefaultProfile.onStateUpdateFromHandler(SystemDefaultProfile.java:54) ~[?:?]
at org.eclipse.smarthome.core.thing.internal.CommunicationManager.lambda$9(CommunicationManager.java:477) ~[?:?]
at org.eclipse.smarthome.core.thing.internal.CommunicationManager.lambda$11(CommunicationManager.java:497) ~[?:?]
at java.lang.Iterable.forEach(Iterable.java:75) ~[?:?]
at org.eclipse.smarthome.core.thing.internal.CommunicationManager.handleCallFromHandler(CommunicationManager.java:493) ~[?:?]
at org.eclipse.smarthome.core.thing.internal.CommunicationManager.stateUpdated(CommunicationManager.java:475) ~[?:?]
at org.eclipse.smarthome.core.thing.internal.ThingManagerImpl$1.stateUpdated(ThingManagerImpl.java:167) ~[?:?]
at org.eclipse.smarthome.core.thing.binding.BaseThingHandler.updateState(BaseThingHandler.java:287) ~[?:?]
at org.openhab.binding.tplinksmarthome.internal.handler.SmartHomeHandler.updateChannelState(SmartHomeHandler.java:218) ~[?:?]
at org.openhab.binding.tplinksmarthome.internal.handler.SmartHomeHandler.handleCommand(SmartHomeHandler.java:76) ~[?:?]
at org.eclipse.smarthome.core.thing.binding.BaseThingHandler.channelLinked(BaseThingHandler.java:233) ~[?:?]
at org.eclipse.smarthome.core.thing.link.ThingLinkManager.lambda$0(ThingLinkManager.java:300) ~[?:?]
at java.util.concurrent.Executors$RunnableAdapter.call(Executors.java:511) [?:?]
at java.util.concurrent.FutureTask.run(FutureTask.java:266) [?:?]
at java.util.concurrent.ScheduledThreadPoolExecutor$ScheduledFutureTask.access$201(ScheduledThreadPoolExecutor.java:180) [?:?]
at java.util.concurrent.ScheduledThreadPoolExecutor$ScheduledFutureTask.run(ScheduledThreadPoolExecutor.java:293) [?:?]
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) [?:?]

When I set binding to TRACE mode it doesn’t give me more information beside I know which device is making an issue. Any ideas? Am I doing something wrong her?

Binding 2.4 from PaperUI

What value are you setting your dimmer to just before this log?
Can you show the events.log too, please?

this happens randomly but always when OH starts. Events log file doesn’t contain any valuable information (only about devices being added).

I am getting the exact same issue. Running Openhab 2.4. Only difference for me is my things and items are all added in files. Not using PaperUI. If I comment out the HS220 items, The error goes away. As stated by the OP, it happens randomly but always when the server starts. So there is no value set yet.

I am at a loss as to what is causing this. As far as I can tell, my things and items are configured correctly.

Thing:

Thing tplinksmarthome:hs220:SconcesDimmer “Master Bedroom Sconce’s Dimmer” [ ipAddress=“192.168.2.120”, refresh=1 ]

Items:

Switch MasterSconces_Switch “Master bedroom Sconces Switch” { channel=“tplinksmarthome:hs220:SconcesDimmer:brightness” }
Dimmer MasterSconces_Dimmer “Master bedroom Sconces Switch” { channel=“tplinksmarthome:hs220:SconcesDimmer:brightness” }

As the OP also stated, nothing unusually in the events log. Only the long error in the opehab.log

Openhab.log

2019-01-22 08:21:22.501 [WARN ] [mmon.WrappedScheduledExecutorService] - Scheduled runnable ended with an exception:
java.lang.IllegalArgumentException: Value must be between 0 and 100
at org.eclipse.smarthome.core.library.types.PercentType.validateValue(PercentType.java:58) ~[?:?]
at org.eclipse.smarthome.core.library.types.PercentType.(PercentType.java:53) ~[?:?]
at org.eclipse.smarthome.core.library.types.DecimalType.as(DecimalType.java:160) ~[?:?]
at org.eclipse.smarthome.core.internal.items.ItemStateConverterImpl.convertToAcceptedState(ItemStateConverterImpl.java:58) ~[?:?]
at org.eclipse.smarthome.core.thing.internal.profiles.ProfileCallbackImpl.sendUpdate(ProfileCallbackImpl.java:135) ~[?:?]
at org.eclipse.smarthome.core.thing.internal.profiles.SystemDefaultProfile.onStateUpdateFromHandler(SystemDefaultProfile.java:54) ~[?:?]
at org.eclipse.smarthome.core.thing.internal.CommunicationManager.lambda$9(CommunicationManager.java:477) ~[?:?]
at org.eclipse.smarthome.core.thing.internal.CommunicationManager.lambda$11(CommunicationManager.java:497) ~[?:?]
at java.lang.Iterable.forEach(Iterable.java:75) ~[?:?]
at org.eclipse.smarthome.core.thing.internal.CommunicationManager.handleCallFromHandler(CommunicationManager.java:493) ~[?:?]
at org.eclipse.smarthome.core.thing.internal.CommunicationManager.stateUpdated(CommunicationManager.java:475) ~[?:?]
at org.eclipse.smarthome.core.thing.internal.ThingManagerImpl$1.stateUpdated(ThingManagerImpl.java:167) ~[?:?]
at org.eclipse.smarthome.core.thing.binding.BaseThingHandler.updateState(BaseThingHandler.java:287) ~[?:?]
at org.openhab.binding.tplinksmarthome.internal.handler.SmartHomeHandler.updateChannelState(SmartHomeHandler.java:218) ~[?:?]
at org.openhab.binding.tplinksmarthome.internal.handler.SmartHomeHandler.lambda$2(SmartHomeHandler.java:197) ~[?:?]
at java.util.ArrayList.forEach(ArrayList.java:1257) ~[?:?]
at java.util.Collections$UnmodifiableCollection.forEach(Collections.java:1080) ~[?:?]
at org.openhab.binding.tplinksmarthome.internal.handler.SmartHomeHandler.refreshChannels(SmartHomeHandler.java:197) ~[?:?]
at java.util.concurrent.Executors$RunnableAdapter.call(Executors.java:511) ~[?:?]
at java.util.concurrent.FutureTask.runAndReset(FutureTask.java:308) ~[?:?]
at java.util.concurrent.ScheduledThreadPoolExecutor$ScheduledFutureTask.access$301(ScheduledThreadPoolExecutor.java:180) ~[?:?]
at java.util.concurrent.ScheduledThreadPoolExecutor$ScheduledFutureTask.run(ScheduledThreadPoolExecutor.java:294) ~[?:?]
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) [?:?]

Any guidance would be greatly appreciated.
Jason…

https://community.openhab.org/search?q=TPLink%20HS220

The short answer is: install the Eclipse Market place version of the binding.

Short answers are good. Especially when they work. That worked perfectly for me. Thank you.

Jason…

Well so why there is a binding which is not good at OH PaperUI? Isn’t official repository for such things? It is very confusing.

The binding in the release contains a bug. openHAB release versions only have the version with the release. If you would run openHAB snapshot version you would have the fixed version.
The eclipse market place is the only way to provide bindings installable from within paperui. So there I have put a fixed version of the binding. Hopefully this makes it a bit clearer.

So when there will be an update for OH this package will be included? I mean that’s the app flow - release1 -> bug report -> fix available in snapshot version -> fix verification -> stable develop version -> full regression -> release version -> fetch all newest release versions of components when releasing new OH?

Yes

Basically yes. But via the eclipse market place it’s possible to get this binding updated earlier and not having to wait for the next release.

Is there an non-issue way to switch the binding? I assume I need to uninstall previous one and put .jar to a new folder - which one?
What if I have Things setup in PaperUI not in a files? Will I loose them I have to start over?

Yes you need to uninstall the binding. This doesn’t remove things or items. You don’t need to copy a jar. Just enable the eclipse market place in paperui in onfiguration with level beta and the binding will show up in the binding list.