2018-12-13 23:16:03.512 [INFO ] [home.model.script.Weerbericht_Manual] - Manual - Sending Temp to KNX
2018-12-13 23:16:03.543 [WARN ] [nx.internal.client.AbstractKNXClient] - Value 'Gedeeltelijk bewolkt' could not be sent to the KNX bus using datapoint 'command DP 1/0/0 'knx:ip:dd4cf70d', DPT id 16.001, low priority': 16.001 ISO-8859-1 string (Latin 1): maximum KNX string length is 14 characters: Gedeeltelijk bewolkt. Giving up now.
2018-12-13 23:16:03.544 [WARN ] [.internal.handler.DeviceThingHandler] - An error occurred on channel knx:device:6cec9f52:Huidige_toestand: 16.001 ISO-8859-1 string (Latin 1): maximum KNX string length is 14 characters: Gedeeltelijk bewolkt
tuwien.auto.calimero.KNXFormatException: 16.001 ISO-8859-1 string (Latin 1): maximum KNX string length is 14 characters: Gedeeltelijk bewolkt
at tuwien.auto.calimero.dptxlator.DPTXlator.newException(DPTXlator.java:505) ~[253:org.openhab.binding.knx:2.4.0.201812121631]
at tuwien.auto.calimero.dptxlator.DPTXlator.newException(DPTXlator.java:510) ~[253:org.openhab.binding.knx:2.4.0.201812121631]
at tuwien.auto.calimero.dptxlator.DPTXlatorString.toDPT(DPTXlatorString.java:192) ~[253:org.openhab.binding.knx:2.4.0.201812121631]
at tuwien.auto.calimero.dptxlator.DPTXlator.setValue(DPTXlator.java:186) ~[253:org.openhab.binding.knx:2.4.0.201812121631]
at tuwien.auto.calimero.process.ProcessCommunicatorImpl.write(ProcessCommunicatorImpl.java:358) ~[253:org.openhab.binding.knx:2.4.0.201812121631]
at org.openhab.binding.knx.internal.client.AbstractKNXClient.sendToKNX(AbstractKNXClient.java:453) ~[253:org.openhab.binding.knx:2.4.0.201812121631]
at org.openhab.binding.knx.internal.client.AbstractKNXClient.writeToKNX(AbstractKNXClient.java:413) ~[253:org.openhab.binding.knx:2.4.0.201812121631]
at org.openhab.binding.knx.internal.handler.DeviceThingHandler.lambda$7(DeviceThingHandler.java:229) ~[253:org.openhab.binding.knx:2.4.0.201812121631]
at org.openhab.binding.knx.internal.handler.DeviceThingHandler.withKNXType(DeviceThingHandler.java:124) [253:org.openhab.binding.knx:2.4.0.201812121631]
at org.openhab.binding.knx.internal.handler.DeviceThingHandler.withKNXType(DeviceThingHandler.java:118) [253:org.openhab.binding.knx:2.4.0.201812121631]
at org.openhab.binding.knx.internal.handler.DeviceThingHandler.handleCommand(DeviceThingHandler.java:224) [253:org.openhab.binding.knx:2.4.0.201812121631]
at sun.reflect.GeneratedMethodAccessor112.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.201812121521]
at org.eclipse.smarthome.core.internal.common.InvocationHandlerSync.invoke(InvocationHandlerSync.java:59) [102:org.eclipse.smarthome.core:0.10.0.201812121521]
at com.sun.proxy.$Proxy154.handleCommand(Unknown Source) [253:org.openhab.binding.knx:2.4.0.201812121631]
at org.eclipse.smarthome.core.thing.internal.profiles.ProfileCallbackImpl.handleCommand(ProfileCallbackImpl.java:75) [109:org.eclipse.smarthome.core.thing:0.10.0.201812121521]
at org.eclipse.smarthome.core.thing.internal.profiles.SystemDefaultProfile.onCommandFromItem(SystemDefaultProfile.java:49) [109:org.eclipse.smarthome.core.thing:0.10.0.201812121521]
at sun.reflect.GeneratedMethodAccessor111.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.201812121521]
at org.eclipse.smarthome.core.internal.common.Invocation.call(Invocation.java:53) [102:org.eclipse.smarthome.core:0.10.0.201812121521]
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) [?:?]
rule "Automatic_Weerbericht"
when
Time cron '0 0/5 * * * ? *'
then
logInfo("Weerbericht_Cron", "Cron - Sending Temp to KNX")
sendCommand(KNXWeerbericht_BuitenTemperatuur,LocalWeather_Current_OutdoorTemperature.state.toString)
sendCommand(KNXWeerbericht_HuidigeToestand,LocalWeather_Current_CurrentConditions.state.toString)
sendCommand(KNXWeerbericht_Vochtigheid,LocalWeather_Current_AtmosphericHumidity.state.toString)
end
rule "Manual_Weerbericht"
when
Item KNXWeerbericht_ManualSend received command "ON"
then
logInfo("Weerbericht_Manual", "Manual - Sending Temp to KNX")
sendCommand(KNXWeerbericht_BuitenTemperatuur,LocalWeather_Current_OutdoorTemperature.state.toString)
sendCommand(KNXWeerbericht_HuidigeToestand,LocalWeather_Current_CurrentConditions.state.toString)
sendCommand(KNXWeerbericht_Vochtigheid,LocalWeather_Current_AtmosphericHumidity.state.toString)
sendCommand(KNXWeerbericht_ManualSend,OFF )
end
As already pointed out, sendComand() can be a bit flaky. It has to guess if you are trying to send a string or a number or an ON/OFF etc.
KNXWeerbericht_BuitenTemperatuur.sendCommand(14)
The Item knows what type of Item it is and is better at working out what you’re trying to do.
It’s all got very confusing with talk of KNX devices that don’t exist.
Could you simplify with showing us one Thing , one Number Item that you are trying to work with, and explain what goes wrong and what you can see happening.
I have found part of the solution, the problem seems to be the conversion of the values.
When converthing xx.state as Number and the put it back var.floatValue
Now i have to find the code to cover a -NAN% in the source value
below my code
var Number temp10
var Number vocht10
rule "Automatic_Weerbericht"
when
Time cron '0 0/5 * * * ? *'
then
logInfo("Weerbericht_Cron", "Cron - Sending Temp to KNX")
sendCommand(KNXWeerbericht_BuitenTemperatuur,LocalWeather_Current_OutdoorTemperature.state.toString)
switch LocalWeather_Current_CurrentConditions.state {
case "Merendeels bewolkt" :
sendCommand(KNXWeerbericht_HuidigeToestand,"Bewolkt")
case "Gedeeltelijk bewolkt" :
sendCommand(KNXWeerbericht_HuidigeToestand,"Bewolkt")
}
sendCommand(KNXWeerbericht_Vochtigheid,LocalWeather_Current_AtmosphericHumidity.state.toString)
end
rule "Manual_Weerbericht"
when
Item KNXWeerbericht_ManualSend received command "ON"
then
logInfo("Weerbericht_Manual", "Manual - Sending Temp to KNX")
//sendCommand(KNXWeerbericht_BuitenTemperatuur,LocalWeather_Current_OutdoorTemperature.state.toString)
temp10=(LocalWeather_Current_OutdoorTemperature.state as Number)
sendCommand(KNXWeerbericht_BuitenTemperatuur,temp10.floatValue)
switch LocalWeather_Current_CurrentConditions.state {
case "Merendeels bewolkt" :
sendCommand(KNXWeerbericht_HuidigeToestand,"Bewolkt")
case "Gedeeltelijk bewolkt" :
sendCommand(KNXWeerbericht_HuidigeToestand,"Bewolkt")
}
/**/sendCommand(KNXWeerbericht_Vochtigheid,LocalWeather_Current_AtmosphericHumidity.state.toString)**
** //LocalWeather_Current_AtmosphericHumidity**
** //if (LocalWeather_Current_AtmosphericHumidity.state != null)**
** //{**
** // vocht10=(LocalWeather_Current_AtmosphericHumidity.state as Number)**
// sendCommand(KNXWeerbericht_Vochtigheid,vocht10.floatValue)
//}
Thread::sleep(1000)
sendCommand(KNXWeerbericht_ManualSend,OFF )
end
var Number temp10
var Number vocht10
rule "Automatic_Weerbericht"
when
Time cron '0 0/5 * * * ? *'
then
logInfo("Weerbericht_Cron", "Cron - Sending Temp to KNX")
sendCommand(KNXWeerbericht_BuitenTemperatuur,LocalWeather_Current_OutdoorTemperature.state.toString)
switch LocalWeather_Current_CurrentConditions.state {
case "Merendeels bewolkt" :
sendCommand(KNXWeerbericht_HuidigeToestand,"Bewolkt")
case "Gedeeltelijk bewolkt" :
sendCommand(KNXWeerbericht_HuidigeToestand,"Bewolkt")
}
sendCommand(KNXWeerbericht_Vochtigheid,LocalWeather_Current_AtmosphericHumidity.state.toString)
end
rule "Manual_Weerbericht"
when
Item KNXWeerbericht_ManualSend received command "ON"
then
logInfo("Weerbericht_Manual", "Manual - Sending Temp to KNX")
if (LocalWeather_Current_OutdoorTemperature.state != UNDEF)
{
temp10=(LocalWeather_Current_OutdoorTemperature.state as Number)
sendCommand(KNXWeerbericht_BuitenTemperatuur,temp10.floatValue)
}
if (KNXWeerbericht_HuidigeToestand != UNDEF)
{
switch LocalWeather_Current_CurrentConditions.state
{
case "Merendeels bewolkt" :
sendCommand(KNXWeerbericht_HuidigeToestand,"Meer Bewolkt")
case "Gedeeltelijk bewolkt" :
sendCommand(KNXWeerbericht_HuidigeToestand,"GedeeldBewolkt")
case "Bewolkt" :
sendCommand(KNXWeerbericht_HuidigeToestand,"Bewolkt")
}
}
else
{
sendCommand(KNXWeerbericht_HuidigeToestand,"OFF-LINE")
}
if (LocalWeather_Current_AtmosphericHumidity.state != UNDEF)
{
vocht10=(LocalWeather_Current_AtmosphericHumidity.state as Number)
sendCommand(KNXWeerbericht_Vochtigheid,vocht10.floatValue)
}
Thread::sleep(1000)
sendCommand(KNXWeerbericht_ManualSend,OFF )
end
when a edit the rules with visual studio code i get this error :
at java.lang.Thread.run(Thread.java:748)
Caused by: java.lang.RuntimeException: Cannot create a resource for 'java:/Objects/org.eclipse.smarthome.model.script.actions.BusEvent'; a registered resource factory is needed