I’m looking for some support (pot. script) on the following scenario:
I’m running openhab 2.5M6 on a RaspberryPie with KNX binding and Modbus binding (for our Tecpalor heat pump with air circulation) working. I would like to set on KNX the level of air circulation (e.g through a knx panel Gira G1). Means a defined value from knx bus will trigger a change on Modbus.
Any help to handover data between the bindings (actually handled in two different actions) is welcome.
Just about everything you might want to process or select in openHAB will be done by Items.
So you would set up your KNX “source” to set the value of an Item, by linking it to a KNX channel.
You can arrange for a rule to trigger if that Item changes, or every Wednesday, or whatever you want.
That rule can do whatever processing you want, taking into account other conditions if you wish, and send (or choose not to send) some command to another Item.
That Item in turn links to a Modbus channel to set whatever register it is in your “target” device.
having an knx.items with defined and working (checked w BasicUI) Number Luefterstufe "Tecalor Lüfterstufe" { channel="knx:device:bridge:GiraG1_EG:Luefterstufe" }
the Modbus variables are handled though a lwz.items file, as mentioned its working for data logging well
tried following rule
rule "Lueftungssteuerung"
when
Item Luefterstufe changed
then
var Number Sollstufe = Luefterstufe
LWZ_Lueftung_StufeTag.sendCommand(Sollstufe)
end
ending up with following error
2019-12-09 16:11:50.026 [ERROR] [ntime.internal.engine.RuleEngineImpl] - Rule ‘Lueftungssteuerung’: An error occurred during the script execution: Could not invoke method: org.eclipse.smarthome.model.script.actions.BusEvent.sendCommand(org.eclipse.smarthome.core.items.Item,java.lang.Number) on instance: null
Not sure why ending up with null. Tried with a fixed Number and it works…
You can find out. If curious about what your Sollstuffe variable is, add a line -
logInfo("test" , "my variable {} ", Sollstuffe)
But in this case, it is just what @Sonic says, you have made Sollstuffe the whole Item object - with name, label, type, etc. A whole object is not a number or sensible command.
It’s the state property of your Item that you are interested in