nibi79 / worxlandroid

openHAB Binding for Worx Landroid
60 stars 20 forks source link

[Landroid V4] - Error while updating Mowing Times - No enum constant org.openhab.binding.worxlandroid.internal.codes.WorxLandroidDayCodes.friday #98

Closed FranzSchi closed 1 year ago

FranzSchi commented 1 year ago

Plugin: org.openhab.binding.worxlandroid-4.1.0-SNAPSHOT Openhab: 4.0.2 Mower: Landroid Worx S (WR103SI)

Thanks a lot for the Plugin and for the Support already

I've created a start Mowing date for Friday and want to set it. (Instead of Minutes and hours as before). But when I do so i get this error:

2023-08-04 12:19:52.826 [INFO ] [nhab.automation.script.ui.af230f0a67] - DayOfTheWeek is: FRI
2023-08-04 12:19:52.828 [INFO ] [nhab.automation.script.ui.af230f0a67] - Calculated Time to Start Mowing is: 2023-08-04T19:37+02:00

==> /var/log/openhab/events.log <==

2023-08-04 12:19:53.831 [INFO ] [openhab.event.ItemCommandEvent      ] - Item 'WorxLandroidS_FRI_ScheduleDuration' received command 89.0
2023-08-04 12:19:53.832 [INFO ] [penhab.event.ItemStatePredictedEvent] - Item 'WorxLandroidS_FRI_ScheduleDuration' predicted to become 89.0
2023-08-04 12:19:53.832 [INFO ] [openhab.event.ItemStateUpdatedEvent ] - Item 'WorxLandroidS_FRI_ScheduleDuration' updated to 89.0
2023-08-04 12:19:53.833 [INFO ] [openhab.event.ItemStateChangedEvent ] - Item 'WorxLandroidS_FRI_ScheduleDuration' changed from 90 to 89.0

==> /var/log/openhab/openhab.log <==

2023-08-04 12:19:53.837 [ERROR] [nal.common.AbstractInvocationHandler] - An error occurred while calling method 'ThingHandler.handleCommand()' on 'org.openhab.binding.worxlandroid.internal.handler.WorxLandroidMowerHandler@41fa4718': No enum constant org.openhab.binding.worxlandroid.internal.codes.WorxLandroidDayCodes.friday

java.lang.IllegalArgumentException: No enum constant org.openhab.binding.worxlandroid.internal.codes.WorxLandroidDayCodes.friday
    at java.lang.Enum.valueOf(Enum.java:273) ~[?:?]
    at org.openhab.binding.worxlandroid.internal.codes.WorxLandroidDayCodes.valueOf(WorxLandroidDayCodes.java:1) ~[?:?]
    at org.openhab.binding.worxlandroid.internal.handler.WorxLandroidMowerHandler.setScheduledDays(WorxLandroidMowerHandler.java:476) ~[?:?]
    at org.openhab.binding.worxlandroid.internal.handler.WorxLandroidMowerHandler.lambda$5(WorxLandroidMowerHandler.java:354) ~[?:?]
    at java.util.Optional.ifPresent(Optional.java:178) ~[?:?]
    at org.openhab.binding.worxlandroid.internal.handler.WorxLandroidMowerHandler.handleCommand(WorxLandroidMowerHandler.java:342) ~[?:?]
    at jdk.internal.reflect.GeneratedMethodAccessor58.invoke(Unknown Source) ~[?:?]
    at jdk.internal.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:43) ~[?:?]
    at java.lang.reflect.Method.invoke(Method.java:568) ~[?:?]
    at org.openhab.core.internal.common.AbstractInvocationHandler.invokeDirect(AbstractInvocationHandler.java:147) ~[?:?]
    at org.openhab.core.internal.common.InvocationHandlerSync.invoke(InvocationHandlerSync.java:59) ~[?:?]
    at jdk.proxy5786.$Proxy5945.handleCommand(Unknown Source) ~[?:?]
    at org.openhab.core.thing.internal.profiles.ProfileCallbackImpl.handleCommand(ProfileCallbackImpl.java:85) ~[?:?]
    at org.openhab.core.thing.internal.profiles.SystemDefaultProfile.onCommandFromItem(SystemDefaultProfile.java:48) ~[?:?]
    at jdk.internal.reflect.GeneratedMethodAccessor57.invoke(Unknown Source) ~[?:?]
    at jdk.internal.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:43) ~[?:?]
    at java.lang.reflect.Method.invoke(Method.java:568) ~[?:?]
    at org.openhab.core.internal.common.AbstractInvocationHandler.invokeDirect(AbstractInvocationHandler.java:147) ~[?:?]
    at org.openhab.core.internal.common.Invocation.call(Invocation.java:52) ~[?:?]
    at java.util.concurrent.FutureTask.run(FutureTask.java:264) ~[?:?]
    at java.util.concurrent.ThreadPoolExecutor.runWorker(ThreadPoolExecutor.java:1136) ~[?:?]
    at java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:635) ~[?:?]
    at java.lang.Thread.run(Thread.java:833) ~[?:?]

==> /var/log/openhab/events.log <==

2023-08-04 12:19:54.837 [INFO ] [openhab.event.ItemCommandEvent      ] - Item 'WorxLandroidS_FRI_StartTime' received command 2023-08-04T19:37:00.000+0200

2023-08-04 12:19:54.839 [INFO ] [penhab.event.ItemStatePredictedEvent] - Item 'WorxLandroidS_FRI_StartTime' predicted to become 2023-08-04T19:37:00.000+0200

2023-08-04 12:19:54.840 [INFO ] [openhab.event.ItemStateUpdatedEvent ] - Item 'WorxLandroidS_FRI_StartTime' updated to 2023-08-04T19:37:00.000+0200

2023-08-04 12:19:54.841 [INFO ] [openhab.event.ItemStateChangedEvent ] - Item 'WorxLandroidS_FRI_StartTime' changed from 2023-08-04T17:00:00.000+0200 to 2023-08-04T19:37:00.000+0200
clinique commented 1 year ago

Can you post the script so I can reproduce ?

clinique commented 1 year ago

Taking a look at it.

FranzSchi commented 1 year ago

Hey, thanks a lot @clinique,

Exact plugin Version is: 4.1.0.202307251039

So i do this: items.getItem('WorxLandroidS_MON_StartTime').sendCommand((time.ZonedDateTime.now()));

On this Channel: image

And get this error.

2023-08-21 13:30:17.928 [ERROR] [nal.common.AbstractInvocationHandler] - An error occurred while calling method 'ThingHandler.handleCommand()' on 'org.openhab.binding.worxlandroid.internal.handler.WorxLandroidMowerHandler@772dfdac': No enum constant org.openhab.binding.worxlandroid.internal.codes.WorxLandroidDayCodes.monday
java.lang.IllegalArgumentException: No enum constant org.openhab.binding.worxlandroid.internal.codes.WorxLandroidDayCodes.monday
    at java.lang.Enum.valueOf(Enum.java:273) ~[?:?]
    at org.openhab.binding.worxlandroid.internal.codes.WorxLandroidDayCodes.valueOf(WorxLandroidDayCodes.java:1) ~[?:?]
    at org.openhab.binding.worxlandroid.internal.handler.WorxLandroidMowerHandler.setScheduledDays(WorxLandroidMowerHandler.java:476) ~[?:?]
    at org.openhab.binding.worxlandroid.internal.handler.WorxLandroidMowerHandler.lambda$5(WorxLandroidMowerHandler.java:354) ~[?:?]
    at java.util.Optional.ifPresent(Optional.java:178) ~[?:?]
    at org.openhab.binding.worxlandroid.internal.handler.WorxLandroidMowerHandler.handleCommand(WorxLandroidMowerHandler.java:342) ~[?:?]
    at jdk.internal.reflect.GeneratedMethodAccessor63.invoke(Unknown Source) ~[?:?]
    at jdk.internal.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:43) ~[?:?]
    at java.lang.reflect.Method.invoke(Method.java:568) ~[?:?]
    at org.openhab.core.internal.common.AbstractInvocationHandler.invokeDirect(AbstractInvocationHandler.java:147) ~[?:?]
    at org.openhab.core.internal.common.InvocationHandlerSync.invoke(InvocationHandlerSync.java:59) ~[?:?]
    at jdk.proxy104817.$Proxy104976.handleCommand(Unknown Source) ~[?:?]
    at org.openhab.core.thing.internal.profiles.ProfileCallbackImpl.handleCommand(ProfileCallbackImpl.java:85) ~[?:?]
    at org.openhab.core.thing.internal.profiles.SystemDefaultProfile.onCommandFromItem(SystemDefaultProfile.java:48) ~[?:?]
    at jdk.internal.reflect.GeneratedMethodAccessor161.invoke(Unknown Source) ~[?:?]
    at jdk.internal.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:43) ~[?:?]
    at java.lang.reflect.Method.invoke(Method.java:568) ~[?:?]
    at org.openhab.core.internal.common.AbstractInvocationHandler.invokeDirect(AbstractInvocationHandler.java:147) ~[?:?]
    at org.openhab.core.internal.common.Invocation.call(Invocation.java:52) ~[?:?]
    at java.util.concurrent.FutureTask.run(FutureTask.java:264) ~[?:?]
    at java.util.concurrent.ThreadPoolExecutor.runWorker(ThreadPoolExecutor.java:1136) ~[?:?]
    at java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:635) ~[?:?]
    at java.lang.Thread.run(Thread.java:833) ~[?:?]
clinique commented 1 year ago

I found the error. Get ready for a patch soon.

FranzSchi commented 1 year ago

@clinique , if you want me to test please be so kind ans serve a Binary or a guide how to compile it to the "jar". THX

clinique commented 1 year ago

Here a link to last version : https://drive.google.com/file/d/1EU4APg4nf0R4uqrqOMzbjqeSXFeCEeg8/view?usp=drive_link

FranzSchi commented 1 year ago

Hi @clinique,

updated the plugin yesterday need to disable / enable the Things. !But in the End it worked! !THANK YOU SO MUCH!

Best Regards /Franz