eclipse-archived / smarthome

Eclipse SmartHome™ project
https://www.eclipse.org/smarthome/
Eclipse Public License 2.0
862 stars 787 forks source link

Problem with Homematic Binding and Device HM-TC-IT-WM-W-EU (QuantityTypeConverter) #6802

Closed dvehof closed 5 years ago

dvehof commented 5 years ago

Hi,

I am using OpenHAB 2.4 and I got a problem to control my Wireless Room Thermostats (HM-TC-IT-WM-W-EU). Changing the mode or trying to set a temperature using the app do not change anything and I get the following error in my log:

2019-01-04 09:55:21.223 [ERROR] [ematic.handler.HomematicThingHandler] - null
java.lang.NullPointerException: null
    at org.eclipse.smarthome.binding.homematic.internal.converter.type.QuantityTypeConverter.toBinding(QuantityTypeConverter.java:58) ~[198:org.eclipse.smarthome.binding.homematic:0.10.0.oh240]
    at org.eclipse.smarthome.binding.homematic.internal.converter.type.QuantityTypeConverter.toBinding(QuantityTypeConverter.java:1) ~[198:org.eclipse.smarthome.binding.homematic:0.10.0.oh240]
    at org.eclipse.smarthome.binding.homematic.internal.converter.type.AbstractTypeConverter.convertToBinding(AbstractTypeConverter.java:102) ~[198:org.eclipse.smarthome.binding.homematic:0.10.0.oh240]
    at org.eclipse.smarthome.binding.homematic.handler.HomematicThingHandler.handleCommand(HomematicThingHandler.java:281) [198:org.eclipse.smarthome.binding.homematic:0.10.0.oh240]
    at sun.reflect.GeneratedMethodAccessor178.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) [102:org.eclipse.smarthome.core:0.10.0.oh240]
    at org.eclipse.smarthome.core.internal.common.InvocationHandlerSync.invoke(InvocationHandlerSync.java:59) [102:org.eclipse.smarthome.core:0.10.0.oh240]
    at com.sun.proxy.$Proxy139.handleCommand(Unknown Source) [198:org.eclipse.smarthome.binding.homematic:0.10.0.oh240]
    at org.eclipse.smarthome.core.thing.internal.profiles.ProfileCallbackImpl.handleCommand(ProfileCallbackImpl.java:75) [109:org.eclipse.smarthome.core.thing:0.10.0.oh240]
    at org.eclipse.smarthome.core.thing.internal.profiles.SystemDefaultProfile.onCommandFromItem(SystemDefaultProfile.java:49) [109:org.eclipse.smarthome.core.thing:0.10.0.oh240]
    at sun.reflect.GeneratedMethodAccessor177.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) [102:org.eclipse.smarthome.core:0.10.0.oh240]
    at org.eclipse.smarthome.core.internal.common.Invocation.call(Invocation.java:53) [102:org.eclipse.smarthome.core:0.10.0.oh240]
    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) [?:?]

gerrieg told me I should ask you, @mdicke2s if you maybe have a clue as you implemented the converter and gerrieg is currently on vacation.

Thanks and greets

MHerbst commented 5 years ago

Did this happen after the update to OH 2.4? If yes and if you are using PaperUI you can try the following:

  1. remove the thermostat thing
  2. run autodiscovery again
  3. add the thing again

I have got three of these devices and all are working correctly with OH 2.4.

dvehof commented 5 years ago

Thanks for the hint, I'll try to readd the things later (using text configuration).

dvehof commented 5 years ago

@MHerbst : I removed the thing from my homematic.things file, readded the thing but sadly it didn't help and the error remains. A bit strange that the same devices work for you.

dvehof commented 5 years ago

TRACE log of homematic binding in addition (if it helps):

2019-01-06 14:11:41.240 [DEBUG] [ematic.handler.HomematicThingHandler] - Received command '21.0 C' for channel 'homematic:HM-TC-IT-WM-W-EU:ccu:XXXXXXXX:2#SET_TEMPERATURE'
2019-01-06 14:11:41.243 [TRACE] [converter.type.AbstractTypeConverter] - Converting type QuantityType with value '21.0 C' to FLOAT value with QuantityTypeConverter for 'XXXXXXXX:2#SET_TEMPERATURE'
2019-01-06 14:11:41.246 [ERROR] [ematic.handler.HomematicThingHandler] - null
dvehof commented 5 years ago

I had a short look at the QuantityTypeConverter Class. The above TRACE shows "21.0 C" and if i look at the class it seems to expect "21 °C". As i look at my older Wireless Room Thermostat Devices (HM-CC-TC) accodring to the TRACE they seem to send "21 °C" (and they work).

@MHerbst : maybe you can enable TRACE logging for the homematic binding and have a look what command is sent if you change the temperature? Maybe this is dependent on the firmware of the device? Mine are on 1.4.

I set TRACE using karaf:

log:set TRACE org.eclipse.smarthome.binding.homematic
MHerbst commented 5 years ago

I don't think that it has to do with the device firmware (I have got 1.4 too) because as far as I understand it, the problem happens before the data is sent to the device. I have tried it with log set to DEBUB (because TRACE gives to many information). This is my output:

17:01:35.513 [DEBUG] [mematic.handler.HomematicThingHandler] - Received command '20.0 °C' for channel 'homematic:HM-TC-IT-WM-W-EU:3014F711A0001F58A992F7F2:MEQ0863365:2#SET_TEMPERATURE'
17:01:35.524 [DEBUG] [communicator.AbstractHomematicGateway] - Sending datapoint 'MEQ0863365:2#SET_TEMPERATURE' with value '20.0' to gateway with id '3014F711A0001F58A992F7F2' using rxMode 'DEFAULT'

How did you define your items? I am using an .items file with following definition:

Number  HM_Buero_Temp_Set "Solltemperatur [%.1f °C]"    <temperature> {channel="homematic:HM-TC-IT-WM-W-EU:3014F711A0001F58A992F7F2:OEQ1667729:2#SET_TEMPERATURE"}

Here it is very important to add the "°" before the C. If I remove it, I get exactly the same error as you got.

dvehof commented 5 years ago

Hi @MHerbst , thanks a lot for that hint! I only got "C" and not "°C" in my item definition. I changed that and that did the trick. Not sure if I like the fact that the item must be defined that way but it works and thats the important part. So again thanks for your thoughts and time @MHerbst .

I will close the issue as I suppose it is working the way it is intended.