frejos / openhab-wizlighting

Openhab binding for Wiz Lighting based devices
Eclipse Public License 2.0
6 stars 1 forks source link

DecimalType errors #1

Closed xanderificnl closed 11 months ago

xanderificnl commented 11 months ago

Hi,

I'm on OH4 (milestone 5) and it seems OH's API might have changed because the log is showing this:

2023-07-20 04:25:34.220 [ERROR] [nal.common.AbstractInvocationHandler] - An error occurred while calling method 'ThingHandler.handleCommand()' on 'org.openhab.binding.wizlighting.internal.handler.WizLightingHandler@32451361': 'void org.openhab.core.library.types.DecimalType.<init>(long)'
java.lang.NoSuchMethodError: 'void org.openhab.core.library.types.DecimalType.<init>(long)'
        at org.openhab.binding.wizlighting.internal.handler.WizLightingHandler.updateStatesFromParams(WizLightingHandler.java:558) ~[?:?]
        at org.openhab.binding.wizlighting.internal.handler.WizLightingHandler.getPilot(WizLightingHandler.java:424) ~[?:?]
        at org.openhab.binding.wizlighting.internal.handler.WizLightingHandler.setPilotCommand(WizLightingHandler.java:622) ~[?:?]
        at org.openhab.binding.wizlighting.internal.handler.WizLightingHandler.handleHSBCommand(WizLightingHandler.java:233) ~[?:?]
        at org.openhab.binding.wizlighting.internal.handler.WizLightingHandler.handleCommand(WizLightingHandler.java:131) ~[?:?]
        at jdk.internal.reflect.NativeMethodAccessorImpl.invoke0(Native Method) ~[?:?]
        at jdk.internal.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:77) ~[?:?]
        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.proxy63.$Proxy191.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.NativeMethodAccessorImpl.invoke0(Native Method) ~[?:?]
        at jdk.internal.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:77) ~[?:?]
        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) ~[?:?]

I've not tested the binding extensively, but the error doesn't appear to impede functionality beyond a glitch where the color sliders sometimes disappear - my automations all do seem to work without issue.

Cheers,

xanderificnl commented 11 months ago

I did actually encounter problems with heartbeats, after a bit of digging I managed to use maven against 4.1.0-SNAPSHOT to generate a new jar. So it was probably linked against/for an older OH.

frejos commented 11 months ago

It was certainly built for the 3.4.x branch, I have built a version off of the 4.0.0 upstream tag but haven't had a chance to test it.

https://github.com/frejos/openhab-wizlighting/releases/tag/4.0.0.01.alpha

xanderificnl commented 11 months ago

It was certainly built for the 3.4.x branch, I have built a version off of the 4.0.0 upstream tag but haven't had a chance to test it.

4.0.0.01.alpha (release)

If my temporary build is any indication the alpha will work flawlessly. I've replaced my build with the alpha and will report back if there's an issue.

Cheers, I very much appreciate the integration!

xanderificnl commented 11 months ago

The Wiz lights binding works flawlessly with HomeKit, Alexa, and automations (via jrubyscripting). Existing devices function well, but I couldn't auto-discover new bulbs using the 4.0.0.01-ALPHA.jar and 4.0.0.02.jar files – only one .jar-file was present at a time.

Interestingly, there seemed to be a disconnect between the backend and the UI. Although the logs indicated the binding was loaded, the UI's addon section didn't show it as installed. Moreover, the binding didn't appear in the "add things" wizard. To resolve this, I removed the .jar-file from the addons directory and installed the binding via the UI. That did the trick, and now everything works fine.

Unfortunately, I didn't preserve the logs (they got rotated due to restarts), so I'm unsure if this issue was a bug or a fluke. Just in case someone else encounters this, I wanted to share how I resolved it.

Thanks again for the binding; it's been a fantastic addition! Wishing you all the best!