Homematic thermostat - Can't convert type QuantityType with value

homematic
thermostat
openhab-24
Tags: #<Tag:0x00007f51df20fbd8> #<Tag:0x00007f51df20fa98> #<Tag:0x00007f51df20f958>

(Johannes Nabecker) #1

Hey guys,
I really need your help. Since 1 week I am playing around to get my homematic thermostats hm-cc-rt-dn working again. As you know since upgrade to 2.4 there is issue with “Can’t convert type QuantityType with value”. I was reading all posts on this topic, but workaround deleting thing and adding again is not working for me. I have changed the rules to use Quantity type conversion. So I guess there is something else wrong.
Strange is, that also my Mode changing is not working.

The log outcome:

2019-01-16 09:34:07.059 [WARN ] [ematic.handler.HomematicThingHandler] - Can’t convert type QuantityType with value ‘22.5 C’ to FLOAT value with DecimalTypeConverter for ‘LEQ0781024:4#SET_TEMPERATURE’, please check the item type and the commands in your scripts

items definition:

Number:Temperature Heating_livingroom_SET_TEMP  "Living room Soll-Temp [%.1f C]"	<temperature> 	(dospat_livingroom, Heating)
    	{channel="homematic:HG-HM-CC-RT-DN:HOMEGEAR:LEQ0781273:4#SET_TEMPERATURE"}
Number:Temperature Heating_livingroom_ACTUAL_TEMP  "Living room Is Temp [%.1f C]"    <temperature>   (dospat_livingroom, Heating) 
	{channel="homematic:HG-HM-CC-RT-DN:HOMEGEAR:LEQ0781273:4#ACTUAL_TEMPERATURE"}
Number Heating_livingroom_Valve_State  "Living room valve position [%d %%]"    <settings>   (dospat_livingroom, Heating)  
        {channel="homematic:HG-HM-CC-RT-DN:HOMEGEAR:LEQ0781273:4#VALVE_STATE"}
Number Heating_livingroom_Battery_State  "Living room Battery [%.1f V]"    <settings>   (dospat_livingroom, Heating)  
        {channel="homematic:HG-HM-CC-RT-DN:HOMEGEAR:LEQ0781273:0#LOWBAT"}
Number Heating_livingroom_Boost_Countdown "Living room Boost countdown [%.0f min]"    <setting>      { channel="homematic:HM-CC-RT-DN:HOMEGEAR:LEQ0781273:4#BOOST_STATE" }
String  Livingroom_Control_Mode_CCU2    "Living room Mode CCU2 [%s]"                <settings>    (dospat_livingroom, Heating)  { channel="homematic:HM-CC-RT-DN:HOMEGEAR:LEQ0781273:4#CONTROL_MODE" }
String Livingroom_Control_Mode_openHAB "Living room Mode openHAB[%s]"             <settings> 
String Livingroom_Control_Mode_Manu    "Living room Manual mode"                  <settings>     (dospat_livingroom, Heating)  { channel="homematic:HM-CC-RT-DN:HOMEGEAR:LEQ0781273:4#MANU_MODE" }
Switch  Livingroom_Control_Mode_Auto     "Living room Automatic mode"                <settings>   (dospat_livingroom, Heating)   { channel="homematic:HM-CC-RT-DN:HOMEGEAR:LEQ0781273:4#AUTO_MODE" }
Switch  Livingroom_Control_Mode_Boost   "Living room Boost mode"                    <settings>   (dospat_livingroom, Heating)   { channel="homematic:HM-CC-RT-DN:HOMEGEAR:LEQ0781273:4#BOOST_MODE" }

rules:

rule "Thermostat mode Kidroom room"
when
    Item Kidroom_Control_Mode_openHAB changed 
then
    logDebug("homematic", "Mode switcher rule of Kidroom room executed with control mode '{}'", 
        Kidroom_Control_Mode_openHAB.state.toString)		
if("MANU-MODE".equals(Kidroom_Control_Mode_openHAB.state.toString)) {			
    Kidroom_Control_Mode_Manu.sendCommand(Heating_kidroom_SET_TEMP.state as QuantityType<Number>).doubleValue
    logInfo("homematic", "Switched Kidroom room to MANU_MODE with value {}", 
        Heating_kidroom_SET_TEMP.state as QuantityType<Number>).doubleValue
} else if("AUTO-MODE".equals(Kidroom_Control_Mode_openHAB.state.toString)) {
    Kidroom_Control_Mode_Auto.sendCommand(ON)
    logInfo("homematic", "Switched Kidroom room to AUTO_MODE")
} else if("BOOST-MODE".equals(Kidroom_Control_Mode_openHAB.state.toString)) {
    Kidroom_Control_Mode_Boost.sendCommand(ON)
    logInfo("homematic", "Switched Kidroom room to BOOST_MODE")
}
end

thank you for help in advance.


(Vincent Regaud) #2

You are missing the °

Number:Temperature Heating_livingroom_SET_TEMP  "Living room Soll-Temp [%.1f °C]" <temperature> (dospat_livingroom, Heating) {channel="homematic:HG-HM-CC-RT-DN:HOMEGEAR:LEQ0781273:4#SET_TEMPERATURE"}


(Johannes Nabecker) #3

thank you. Tried it immediately. now I get:

Blockquote2019-01-16 11:27:23.631 [ERROR] [ematic.handler.HomematicThingHandler] - null

java.lang.NullPointerException: null

at org.eclipse.smarthome.binding.homematic.internal.converter.type.QuantityTypeConverter.toBinding(QuantityTypeConverter.java:58) ~[213:org.eclipse.smarthome.binding.homematic:0.10.0.oh240]

at org.eclipse.smarthome.binding.homematic.internal.converter.type.QuantityTypeConverter.toBinding(QuantityTypeConverter.java:1) ~[213:org.eclipse.smarthome.binding.homematic:0.10.0.oh240]

at org.eclipse.smarthome.binding.homematic.internal.converter.type.AbstractTypeConverter.convertToBinding(AbstractTypeConverter.java:102) ~[213:org.eclipse.smarthome.binding.homematic:0.10.0.oh240]

at org.eclipse.smarthome.binding.homematic.handler.HomematicThingHandler.handleCommand(HomematicThingHandler.java:281) [213:org.eclipse.smarthome.binding.homematic:0.10.0.oh240]

at sun.reflect.GeneratedMethodAccessor81.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.$Proxy149.handleCommand(Unknown Source) [213: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.GeneratedMethodAccessor80.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) [?:?]

(Vincent Regaud) #4

Missing brackets

Kidroom_Control_Mode_Manu.sendCommand((Heating_kidroom_SET_TEMP.state as QuantityType<Number>).doubleValue)

(Johannes Nabecker) #5

Dear vzorglub,
thank you 1000 times. It is a shame, that after so many checking, I did not see both mistakes. I will try if all fine.


(Johannes Nabecker) #6

Hi
I can change temperature now. But unfortunatetly mode switching does not work. I have no idea why. “predicted to become NULL” indicated something is not OK.

Blockquote 2019-01-17 10:16:56.618 [ome.event.ItemCommandEvent] - Item ‘Livingroom_Control_Mode_openHAB’ received command MANU-MODE
2019-01-17 10:16:56.634 [vent.ItemStateChangedEvent] - Livingroom_Control_Mode_openHAB changed from AUTO-MODE to MANU-MODE
2019-01-17 10:16:56.695 [ome.event.ItemCommandEvent] - Item ‘Livingroom_Control_Mode_Manu’ received command 21.0
==> /var/log/openhab2/openhab.log <==
2019-01-17 10:16:56.702 [INFO ] [pse.smarthome.model.script.homematic] - Switched Living room to MANU_MODE with value 21.0
==> /var/log/openhab2/events.log <==
2019-01-17 10:16:56.702 [nt.ItemStatePredictedEvent] - Livingroom_Control_Mode_Manu predicted to become NULL


(Rossko57) #7

This message comes from OH autoupdate. When an Item is sent a command, autoupdate has a guess at what effect that might have on the Item.

In this case a String type item Livingroom_Control_Mode_Manu has been sent the numeric command 21.0 (presumably by some rule we cannot see?)

If you want that command to set the state of the Item, I think you’ll need to send it as a string “21.0” ( .toString is useful)
If you don’t want autoupdate to interfere, you can set it false for that Item.
If you don’t need to send a command at all, just change the state of the Item, use .postUpdate (but I think you’ll still need .toString)

It’s arguable that autoupdate ought to take care of that for you. There might be reasons why it doesn’t.


(Lukas) #8

How did you solved it?