They’ll need to see your Item definition.
I have disable the rules and shutdown karaf and restart it, now my KNX connection is working again
below the item config in paperUI
and the code in org.eclipse.smarthome.core.items.item.json
"KNXWeerbericht_BuitenTemperatuur": {
"class": "org.eclipse.smarthome.core.items.ManagedItemProvider$PersistedItem",
"value": {
"groupNames": [],
"itemType": "Number",
"tags": [],
"label": "Buiten temperatuur"
}
karaf console message
SLF4J: Failed toString() invocation on an object of type [org.eclipse.smarthome.core.items.events.ItemStateChangedEvent]
Reported exception:
java.lang.OutOfMemoryError: Java heap space
at java.util.Arrays.copyOf(Arrays.java:3332)
at java.lang.AbstractStringBuilder.ensureCapacityInternal(AbstractStringBuilder.java:124)
at java.lang.AbstractStringBuilder.append(AbstractStringBuilder.java:448)
at java.lang.StringBuilder.append(StringBuilder.java:136)
at java.lang.StringBuilder.append(StringBuilder.java:76)
at java.lang.AbstractStringBuilder.append(AbstractStringBuilder.java:484)
at java.lang.StringBuilder.append(StringBuilder.java:166)
at java.lang.StringBuilder.append(StringBuilder.java:76)
at java.util.Formatter$FormatSpecifier.print(Formatter.java:2913)
at java.util.Formatter$FormatSpecifier.printString(Formatter.java:2886)
at java.util.Formatter$FormatSpecifier.print(Formatter.java:2763)
at java.util.Formatter.format(Formatter.java:2520)
at java.util.Formatter.format(Formatter.java:2455)
at java.lang.String.format(String.java:2940)
at org.eclipse.smarthome.core.items.events.ItemStateChangedEvent.toString(ItemStateChangedEvent.java:89)
at org.slf4j.helpers.MessageFormatter.safeObjectAppend(MessageFormatter.java:299)
at org.slf4j.helpers.MessageFormatter.deeplyAppendParameter(MessageFormatter.java:271)
at org.slf4j.helpers.MessageFormatter.arrayFormat(MessageFormatter.java:233)
at org.slf4j.helpers.MessageFormatter.arrayFormat(MessageFormatter.java:173)
at org.slf4j.helpers.MessageFormatter.format(MessageFormatter.java:124)
at org.ops4j.pax.logging.slf4j.Slf4jLogger.info(Slf4jLogger.java:494)
at org.eclipse.smarthome.io.monitor.internal.EventLogger.receive(EventLogger.java:53)
at sun.reflect.GeneratedMethodAccessor16.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)
at org.eclipse.smarthome.core.internal.common.Invocation.call(Invocation.java:53)
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)
Modify your rule to logInfo the LocalWeather_Current_OutdoorTemperature Item. It’s possible you are trying to send the “command” NULL or UNDEF, which won’t work.
Does you KNXv2 binding work ok? (forget the rule for a moment and check if simple things work)
I think that you have more general problems that you need to address to improve the stability of your OH2 installation on Windows.
Try to make sure that the system is stable first before you start implementing rules.
stable = startup and basic operations without any errors and/or warnings in your logs.
i used weather underground information
when i use postUpdate, the paperUI ‘KNX weerbericht’ will display the same values
I have removed ‘Log ReaderBinding’ thing, removed the ‘Bleutooth Binding 2.4.0’ and ‘CometVisu Backend 2.4.0 UI’ form my configuration.
Now Karaf is quit
I will now try the rule again
I have just one remarque/question
My ‘KNX weerbericht’ is not a fysciale knx hardware device but a virtual openhab KNX device, so i dont have a fysical knx adres for it.
When i put heer a non existhing device adres, the the thing go to off line.
I now have adde the rules again
rule "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
in paperUi the KNX Weerbericht items are updated
in the KNX monitoring i only see the ‘Manual send’
‘Huidige toestand’ = 1/0/0 Type = String
‘Buiten temperatuur’ = 1/0/1 Type = Number
‘Vochtigheid’ = 1/0/2 Type = Number
all my other knx things and items are still working, so the bindinsg a disabled are the blocking part for the knx binding !?
openhab log
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) [?:?]
he rule now
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
This seems self evident ?
OK, i get it, but when i send a string that is to long the knx binding d’ont send the first 14 characters, then i have to cut the string in the rules
this is not solving that the numbers are not send to the knx bus
I take a look around in the community about KNX and numbers and see many people where it dont work and no direct solution.
Also i try to send a value directly
sendCommand(KNXWeerbericht_BuitenTemperatuur,14)
with no result on the KNX bus may the format (int/float or other) has to put into the rules ?
Thanks to all for the given support
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.
Everithing is define within paperUI, there is no *.thing or *.item file
i want to send this value to a knx device (touch screen)
the value is comming from
“Manual Send” is used to force the values to the knx bus
and this wath i see on the knx side
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