Try to use rules to send valeus on the KNX from other bindings

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
afbeelding

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

afbeelding

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
afbeelding

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 !?

Ok there more comming on the KNX bus, Sting is send on the bus, now the Numbers ti get it to work

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 :slight_smile:

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

afbeelding



i want to send this value to a knx device (touch screen)

the value is comming from
afbeelding

“Manual Send” is used to force the values to the knx bus
and this wath i see on the knx side


afbeelding

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
afbeelding

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 

Have found solution, see code below

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 

Everithing is send correctly on the KNX bus

Problems with rules and knx bus not solved

This is my status now
my rule

rule "Manual_Weerbericht"
when 
    Item KNXWeerbericht_ManualSend received command "ON"

then 
    logInfo("Weerbericht_Manual", "Manual - Sending Temp to KNX")

   
    if (LocalWeather_Current_OutdoorTemperature.state.toString != UNDEF)
    {
        sendCommand(KNX1_1_7_BuitenTemperatuur,LocalWeather_Current_OutdoorTemperature.state as Number)        
               
    }
    else 
    {
        sendCommand(KNX1_1_7_BuitenTemperatuur,0)
    }
    
    if (LocalWeather_Current_CurrentConditions.state.toString != UNDEF)
    {
        lengte10 = LocalWeather_Current_CurrentConditions.state.toString.length-1
        if (lengte10>13)
        {
            sendCommand(KNX1_1_7_HuidigeToestand01,LocalWeather_Current_CurrentConditions.state.toString.indexOf(0,13) )
            sendCommand(KNX1_1_7_HuidigeToestand02,LocalWeather_Current_CurrentConditions.state.toString.indexOf(14,lengte10))
        }
        else 
        {
            sendCommand(KNX1_1_7_HuidigeToestand01,LocalWeather_Current_CurrentConditions.state.toString)
            sendCommand(KNX1_1_7_HuidigeToestand02," ")
        }
       
    }
    else 
    {
       sendCommand(KNXWeerbericht_HuidigeToestand,"OFF-LINE") 
       
    }
  
    
    if (LocalWeather_Current_AtmosphericHumidity.state.toString != UNDEF)
    {
        
        sendCommand(KNXWeerbericht_Vochtigheid,LocalWeather_Current_AtmosphericHumidity.state as Number)
    }
    else 
    {
        sendCommand(KNXWeerbericht_Vochtigheid,0)
    }

    if (LocalWeather_Current_WindSpeed.state != UNDEF)
    {
        sendCommand(KNX1_1_7_Windsnelheid,LocalWeather_Current_WindSpeed.state as Number)
    }
    else 
    {
        sendCommand(KNX1_1_7_Windsnelheid,0)
    }

    if (LocalWeather_Current_BarometricPressure.state.toString != UNDEF)
    {
        sendCommand(KNX1_1_7_Luchtdruk,LocalWeather_Current_BarometricPressure.state as Number)
    }
    else 
    {
        sendCommand(KNX1_1_7_Luchtdruk,0)
    }

    if (LocalWeather_Current_WindGust.state.toString != UNDEF)
    {
        sendCommand(KNX1_1_7_Rukwindsnelhied,LocalWeather_Current_WindGust.state as Number)
    }
    else 
    {
        sendCommand(KNX1_1_7_Rukwindsnelhied,0)
    }


    Thread::sleep(500)
    sendCommand(KNXWeerbericht_ManualSend,OFF )
    
end 

Only 3 of these values are send on the knx bus :

            sendCommand(KNX1_1_7_HuidigeToestand01,LocalWeather_Current_CurrentConditions.state.toString.indexOf(0,13) )
            sendCommand(KNX1_1_7_HuidigeToestand02,LocalWeather_Current_CurrentConditions.state.toString.indexOf(14,lengte10))

            sendCommand(KNXWeerbericht_Vochtigheid,LocalWeather_Current_AtmosphericHumidity.state as Number)

the are updated in the paperUI
destination

Soure
afbeelding
and not on the knx bus

some one any idee what to check now

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

I have change my setup to *.things files and item files see https://community.openhab.org/t/thing-definition-wit-multiple-files-and-missing-syntax-information/61922

here i found out that indexOf(x,y) has to be substring(x,y)

Weer11=LocalWeather_Current_CurrentConditions.state.toString.substring(13,26)