Skinah / EspMilightHub

openHAB Binding for the esp8266milighthub
Eclipse Public License 2.0
0 stars 0 forks source link

java.math.BigDecimal cannot be cast to java.lang.Boolean #15

Closed stefanheijnen closed 4 years ago

stefanheijnen commented 4 years ago

Since the upgrade to OH 2.5.3 I see this error in my log:

2020-03-31 20:32:00.966 [ome.event.ItemCommandEvent] - Item 'gKeukenLightsLevel' received command 1
2020-03-31 20:32:00.990 [ome.event.ItemCommandEvent] - Item 'Milight_ID0x2_G1_Level' received command 1

==> /var/log/openhab2/openhab.log <==
2020-03-31 20:32:01.011 [ERROR] [nal.common.AbstractInvocationHandler] - An error occurred while calling method 'ThingHandler.handleCommand()' on 'org.openhab.binding.espmilighthub.handler.EspMilightHubHandler@426a10': java.math.BigDecimal cannot be cast to java.lang.Boolean
java.lang.ClassCastException: java.math.BigDecimal cannot be cast to java.lang.Boolean
        at org.openhab.binding.espmilighthub.handler.EspMilightHubBridgeHandler.get1TriggersNightMode(EspMilightHubBridgeHandler.java:547) ~[?:?]
        at org.openhab.binding.espmilighthub.handler.EspMilightHubHandler.handleCommand(EspMilightHubHandler.java:114) ~[?:?]
        at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method) ~[?:1.8.0_222]
        at sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:62) ~[?:1.8.0_222]
        at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:43) ~[?:1.8.0_222]
        at java.lang.reflect.Method.invoke(Method.java:498) ~[?:1.8.0_222]
        at org.eclipse.smarthome.core.internal.common.AbstractInvocationHandler.invokeDirect(AbstractInvocationHandler.java:152) [bundleFile:?]
        at org.eclipse.smarthome.core.internal.common.InvocationHandlerSync.invoke(InvocationHandlerSync.java:59) [bundleFile:?]
        at com.sun.proxy.$Proxy930.handleCommand(Unknown Source) [?:?]
        at org.eclipse.smarthome.core.thing.internal.profiles.ProfileCallbackImpl.handleCommand(ProfileCallbackImpl.java:74) [bundleFile:?]
        at org.eclipse.smarthome.core.thing.internal.profiles.SystemDefaultProfile.onCommandFromItem(SystemDefaultProfile.java:48) [bundleFile:?]
        at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method) ~[?:1.8.0_222]
        at sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:62) ~[?:1.8.0_222]
        at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:43) ~[?:1.8.0_222]
        at java.lang.reflect.Method.invoke(Method.java:498) ~[?:1.8.0_222]
        at org.eclipse.smarthome.core.internal.common.AbstractInvocationHandler.invokeDirect(AbstractInvocationHandler.java:152) [bundleFile:?]
        at org.eclipse.smarthome.core.internal.common.Invocation.call(Invocation.java:52) [bundleFile:?]
        at java.util.concurrent.FutureTask.run(FutureTask.java:266) [?:1.8.0_222]
        at java.util.concurrent.ThreadPoolExecutor.runWorker(ThreadPoolExecutor.java:1149) [?:1.8.0_222]
        at java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:624) [?:1.8.0_222]
        at java.lang.Thread.run(Thread.java:748) [?:1.8.0_222]

==> /var/log/openhab2/events.log <==
2020-03-31 20:32:01.020 [ome.event.ItemCommandEvent] - Item 'Milight_ID0x2_G2_Level' received command 1
2020-03-31 20:32:01.042 [nt.ItemStatePredictedEvent] - Milight_ID0x2_G1_Level predicted to become 1

==> /var/log/openhab2/openhab.log <==
2020-03-31 20:32:01.041 [ERROR] [nal.common.AbstractInvocationHandler] - An error occurred while calling method 'ThingHandler.handleCommand()' on 'org.openhab.binding.espmilighthub.handler.EspMilightHubHandler@12e8ce1': java.math.BigDecimal cannot be cast to java.lang.Boolean
java.lang.ClassCastException: java.math.BigDecimal cannot be cast to java.lang.Boolean
        at org.openhab.binding.espmilighthub.handler.EspMilightHubBridgeHandler.get1TriggersNightMode(EspMilightHubBridgeHandler.java:547) ~[?:?]
        at org.openhab.binding.espmilighthub.handler.EspMilightHubHandler.handleCommand(EspMilightHubHandler.java:114) ~[?:?]
        at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method) ~[?:1.8.0_222]
        at sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:62) ~[?:1.8.0_222]
        at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:43) ~[?:1.8.0_222]
        at java.lang.reflect.Method.invoke(Method.java:498) ~[?:1.8.0_222]
        at org.eclipse.smarthome.core.internal.common.AbstractInvocationHandler.invokeDirect(AbstractInvocationHandler.java:152) [bundleFile:?]
        at org.eclipse.smarthome.core.internal.common.InvocationHandlerSync.invoke(InvocationHandlerSync.java:59) [bundleFile:?]
        at com.sun.proxy.$Proxy932.handleCommand(Unknown Source) [?:?]
        at org.eclipse.smarthome.core.thing.internal.profiles.ProfileCallbackImpl.handleCommand(ProfileCallbackImpl.java:74) [bundleFile:?]
        at org.eclipse.smarthome.core.thing.internal.profiles.SystemDefaultProfile.onCommandFromItem(SystemDefaultProfile.java:48) [bundleFile:?]
        at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method) ~[?:1.8.0_222]
        at sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:62) ~[?:1.8.0_222]
        at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:43) ~[?:1.8.0_222]
        at java.lang.reflect.Method.invoke(Method.java:498) ~[?:1.8.0_222]
        at org.eclipse.smarthome.core.internal.common.AbstractInvocationHandler.invokeDirect(AbstractInvocationHandler.java:152) [bundleFile:?]
        at org.eclipse.smarthome.core.internal.common.Invocation.call(Invocation.java:52) [bundleFile:?]
        at java.util.concurrent.FutureTask.run(FutureTask.java:266) [?:1.8.0_222]
        at java.util.concurrent.ThreadPoolExecutor.runWorker(ThreadPoolExecutor.java:1149) [?:1.8.0_222]
        at java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:624) [?:1.8.0_222]
        at java.lang.Thread.run(Thread.java:748) [?:1.8.0_222]

==> /var/log/openhab2/events.log <==
2020-03-31 20:32:01.073 [nt.ItemStatePredictedEvent] - Milight_ID0x2_G2_Level predicted to become 1
2020-03-31 20:32:01.098 [vent.ItemStateChangedEvent] - Milight_ID0x2_G1_Level changed from 90 to 1
2020-03-31 20:32:01.110 [vent.ItemStateChangedEvent] - Milight_ID0x2_G2_Level changed from 90 to 1

It is when I change the level.

Dimmer Milight_ID0x2_G1_Level "Keukenlamp plafond" (gKeukenLightsLevel) {channel="espmilighthub:rgb_cct:milighthub_keuken:0x21:level"}

stefanheijnen commented 4 years ago

I've identified the error based on your post here: https://community.openhab.org/t/ipcamera-new-ip-camera-binding/42771/1003

1TRIGGERS_NIGHT_MODE=1 should be 1TRIGGERS_NIGHT_MODE=true.